From 6b3a7b4499ca81b4ab8f6ea4a068083a82cc4a15 Mon Sep 17 00:00:00 2001 From: Chris Runnells Date: Thu, 15 Nov 2018 16:17:57 -1000 Subject: [PATCH] Photos: Fixed an issue where navigation JS isn't enqueued when a menu isn't set --- photos/functions.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/photos/functions.php b/photos/functions.php index 710f18005..b0cea8e14 100644 --- a/photos/functions.php +++ b/photos/functions.php @@ -195,12 +195,10 @@ function photos_scripts() { $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 ); - $photos_l10n['expand'] = esc_attr__( 'Expand child menu', 'photos' ); - $photos_l10n['collapse'] = esc_attr__( 'Collapse child menu', 'photos' ); - $photos_l10n['icon'] = photos_get_svg( array( 'icon' => 'expand', 'fallback' => 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['collapse'] = esc_attr__( 'Collapse child menu', 'photos' ); + $photos_l10n['icon'] = photos_get_svg( array( 'icon' => 'expand', 'fallback' => true ) ); wp_localize_script( 'photos-navigation', 'photosScreenReaderText', $photos_l10n );