WordPress.org

Ready to get started?Download WordPress

Forums

Adding a 'Posts' menu on Top/Header Menu (1 post)

  1. Zord
    Member
    Posted 2 years ago #

    Hello guys, I wanted to add on my own blog a simple and quick link to the page Posts, a shortcut so that I can go there with just 1-click than going to [My Site]/Panel (/wp-admin/) and there go to the Posts page.

    So I created a simple code on ./wp-includes/admin-bar.php, after line 531 of the 'Add New' menu item, as follows:

    /**
     * Add "Posts" menu.
     *
     * A shortcut by Zord :-)
     */
    
    function wp_admin_bar_new_content_menu( $wp_admin_bar ) {
    	$actions = array();
    
    	if ( current_user_can( 'edit_posts' ) ) {
    		$actions[ 'edit.php' ] = array();
    	}
    
    }

    When I saved the file and reloaded, my blog gets an error 500, so I commented my code and here I am. I know I don't need the $actions=array() but how can I would link to there?

    I will appreciate your help! =)

Topic Closed

This topic has been closed to new replies.

About this Topic