wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



wp_register_font_library_menu_item › WordPress Function

Depuisn/a
Dépréciéen/a
› wp_register_font_library_menu_item ( $id, $label, $to, $parent_id = '', $parent_type = '' )
Paramètres: (5)
  • (string) $id Menu item ID.
    Requis: Oui
  • (string) $label Display label.
    Requis: Oui
  • (string) $to Route path to navigate to.
    Requis: Oui
  • (string) $parent_id Optional. Parent menu item ID.
    Requis: Non
    Défaut: (vide)
  • (string) $parent_type Optional. Parent type: 'drilldown' or 'dropdown'.
    Requis: Non
    Défaut: (vide)
Défini(e) dans:
Codex:

Register a menu item for the font-library page.



Source

function wp_register_font_library_menu_item( $id, $label, $to, $parent_id = '', $parent_type = '' ) {
	global $wp_font_library_menu_items;

	$menu_item = array(
		'id'    => $id,
		'label' => $label,
		'to'    => $to,
	);

	if ( ! empty( $parent_id ) ) {
		$menu_item['parent'] = $parent_id;
	}

	if ( ! empty( $parent_type ) && in_array( $parent_type, array( 'drilldown', 'dropdown' ), true ) ) {
		$menu_item['parent_type'] = $parent_type;
	}

	$wp_font_library_menu_items[] = $menu_item;
}