• Hi,

    for our site we would like to do the following:

    Add previous/next links (pagination) in the post dashboard screen, for the posts belonging to the current author only.

    I’ve been looking but can’t find any information at all about this, let alone if this is possible or not.

    any thoughts ?

    • This topic was modified 4 years, 5 months ago by Jan Dembowski.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Are you referring to a frontend page, or the backend page?

    If you sort your posts by the Author in the backend, the pagination should be rendered by default.

    Thread Starter nessler

    (@nessler)

    in the backend, where the post is edited.
    Underneath the post content our editor requested to have the option built in to be able to navigate to the previous or following post, simply to not have to return to the index of posts.

    I don’t understand the problem.

    Go to your posts or pages –> click the Author name –> All posts / pages by that Author display with pagination.

    Thread Starter nessler

    (@nessler)

    in the back end, where you write your post, thus in the backend, where you write title and content. NOT in the oversight with all the posts. the editor wants to adjust something in one post, click on a link to go to the next and remain in the post edit screen.

    Thread Starter nessler

    (@nessler)

    Ok, that works but only gets me halfway.

    It does reproduce the previous and next links, however it does this for the entire post table.

    After some digging in the code I think I can alter this bit of code, however I can’t find a working example anywhere, to keep this to “in_author”.

    Is it possible to alter the get_previous_post() to restrict it to current author ? All I can find is a $taxonmy I can add which relates only to category.

    add_action('admin_print_footer_scripts','amm_edit_next_prev_post_button');
    function amm_edit_next_prev_post_button(){
        $screen = get_current_screen();
    	//echo "<pre>";
    	//print_r($screen);
        $supported_types = array('page', 'post');
        if( strpos($screen->parent_file, 'edit.php') !== FALSE && in_array($screen->id, $supported_types) && in_array($screen->post_type, $supported_types) && $screen->action != 'add'){
    		//Prev-Next are arranged acc. to post table so switched next to prev and prev to next
    		$next_post = get_previous_post();
    		$previous_post = get_next_post();
    		?>
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Add navigation links on post dashboard for current author only’ is closed to new replies.