WordPress.org

Making WordPress.org


Ignore:
Timestamp:
06/22/2016 04:06:56 PM (6 years ago)
Author:
ocean90
Message:

Plugin Directory: Display a locale banner on non-plugin details pages.

See #1728.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/functions.php

    r3556 r3559  
    7575    if ( is_singular( 'plugin' ) ) {
    7676        wp_enqueue_script( 'wporg-plugins-accordion', get_template_directory_uri() . '/js/section-accordion.js', array(), '20160525', true );
    77 
    78         wp_enqueue_script( 'wporg-plugins-locale-banner', get_template_directory_uri() . '/js/locale-banner.js', array(), '20160622', true );
    79         wp_localize_script( 'wporg-plugins-locale-banner', 'wporgLocaleBanner', array(
    80             'apiURL' => rest_url( '/plugins/v1/locale-banner' ),
    81             'currentPlugin' => get_queried_object()->post_name,
    82         ) );
    8377    }
     78
     79    wp_enqueue_script( 'wporg-plugins-locale-banner', get_template_directory_uri() . '/js/locale-banner.js', array(), '20160622', true );
     80    wp_localize_script( 'wporg-plugins-locale-banner', 'wporgLocaleBanner', array(
     81        'apiURL'        => rest_url( '/plugins/v1/locale-banner' ),
     82        'currentPlugin' => is_singular( 'plugin' ) ? get_queried_object()->post_name : '',
     83    ) );
    8484}
    8585add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\scripts' );
Note: See TracChangeset for help on using the changeset viewer.