wp_nav_locations_listed_per_menu
Filters the number of locations listed per menu in the drop-down select.
Использование
add_filter( 'wp_nav_locations_listed_per_menu', 'wp_kama_nav_locations_listed_per_menu_filter' );
/**
* Function for `wp_nav_locations_listed_per_menu` filter-hook.
*
* @param int $locations Number of menu locations to list.
*
* @return int
*/
function wp_kama_nav_locations_listed_per_menu_filter( $locations ){
// filter...
return $locations;
}
- $locations(int)
- Number of menu locations to list.
По умолчанию: 3
Список изменений
| С версии 3.6.0 | Введена. |
Где вызывается хук
В файле: /wp-admin/nav-menus.php
wp_nav_locations_listed_per_menu
wp-admin/nav-menus.php 1006
$locations_listed_per_menu = absint( apply_filters( 'wp_nav_locations_listed_per_menu', 3 ) );