@@ -46,18 +46,18 @@ |
||
46 | 46 | * |
47 | 47 | * @since 1.0.0 |
48 | 48 | */ |
49 | - function wp_rest_menus_init() { |
|
49 | + function wp_rest_menus_init() { |
|
50 | 50 | |
51 | - if ( ! defined( 'JSON_API_VERSION' ) && |
|
52 | - ! in_array( 'json-rest-api/plugin.php', get_option( 'active_plugins' ) ) ) { |
|
51 | + if ( ! defined( 'JSON_API_VERSION' ) && |
|
52 | + ! in_array( 'json-rest-api/plugin.php', get_option( 'active_plugins' ) ) ) { |
|
53 | 53 | $class = new WP_REST_Menus(); |
54 | 54 | add_filter( 'rest_api_init', array( $class, 'register_routes' ) ); |
55 | - } else { |
|
56 | - $class = new WP_JSON_Menus(); |
|
57 | - add_filter( 'json_endpoints', array( $class, 'register_routes' ) ); |
|
58 | - } |
|
59 | - } |
|
55 | + } else { |
|
56 | + $class = new WP_JSON_Menus(); |
|
57 | + add_filter( 'json_endpoints', array( $class, 'register_routes' ) ); |
|
58 | + } |
|
59 | + } |
|
60 | 60 | |
61 | - add_action( 'init', 'wp_rest_menus_init' ); |
|
61 | + add_action( 'init', 'wp_rest_menus_init' ); |
|
62 | 62 | |
63 | 63 | endif; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
31 | 31 | */ |
32 | 32 | |
33 | -if ( ! defined( 'ABSPATH' ) ) { |
|
33 | +if ( ! defined('ABSPATH')) { |
|
34 | 34 | exit; // Exit if accessed directly |
35 | 35 | } |
36 | 36 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | // WP API v2. |
40 | 40 | include_once 'includes/wp-api-menus-v2.php'; |
41 | 41 | |
42 | -if ( ! function_exists ( 'wp_rest_menus_init' ) ) : |
|
42 | +if ( ! function_exists('wp_rest_menus_init')) : |
|
43 | 43 | |
44 | 44 | /** |
45 | 45 | * Init JSON REST API Menu routes. |
@@ -48,16 +48,16 @@ discard block |
||
48 | 48 | */ |
49 | 49 | function wp_rest_menus_init() { |
50 | 50 | |
51 | - if ( ! defined( 'JSON_API_VERSION' ) && |
|
52 | - ! in_array( 'json-rest-api/plugin.php', get_option( 'active_plugins' ) ) ) { |
|
51 | + if ( ! defined('JSON_API_VERSION') && |
|
52 | + ! in_array('json-rest-api/plugin.php', get_option('active_plugins'))) { |
|
53 | 53 | $class = new WP_REST_Menus(); |
54 | - add_filter( 'rest_api_init', array( $class, 'register_routes' ) ); |
|
54 | + add_filter('rest_api_init', array($class, 'register_routes')); |
|
55 | 55 | } else { |
56 | 56 | $class = new WP_JSON_Menus(); |
57 | - add_filter( 'json_endpoints', array( $class, 'register_routes' ) ); |
|
57 | + add_filter('json_endpoints', array($class, 'register_routes')); |
|
58 | 58 | } |
59 | 59 | } |
60 | 60 | |
61 | - add_action( 'init', 'wp_rest_menus_init' ); |
|
61 | + add_action('init', 'wp_rest_menus_init'); |
|
62 | 62 | |
63 | 63 | endif; |