Plugin Directory

Changeset 1133643


Ignore:
Timestamp:
04/13/2015 11:05:01 AM (11 years ago)
Author:
benuit
Message:

Adding version 0.7.2

Location:
worona
Files:
59 added
2 edited

Legend:

Unmodified
Added
Removed
  • worona/trunk/readme.txt

    r1132133 r1133643  
    55Requires at least: 3.9 or higher
    66Tested up to: 4.0
    7 Stable tag: 0.7.1
     7Stable tag: 0.7.2
    88stable.
    99License: GPLv3
     
    8686== Changelog ==
    8787
     88= 0.7.2 =
     89* Fix a problem of WP-API with old WP versions.
     90
    8891= 0.7.1 =
    8992* Include WP-API inside the plugin so you don't have to install it
  • worona/trunk/worona.php

    r1132133 r1133643  
    44Plugin URI: http://www.worona.org/
    55Description: Turn your WordPress site into a native iOS, Android and Windows Phone App.
    6 Version: 0.7.1
     6Version: 0.7.2
    77Author: Benuit
    88Author URI: http://www.benuit.com/
     
    4141        add_filter( 'json_prepare_post',  array($this, 'add_worona_content_to_api'), 10, 3 );
    4242
    43         // if WP-API is not active, include it
    44         if ( !in_array( 'json-rest-api/plugin.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
    45             include_once( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'json-rest-api/plugin.php' );
    46         } else {
    47             deactivate_plugins('json-rest-api/plugin.php');
    48         }
     43        //
     44        $this->include_wp_api();
    4945    }
    5046
     
    145141        return $_post;
    146142    }
     143
     144    /*
     145    *  include_wp_api
     146    *
     147    *  This function is called during the __construct() and will do things such as:
     148    *  check if we can include the WP-API plugin and include it.
     149    *
     150    *  @type    method
     151    *  @date    13/04/15
     152    *  @since   0.7.2
     153    *
     154    *  @param   N/A
     155    *  @return  N/A
     156    */
     157
     158    function include_wp_api() {
     159
     160        // check if current_action function exist, because it was introduced in WP 3.9
     161        if (function_exists('current_action')) {
     162            // if WP-API is not active, include it
     163            if ( !in_array( 'json-rest-api/plugin.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
     164                error_log("json-rest-api/plugin.php");
     165                include_once( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'json-rest-api/plugin.php' );
     166            }
     167        }
     168    }
     169
    147170}
    148171
Note: See TracChangeset for help on using the changeset viewer.