• Resolved jrvcosta

    (@jrvcosta)


    Hi!

    I know I can use the snippet below to order the menu items on the wordpress dashboard. But how do I insert the Foobox menu? Using the line 'admin.php?page=foobox-image-lightbox' doesn’t work.

    
    function wpse_custom_menu_order( $menu_ord ) {
        if ( !$menu_ord ) return true;
        return array(
            'index.php', 
            'edit.php', 
            'edit.php?post_type=page', 
            'upload.php', 
            'tools.php', 
            'plugins.php', 
            'themes.php', 
            'users.php', 
    	'edit.php?post_type=foogallery' // FooGallery
        );
    }
    add_filter( 'custom_menu_order', 'wpse_custom_menu_order', 10, 1 );
    add_filter( 'menu_order', 'wpse_custom_menu_order', 10, 1 );

    Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author bradvin

    (@bradvin)

    hi @jrvcosta

    Can you share your final code with the foobox menu item included so I can take a look?

    Thread Starter jrvcosta

    (@jrvcosta)

    Sure! I just added one line to the previous code:

    
    function wpse_custom_menu_order( $menu_ord ) {
        if ( !$menu_ord ) return true;
        return array(
            'index.php', // Dashboard
            'edit.php', // Posts
            'edit.php?post_type=page', // Pages
            'upload.php', // Media
            'options-general.php', // Configura??es
            'tools.php', // Ferramentas
            'plugins.php', // Plugins
            'themes.php', // Aparência
            'users.php', // Usuários
            'separator-last', // Separador
    	'admin.php?page=foobox-image-lightbox', //Foobox
    	'edit.php?post_type=foogallery' // FooGallery
        );
    }
    add_filter( 'custom_menu_order', 'wpse_custom_menu_order', 10, 1 );
    add_filter( 'menu_order', 'wpse_custom_menu_order', 10, 1 );

    `

    Plugin Author bradvin

    (@bradvin)

    @jrvcosta

    Can you change the priority from 10 to 100? So your code runs later.
    Perhaps the foobox menu is being added after your code runs

    Thread Starter jrvcosta

    (@jrvcosta)

    It didn’t work for me. Not even when I set the priority to 999.

    Is the line admin.php?page=foobox-image-lightbox really correct??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Position in admin menu’ is closed to new replies.