Skip to content

Commit

Permalink
Merge pull request WP-API#240 from tlovett1/feature/include-client-js
Browse files Browse the repository at this point in the history
Include new client JS from github.io - see WP-API#179
  • Loading branch information
rmccue committed May 29, 2014
2 parents cffff9b + f39fe33 commit b2e8c42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 267 deletions.
6 changes: 4 additions & 2 deletions plugin.php
Expand Up @@ -200,8 +200,10 @@ function json_api_deactivation( $network_wide ) {
* Register our API Javascript helpers
*/
function json_register_scripts() {
wp_register_script( 'wp-api', plugins_url( '/wp-api.js', __FILE__ ), array( 'jquery', 'backbone', 'underscore' ), '0.6', true );
wp_localize_script( 'wp-api', 'wpApiOptions', array( 'base' => json_url(), 'nonce' => wp_create_nonce( 'wp_json' ) ) );
wp_register_script( 'wp-api', 'http://wp-api.github.io/client-js/build/js/wp-api.js', array( 'jquery', 'backbone', 'underscore' ), '1.1', true );

$settings = array( 'root' => esc_url_raw( home_url( 'wp-json' ) ), 'nonce' => wp_create_nonce( 'wp_json' ) );
wp_localize_script( 'wp-api', 'WP_API_Settings', $settings );
}
add_action( 'wp_enqueue_scripts', 'json_register_scripts', -100 );

Expand Down
265 changes: 0 additions & 265 deletions wp-api.js

This file was deleted.

0 comments on commit b2e8c42

Please sign in to comment.