Photos: Fixed an issue where navigation JS isn't enqueued when a menu isn't set
This commit is contained in:
parent
f02fa7598d
commit
6b3a7b4499
1 changed files with 4 additions and 6 deletions
|
@ -195,12 +195,10 @@ function photos_scripts() {
|
||||||
|
|
||||||
$photos_l10n = array();
|
$photos_l10n = array();
|
||||||
|
|
||||||
if ( has_nav_menu( 'menu-1' ) ) {
|
|
||||||
wp_enqueue_script( 'photos-navigation', get_theme_file_uri( '/js/navigation.js' ), array( 'jquery' ), '1.0', true );
|
wp_enqueue_script( 'photos-navigation', get_theme_file_uri( '/js/navigation.js' ), array( 'jquery' ), '1.0', true );
|
||||||
$photos_l10n['expand'] = esc_attr__( 'Expand child menu', 'photos' );
|
$photos_l10n['expand'] = esc_attr__( 'Expand child menu', 'photos' );
|
||||||
$photos_l10n['collapse'] = esc_attr__( 'Collapse child menu', 'photos' );
|
$photos_l10n['collapse'] = esc_attr__( 'Collapse child menu', 'photos' );
|
||||||
$photos_l10n['icon'] = photos_get_svg( array( 'icon' => 'expand', 'fallback' => true ) );
|
$photos_l10n['icon'] = photos_get_svg( array( 'icon' => 'expand', 'fallback' => true ) );
|
||||||
}
|
|
||||||
|
|
||||||
wp_localize_script( 'photos-navigation', 'photosScreenReaderText', $photos_l10n );
|
wp_localize_script( 'photos-navigation', 'photosScreenReaderText', $photos_l10n );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue