WP HOOKS
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_recent
  • nav_menu_items_page_recent

Hook dynamiczny — możliwe nazwy

nav_menu_items_page_recentnav_menu_items_post_recent

Parametry

ParametrTypOpis
$most_recent\WP_Post[]An array of post objects being listed.
$argsarrayAn array of <code>WP_Query</code> arguments for the meta box.
$boxarrayArguments passed to <code>wp_nav_menu_item_post_type_meta_box()</code>.
$recent_argsarrayAn 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
}

Popularne w tej kategorii