Title: wp_register_font_library_menu_item
Published: May 20, 2026

---

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

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/wp_register_font_library_menu_item/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/functions/wp_register_font_library_menu_item/?output_format=md#source)

[ Back to top](https://developer.wordpress.org/reference/functions/wp_register_font_library_menu_item/?output_format=md#wp--skip-link--target)

Register a menu item for the font-library page.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/wp_register_font_library_menu_item/?output_format=md#parameters)󠁿

 `$id`stringrequired

Menu item ID.

`$label`stringrequired

Display label.

`$to`stringrequired

Route path to navigate to.

`$parent_id`stringoptional

Parent menu item ID.

Default:`''`

`$parent_type`stringoptional

Parent type: `'drilldown'` or `'dropdown'`.

Default:`''`

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_register_font_library_menu_item/?output_format=md#source)󠁿

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

[View all references](https://developer.wordpress.org/reference/files/wp-includes/build/pages/font-library/page.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/build/pages/font-library/page.php#L45)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/build/pages/font-library/page.php#L45-L63)

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_register_font_library_menu_item%2F)
before being able to contribute a note or feedback.