WordPress.org

Codex

Plugin API/Filter Reference/custom menu order

Contents

Description

This hook activates the 'menu_order' filter. Return true in order to activate the 'menu_order' filter.

This filter can be used for example to switch to a different menu order for certain users or groups.


Usage

add_filter( 'custom_menu_order' , '__return_true');

Alternate Usage

/*
 * Code below groups Dashboard/Posts/Pages/Comments together at the top of the dashboard menu.
 * If you were to have a custom type that you want to add to the group use the following edit.php?post_type=YOURPOSTTYPENAME
 */
function my_menu_order( $menu_order ) {
       return array( 'index.php', 'edit.php', 'edit.php?post_type=page', 'edit-comments.php' );
}

add_filter( 'custom_menu_order', '__return_true' );
add_filter( 'menu_order', 'my_menu_order' );

Parameters

$flag
(bool) (required) Always false.
Default: None

Return Values

(bool) 
true|false.