| 1 |
<?php |
| 2 |
/** |
| 3 |
* Bootstraps the Fonts library page in wp-admin. |
| 4 |
* |
| 5 |
* @package gutenberg |
| 6 |
*/ |
| 7 |
|
| 8 |
add_action( 'admin_menu', 'gutenberg_register_fonts_menu_item' ); |
| 9 |
|
| 10 |
/** |
| 11 |
* Registers the Fonts menu item under Appearance using the gutenberg-boot-wp-admin routing infrastructure. |
| 12 |
*/ |
| 13 |
function gutenberg_register_fonts_menu_item() { |
| 14 |
if ( ! wp_is_block_theme() ) { |
| 15 |
return; |
| 16 |
} |
| 17 |
|
| 18 |
$url = admin_url( 'admin.php?page=gutenberg-boot-wp-admin&p=' . urlencode( '/font-list' ) ); |
| 19 |
|
| 20 |
add_submenu_page( |
| 21 |
'themes.php', |
| 22 |
__( 'Fonts', 'gutenberg' ), |
| 23 |
__( 'Fonts', 'gutenberg' ), |
| 24 |
'edit_theme_options', |
| 25 |
$url, |
| 26 |
'' |
| 27 |
); |
| 28 |
} |
| 29 |
|