Photos: Fixed an issue where navigation JS isn't enqueued when a menu isn't set

This commit is contained in:
Chris Runnells 2018-11-15 16:17:57 -10:00
parent f02fa7598d
commit 6b3a7b4499

View file

@ -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 );