I’m trying to develop a WP plugin to show post(or page) related information (such as show all post title in a list) in an admin menu page. I tried to use “The Loop”, but it seems like “The Loop” cannot be accessed in Dashboard.
I have achieved my goal by using $wpdb to query database directly.
But is there a better or safer way to load post information in a dashboard menu page?
Thank you in advance.
You will want to use wp_query within the dashboard. This will allow you to create a private query that you have total control of and it works exactly like the query you know and love from WordPress themes.
http://codex.wordpress.org/Class_Reference/WP_Query