menu_order
Filters the order of administration menu items.
A truthy value must first be passed to the custom_menu_order filter for this filter to work. Use the following to enable custom menu ordering:
add_filter( 'custom_menu_order', '__return_true' );
Использование
add_filter( 'menu_order', 'wp_kama_menu_order_filter' ); /** * Function for `menu_order` filter-hook. * * @param array $menu_order An ordered array of menu items. * * @return array */ function wp_kama_menu_order_filter( $menu_order ){ // filter... return $menu_order; }
- $menu_order(массив)
- An ordered array of menu items.
Список изменений
С версии 2.8.0 | Введена. |
Где вызывается хук
В файле: /wp-admin/includes/menu.php
menu_order
wp-admin/includes/menu.php 306
$menu_order = apply_filters( 'menu_order', $menu_order );