this is driving me crazy... I have an admin plugin page that lists pages for a wordpress website. I'm trying to list all the pages using get_pages() but for some reason once pages are published they don't show up anymore - when I use get_posts they show up, but the new draft pages don't :(
Here is the code.. please help
//this only displays the new draft pages - once published pages don't show up here
$args = array('post_status' => 'draft, publish');
$pages = get_pages($args);
foreach ( $pages as $page ) { some html code that displays the page title }
//this piece of code will return all pages onces they were published,
//even if 'unpublished' later - but will not return new draft pages
global $post;
$args2 = array( 'numberposts' => 50, 'post_status' => 'publish, draft');
$myposts = get_posts( $args2 );
foreach( $myposts as $post ) {
setup_postdata($post);
... some HTML code to display the pages
}
what's going on?
post_status
args?