WordPress.org

Ready to get started?Download WordPress

Forums

Editing a submenu link (4 posts)

  1. Nikolas
    Member
    Posted 5 years ago #

    I am trying to make edit.php to show only the author's posts instead of showing all the posts of the blog. ( I have several authors into my blog )
    If you click on the username of the author, in the edit.php you have this link: edit.php?author=1 (for author number 1)

    I think I found the variable that makes it :
    <?php the_author_meta('ID'); ?>

    under the :
    "><?php the_author() ?>

    but i got this error :
    Parse error: syntax error, unexpected T_STRING, expecting ')'

    when i tried to add it on wp-admin/menu.php here :
    $submenu['edit.php'][5] = array( __('Edit'), 'edit_posts', 'edit.php' );

    Anyone can help me by adding correctly the
    edit.php?author=<?php the_author_meta('ID'); ?>
    into the submenu ?

  2. Nikolas
    Member
    Posted 5 years ago #

    Because the system didnt let me to post correctly the url here it is again :

    a href = " edit . php ? author = <?php the_author_meta('ID') ; ?

  3. Nikolas
    Member
    Posted 5 years ago #

    anyone ?

  4. Warmduscher1
    Member
    Posted 4 years ago #

    Hi, I'm really new at WordPress, but let me take a shot. You might consider adding a submenu to the "Post" menu on the administration page. You could write a plugin as to not mess with the core code:

    '
    // Hook for adding admin menus
    add_action('admin_menu', 'mt_add_pages');

    // action function for above hook
    function mt_add_pages() {

    add_submenu_page('edit.php', 'page_title', 'Show my posts', 'author', 'edit.php?author=1', '');

    }
    '
    I hope this helps.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.