wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



wp_register_options_connectors_menu_item › WordPress Function

Odn/a
Przestarzałyn/a
› wp_register_options_connectors_menu_item ( $id, $label, $to, $parent_id = '', $parent_type = '' )
Parametry: (5)
  • (string) $id Menu item ID.
    Wymagane: Tak
  • (string) $label Display label.
    Wymagane: Tak
  • (string) $to Route path to navigate to.
    Wymagane: Tak
  • (string) $parent_id Optional. Parent menu item ID.
    Wymagane: Nie
    Domyślny: (puste)
  • (string) $parent_type Optional. Parent type: 'drilldown' or 'dropdown'.
    Wymagane: Nie
    Domyślny: (puste)
Zdefiniowane na:
Codex:

Register a menu item for the options-connectors page.



Źródło

function wp_register_options_connectors_menu_item( $id, $label, $to, $parent_id = '', $parent_type = '' ) {
	global $wp_options_connectors_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_options_connectors_menu_items[] = $menu_item;
}