Making WordPress.org


Ignore:
Timestamp:
03/01/2017 06:08:54 PM (7 years ago)
Author:
obenland
Message:

Plugin Directory: Update React client with latest changes.

This is largely a cleanup commit with some WIP around switching to node-wpapi.

File:
1 edited

Legend:

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

    r4505 r5024  
    7777        wp_enqueue_script( 'google-jsapi', 'https://www.google.com/jsapi', array(), false, true );
    7878        wp_enqueue_script( 'wporg-plugins-stats', get_template_directory_uri() . '/js/stats.js', array( 'jquery', 'google-jsapi' ), '20161019', true );
    79 
    8079
    8180        wp_localize_script( 'wporg-plugins-stats', 'pluginStats', array(
     
    9190            ),
    9291        ) );
    93 
    9492    }
    9593
     
    9795    if ( is_single() ) {
    9896        wp_enqueue_script( 'wporg-plugins-client', get_template_directory_uri() . '/js/theme.js', array(), false, true );
    99         wp_localize_script( 'wporg-plugins-client', 'app_data', array(
    100             'api_url' => untrailingslashit( rest_url() ),
    101             'nonce'   => wp_create_nonce( 'wp_rest' ),
    102             'base'    => get_blog_details()->path,
     97        wp_localize_script( 'wporg-plugins-client', 'pluginDirectory', array(
     98            'endpoint' => untrailingslashit( rest_url() ), // 'https://wordpress.org/plugins-wp/wp-json',
     99            'nonce'    => wp_create_nonce( 'wp_rest' ),
     100            'base'     => get_blog_details()->path,
     101            'userId'   => get_current_user_id(),
     102        ) );
     103        wp_localize_script( 'wporg-plugins-client', 'localeData', array(
     104            '' => array(
     105                'Plural-Forms' => _x( 'nplurals=2; plural=n != 1;', 'plural forms', 'wporg-plugins' ),
     106                'Language'     => _x( 'en', 'language (fr, fr_CA)', 'wporg-plugins' ),
     107                'localeSlug'   => _x( 'en', 'locale slug', 'wporg-plugins' ) ,
     108            ),
    103109        ) );
    104110    }
Note: See TracChangeset for help on using the changeset viewer.