Title: menu_order
Published: April 25, 2014
Last modified: August 20, 2026

---

# apply_filters( ‘menu_order’, array $menu_order )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/menu_order/?utm_source=www.bubuku.com&output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/menu_order/?utm_source=www.bubuku.com&output_format=md#parameters)
 * [More Information](https://developer.wordpress.org/reference/hooks/menu_order/?utm_source=www.bubuku.com&output_format=md#more-information)
 * [Source](https://developer.wordpress.org/reference/hooks/menu_order/?utm_source=www.bubuku.com&output_format=md#source)
 * [Changelog](https://developer.wordpress.org/reference/hooks/menu_order/?utm_source=www.bubuku.com&output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/hooks/menu_order/?utm_source=www.bubuku.com&output_format=md#user-contributed-notes)

Filters the order of administration menu items.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/menu_order/?utm_source=www.bubuku.com&output_format=md#description)󠁿

A truthy value must first be passed to the [‘custom_menu_order’](https://developer.wordpress.org/reference/hooks/custom_menu_order/)
filter for this filter to work. Use the following to enable custom menu ordering:

    ```php
    add_filter( 'custom_menu_order', '__return_true' );
    ```

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/menu_order/?utm_source=www.bubuku.com&output_format=md#parameters)󠁿

 `$menu_order`array

An ordered array of menu items.

## 󠀁[More Information](https://developer.wordpress.org/reference/hooks/menu_order/?utm_source=www.bubuku.com&output_format=md#more-information)󠁿

When filtering the order array, any menus that are not mentioned in the array will
be sorted after ones that are mentioned. Unmentioned menus are sorted in their usual
order, relative to other unmentioned menus.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/menu_order/?utm_source=www.bubuku.com&output_format=md#source)󠁿

    ```php
    $menu_order = apply_filters( 'menu_order', $menu_order );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/menu.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-admin/includes/menu.php#L313)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/menu.php#L313-L313)

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/menu_order/?utm_source=www.bubuku.com&output_format=md#changelog)󠁿

| Version | Description | 
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/hooks/menu_order/?utm_source=www.bubuku.com&output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/hooks/menu_order/?utm_source=www.bubuku.com&output_format=md#comment-content-4812)
 2.   [Steven Lin](https://profiles.wordpress.org/stevenlinx/)  [  6 years ago  ](https://developer.wordpress.org/reference/hooks/menu_order/#comment-4812)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fmenu_order%2F%23comment-4812)
    Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fmenu_order%2F%23comment-4812)
 4. Example Migrated from Codex:
 5. The example below orders menus with Dashboard, Posts, and Comments in the first
    menu group. The remaining menus follow in their usual order.
 6.     ```php
        add_filter( 'custom_menu_order', '__return_true' );
    
        add_filter( 'menu_order', 'custom_menu_order' );
    
        function custom_menu_order() {
        	return array( 'index.php', 'edit.php', 'edit-comments.php' );
        }
        ```
    
 7.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fmenu_order%2F%3Freplytocom%3D4812%23feedback-editor-4812)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fmenu_order%2F)
before being able to contribute a note or feedback.