PluginProbe
Gutenberg / trunk
Gutenberg vtrunk
24.1.0 24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 All 404 releases
← All changes | lib/compat/plugin/fonts.php +22 -1 23.5.3 → trunk View file →
@@ -1,9 +1,9 @@
1 1 <?php
2 2 /**
3 3 * A special compat layer for legacy font files upload directory.
4 4 *
5 - * @see https://github.com/WordPress/gutenberg/pull/57688#issuecomment-2259037546
5 + * @link https://github.com/WordPress/gutenberg/pull/57688#issuecomment-2259037546
6 6 *
7 7 * @package gutenberg
8 8 */
9 9
@@ -40,4 +40,25 @@
40 40 }
41 41 }
42 42 }
43 43 add_action( 'before_delete_post', 'gutenberg_before_delete_font_face', 10, 2 );
44 +
45 +// Priority 11 to run after Core's menu.php sets up the fonts menu.
46 +add_action( 'admin_menu', 'gutenberg_register_fonts_menu_item', 11 );
47 +
48 +/**
49 + * Registers the Fonts menu item under Appearance using the font-library page.
50 + * Removes Core's fonts menu item first to prevent duplication.
51 + */
52 +function gutenberg_register_fonts_menu_item() {
53 + // Remove Core's fonts menu item if it exists.
54 + remove_submenu_page( 'themes.php', 'font-library.php' );
55 +
56 + add_submenu_page(
57 + 'themes.php',
58 + __( 'Fonts', 'gutenberg' ),
59 + __( 'Fonts', 'gutenberg' ),
60 + 'edit_theme_options',
61 + 'font-library-wp-admin',
62 + 'gutenberg_font_library_wp_admin_render_page'
63 + );
64 +}