Skip to content

Commit

Permalink
Replace null with empty string on add menu page
Browse files Browse the repository at this point in the history
Achieves the same effect — keeping those submenus from being displayed —
while avoiding PHP errors.

Closes: #168
  • Loading branch information
Vicente Canales committed Oct 24, 2023
1 parent 6cda097 commit ef36c11
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions admin/class-manage-fonts.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ function create_admin_menu() {

$google_fonts_page_title = _x( 'Embed Google font in the active theme', 'UI String', 'create-block-theme' );
$google_fonts_menu_title = $google_fonts_page_title;
add_submenu_page( null, $google_fonts_page_title, $google_fonts_menu_title, 'edit_theme_options', 'add-google-font-to-theme-json', array( 'Google_Fonts', 'google_fonts_admin_page' ) );
add_submenu_page( '', $google_fonts_page_title, $google_fonts_menu_title, 'edit_theme_options', 'add-google-font-to-theme-json', array( 'Google_Fonts', 'google_fonts_admin_page' ) );

$local_fonts_page_title = _x( 'Embed local font in the active theme', 'UI String', 'create-block-theme' );
$local_fonts_menu_title = $local_fonts_page_title;
add_submenu_page( null, $local_fonts_page_title, $local_fonts_menu_title, 'edit_theme_options', 'add-local-font-to-theme-json', array( 'Local_Fonts', 'local_fonts_admin_page' ) );
add_submenu_page( '', $local_fonts_page_title, $local_fonts_menu_title, 'edit_theme_options', 'add-local-font-to-theme-json', array( 'Local_Fonts', 'local_fonts_admin_page' ) );
}

function has_file_and_user_permissions() {
Expand Down

0 comments on commit ef36c11

Please sign in to comment.