I suddenly have a bug in my plugin, and I don't know what on earth could be causing it. This code is failing because get_permalink() is returning empty at all times:
$select = "SELECT * FROM `".DB_NAME."`.`wp_posts` WHERE `post_status` = 'publish'";
$result = mysql_query($select);
while($meta_posts = mysql_fetch_array($result, MYSQL_ASSOC) ){
$menu .= "<option value=\"".get_permalink($meta_posts['ID'])."\">".$meta_posts['post_title']."</option>\n";
}
It used to work just fine, all it does is return a dropdown menu of all the published WP posts/pages. Now I get the dropdown full of titles, but there is no permalink in the option value.
Anyone have any ideas why get_permalink() would be empty? I've even tried hardcoding a known postid into it, and it's still empty.