$manage_fonts_page_title = _x( 'Manage Theme Fonts', 'UI String', 'create-block-theme' );
$manage_fonts_menu_title = $manage_fonts_page_title;
add_theme_page( $manage_fonts_page_title, $manage_fonts_menu_title, 'edit_theme_options', 'manage-fonts', array( 'Fonts_Page', 'manage_fonts_admin_page' ) );
// Check if the admin page title is set, and if not, set one.
// This is needed to avoid a warning in the admin menu, due to the admin page title not being set in
// the add_submenu_page() function for the Google Fonts and Local Fonts pages.
global $title;
if ( ! isset( $title ) ) {
$title = $manage_fonts_page_title;
}
Most admin titles are being set to
Manage Theme Fontswhen this plugin is enabled. It may be that other plugins are missing titles, but this should be restricted to the page.