Jelajahi Sumber

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

Chris Runnells 6 tahun lalu
induk
melakukan
6b3a7b4499
1 mengubah file dengan 4 tambahan dan 6 penghapusan
  1. 4 6
      photos/functions.php

+ 4 - 6
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 );