Make WordPress Core

Ticket #25897: 25897.diff

File 25897.diff, 2.0 KB (added by micahwave, 11 years ago)
  • wp-content/themes/twentyfourteen/functions.php

     
    235235        if ( is_active_sidebar( 'sidebar-3' ) )
    236236                wp_enqueue_script( 'jquery-masonry' );
    237237
    238         if ( is_front_page() && 'slider' == get_theme_mod( 'featured_content_layout' ) )
    239                 wp_enqueue_script( 'twentyfourteen-slider', get_template_directory_uri() . '/js/slider.js', array( 'jquery' ), '20131028', true );
     238        if ( is_front_page() && 'slider' == get_theme_mod( 'featured_content_layout' ) ) {
     239                wp_enqueue_script( 'twentyfourteen-slider', get_template_directory_uri() . '/js/slider.js', array( 'jquery' ), time(), true );
     240                wp_localize_script( 'twentyfourteen-slider', 'featuredSliderDefaults', array(
     241                        'prevText' => __( 'Previous', 'twentyfourteen' ),
     242                        'nextText' => __( 'Next', 'twentyfourteen' )
     243                ) );
     244        }
    240245
    241246        wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20131102', true );
    242247}
  • wp-content/themes/twentyfourteen/js/slider.js

     
    547547                controlsContainer: '',    // jQuery Object/Selector: container navigation to append elements.
    548548
    549549                // Text labels: @todo allow translation
    550                 prevText: 'Previous',    // String: Set the text for the "previous" directionNav item.
    551                 nextText: 'Next'          // String: Set the text for the "next" directionNav item.
     550                prevText: featuredSliderDefaults.prevText, // String: Set the text for the "previous" directionNav item.
     551                nextText: featuredSliderDefaults.nextText  // String: Set the text for the "next" directionNav item.
    552552        };
    553553
    554554        // FeaturedSlider: plugin function.
     
    571571                        } );
    572572                }
    573573        };
    574 } )( jQuery );
     574} )( jQuery );
     575 No newline at end of file