wp_register_font_library_menu_item( string $id, string $label, string $to, string $parent_id = '', string $parent_type = '' )

In this article

Register a menu item for the font-library page.

Parameters

$idstringrequired
Menu item ID.
$labelstringrequired
Display label.
$tostringrequired
Route path to navigate to.
$parent_idstringoptional
Parent menu item ID.

Default:''

$parent_typestringoptional
Parent type: 'drilldown' or 'dropdown'.

Default:''

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;
}

User Contributed Notes

You must log in before being able to contribute a note or feedback.