WordPress.org

Making WordPress.org

Changeset 3795


Ignore:
Timestamp:
08/09/2016 09:36:04 PM (5 years ago)
Author:
obenland
Message:

Plugin Directory: Make React client available though a query parameter.

Appending ?react to any directory URL will load the client.

H/t ocean90.
See #1719.

File:
1 edited

Legend:

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

    r3701 r3795  
    8383    ) );
    8484
    85     // wp_enqueue_script( 'wporg-plugins-client', get_template_directory_uri() . '/js/theme.js', array(), false, true );
    86     wp_localize_script( 'wporg-plugins-client', 'app_data', array(
    87         'api_url' => untrailingslashit( rest_url() ),
    88         'nonce'   => wp_create_nonce( 'wp_rest' ),
    89         'base'    => get_blog_details()->path,
    90     ) );
     85    if ( isset( $_REQUEST['react'] ) ) {
     86        wp_enqueue_script( 'wporg-plugins-client', get_template_directory_uri() . '/js/theme.js', array(), false, true );
     87        wp_localize_script( 'wporg-plugins-client', 'app_data', array(
     88            'api_url' => untrailingslashit( rest_url() ),
     89            'nonce'   => wp_create_nonce( 'wp_rest' ),
     90            'base'    => get_blog_details()->path,
     91        ) );
     92    }
    9193
    9294}
Note: See TracChangeset for help on using the changeset viewer.