filtrdynamicznyod 4.3.0
nav_menu_items_{$post_type_name}_recent
Args 4Plik wp-admin/includes/nav-menu.php
Opis — z kodu źródłowego
Filters the posts displayed in the 'Most Recent' tab of the current post type's menu items meta box.
The dynamic portion of the hook name, $post_type_name, refers to the post type name.
Possible hook names include:
nav_menu_items_post_recentnav_menu_items_page_recent
Hook dynamiczny — możliwe nazwy
nav_menu_items_page_recentnav_menu_items_post_recentParametry
| Parametr | Typ | Opis |
|---|---|---|
$most_recent | \WP_Post[] | An array of post objects being listed. |
$args | array | An array of <code>WP_Query</code> arguments for the meta box. |
$box | array | Arguments passed to <code>wp_nav_menu_item_post_type_meta_box()</code>. |
$recent_args | array | An array of <code>WP_Query</code> arguments for 'Most Recent' tab. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'nav_menu_items_{$post_type_name}_recent', 'twoja_funkcja', 10, 4 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'nav_menu_items_{$post_type_name}_recent', 'twoja_funkcja', 10, 4 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
// Twój kod
}Popularne w tej kategorii