WordPress.org

Ready to get started?Download WordPress

Forums

CMS-Like Admin Menu
Broken: URLs are wrong, icons are missing (2 posts)

  1. Helen Hou-Sandi
    WordPress Dev
    Posted 4 years ago #

    This plugin is broken as of WP 3.0 due to a few changed admin URLs.

    • Pages URL is now edit.php?post_type=page
    • New page URL is now post-new.php?post_type=page
    • Post categories URL is now edit-tags.php?taxonomy=category

    Also, post tags appears twice in the menu and shows above categories, which is not the case in the default menu. Commenting the foreach loop out fixed the problem.

    Finally, the menu icons are missing due to a missing CSS class. menu-item-page or menu-item-post should come after menu-top.

    Editing all of the above fixed it!

    http://wordpress.org/extend/plugins/cms-like-admin-menu/

  2. devbit
    Member
    Posted 4 years ago #

    Thank you for the post, it doesn't look like this plugin is getting updated anytime soon though. Quick correction, the missing Classes are actually menu-icon-page & menu-icon-post

    Here is the full source of the updated plugin if anyone is unsure of how to edit:

    <?php
    /*
    	Plugin Name: CMS-like Admin Menu (3.0 Compatible)
    	Plugin URI: http://reciprocity.be/cms-menu/
    	Version: 2.2
    	Description: Makes the WordPress Admin menu focused for a more CMS-like usage.
    	Author: Keith Solomon
    	Author URI: http://reciprocity.be/
    
    	Copyright (c) 2009 Keith Solomon (http://reciprocity.be)
    	CMS-like Admin Menu is released under the GNU General Public License (GPL)
    	http://www.gnu.org/licenses/gpl.txt
    */
    
    /**
     * Changes the positions of the Post and Page menu items in admin menu bar.
     *
     * The elements in the $menu[x] array are:
     *     0: Menu item name
     *     1: Minimum level or capability required.
     *     2: The URL of the item's file
     *     3: Class
     *     4: ID
     *     5: Icon for top level menu
     */
    
    if (!function_exists('change_post_links')) {
    	function change_post_links() {
    		global $menu, $submenu, $wp_taxonomies;
    
    		// Unset Post & Page menus so we can change them
    		unset($menu[5]);
    		unset($menu[20]);
    
    		// Change menu order to reflect new positions
    		$menu[5] = array(__('Pages'), 'edit_pages', 'edit.php?post_type=page', '', 'wp-menu-open menu-top menu-icon-page', 'menu-pages', 'div');
    		$submenu['edit-pages.php'][5] = array(__('Edit'), 'edit_pages', 'edit.php?post_type=page');
    		$submenu['edit-pages.php'][10] = array(_c('Add New|page'), 'edit_pages', 'post-new.php?post_type=page');
    
    		$menu[20] = array(__('Posts'), 'edit_posts', 'edit.php', '', 'menu-top menu-icon-post', 'menu-posts', 'div');
    		$submenu['edit.php'][5]  = array(__('Edit'), 'edit_posts', 'edit.php');
    		$submenu['edit.php'][10]  = array(_c('Add New|post'), 'edit_posts', 'post-new.php');
    
    		$i = 15;
    		/*foreach ( $wp_taxonomies as $tax ) {
    			if ( $tax->hierarchical || ! in_array('post', (array) $tax->object_type, true) )
    				continue;
    
    			$submenu['edit.php'][$i] = array( esc_attr($tax->label), 'manage_categories', 'edit-tags.php?taxonomy=' . $tax->name );
    			++$i;
    		}
    
    		$submenu['edit.php'][50] = array( __('Categories'), 'manage_categories', 'edit-tags.php?taxonomy=category' );*/
    	}
    }
    
    add_action('admin_menu', 'change_post_links');
    ?>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic