Plugin Directory

Changeset 1181193


Ignore:
Timestamp:
06/15/2015 03:56:57 PM (11 years ago)
Author:
guavaworks
Message:

v1 fallback

Location:
angularjs-for-wp/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • angularjs-for-wp/trunk/plugin.php

    r1181178 r1181193  
    44 * Plugin URI: http://www.roysivan.com/angularjs-for-wordpress
    55 * Description: This plugin will allow you to easily load WordPress content client-side using AngularJS. JSON REST API required.
    6  * Version: 2.0.0
     6 * Version: 2.0.1
    77 * Author: Roy Sivan
    88 * Author URI: http://www.roysivan.com
     
    6060        }
    6161
     62       
     63        $angularjs_for_wp_localize = array(
     64            'site' => get_bloginfo('wpurl'),
     65            'nonce' => wp_create_nonce( 'wp_json' ),
     66            'template_directory' => $template_directory
     67        );
     68       
     69        if( function_exists( 'json_url' ) ) {
     70            $angularjs_for_wp_localize['base'] = json_url();
     71        }
     72       
     73        if( function_exists( 'rest_get_url_prefix' ) ) {
     74            $angularjs_for_wp_localize['base'] = get_bloginfo( 'wpurl') . '/' . rest_get_url_prefix() . '/wp/v2';
     75        }
     76       
    6277        // Localize Variables
    6378        wp_localize_script(
    6479            'angular-core',
    6580            'wpAngularVars',
    66             array(
    67                 'site' => get_bloginfo('wpurl'),
    68                 'base' => get_bloginfo( 'wpurl') . '/' . rest_get_url_prefix() . '/wp/v2',
    69                 'nonce' => wp_create_nonce( 'wp_json' ),
    70                 'template_directory' => $template_directory
    71             )
     81            $angularjs_for_wp_localize
    7282        );
    7383    }
  • angularjs-for-wp/trunk/readme.txt

    r1181173 r1181193  
    55Requires at least: 3.9
    66Tested up to: 4.2.2
    7 Stable tag: 2.0.0
     7Stable tag: 2.0.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7474* Adding in HTML Janitor - [fixing issue](https://github.com/royboy789/angularjs-for-wordpress/issues/6)
    7575 
    76 = 2.0.0 =
    77 * Now works with JSON REST API v2 beta
     76= 2.0.1 =
     77* Now works with JSON REST API v2 beta with v1 fallback
Note: See TracChangeset for help on using the changeset viewer.