• Is there already a method built into WordPress that allows an administrator to call up all of the posts created by a specific author? Include any posts created under a custom post_types and drafts and so on.

Viewing 2 replies - 1 through 2 (of 2 total)
  • allows an administrator to call up all of the posts created by a specific author

    — where will they need to “call up all the posts?”

    In any case, you’ll probably need to create a new WP_Query and specify the author and post type:

    $author_args = array(
    	'author_name' => 'my_author_name',
    	'post_status' => 'any',
    	'post_type' => 'any'
    );
    $author_query = new WP_Query($author_args);
    
    // display results from $author_query
    if ( $author_query->have_posts() ) :
    	while ( $author_query->have_posts() ) : $author_query->the_post();
    		// custom markup goes here
    		// calling the_post() lets us use WP template tags like the_title()
    	endwhile;
    else :
    	// no posts found, maybe display an error message?
    endif;
    wp_reset_postdata();

    I see certainly a place where it would be useful : on the users.php page in the admin. Is there a hook to modify the value ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Find all author's posts, including custom post types’ is closed to new replies.