Version Description
bugfix term endpoint
Download this release
Release Info
Developer | airesvsg |
Plugin | ACF to REST API |
Version | 2.1.1 |
Comparing to | |
See all releases |
Code changes from version 2.1.0 to 2.1.1
class-acf-to-rest-api.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Description: Edit, Get and Puts ACF fields in WordPress REST API.
|
5 |
* Author: Aires Gonçalves
|
6 |
* Author URI: http://github.com/airesvsg
|
7 |
-
* Version: 2.1.
|
8 |
* Plugin URI: http://github.com/airesvsg/acf-to-rest-api
|
9 |
*/
|
10 |
|
@@ -16,7 +16,7 @@ if ( ! class_exists( 'ACF_To_REST_API' ) ) {
|
|
16 |
|
17 |
class ACF_To_REST_API {
|
18 |
|
19 |
-
const VERSION = '2.1.
|
20 |
|
21 |
public static function init() {
|
22 |
self::includes();
|
4 |
* Description: Edit, Get and Puts ACF fields in WordPress REST API.
|
5 |
* Author: Aires Gonçalves
|
6 |
* Author URI: http://github.com/airesvsg
|
7 |
+
* Version: 2.1.1
|
8 |
* Plugin URI: http://github.com/airesvsg/acf-to-rest-api
|
9 |
*/
|
10 |
|
16 |
|
17 |
class ACF_To_REST_API {
|
18 |
|
19 |
+
const VERSION = '2.1.1';
|
20 |
|
21 |
public static function init() {
|
22 |
self::includes();
|
includes/admin/views/html-notice-missing-acf.php
CHANGED
@@ -1,28 +1,28 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
-
exit;
|
5 |
-
}
|
6 |
-
|
7 |
-
$is_installed = ACF_To_REST_API::is_plugin_installed( 'acf' );
|
8 |
-
|
9 |
-
$target = false;
|
10 |
-
$action = __( 'Install', 'acf-to-rest-api' );
|
11 |
-
if ( current_user_can( 'install_plugins' ) ) {
|
12 |
-
if ( $is_installed ) {
|
13 |
-
$action = __( 'Active', 'acf-to-rest-api' );
|
14 |
-
$url = wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin=' . $is_installed . '&plugin_status=active' ), 'activate-plugin_' . $is_installed );
|
15 |
-
} else {
|
16 |
-
$url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=advanced-custom-fields' ), 'install-plugin_advanced-custom-fields' );
|
17 |
-
}
|
18 |
-
} else {
|
19 |
-
$target = true;
|
20 |
-
$url = 'http://wordpress.org/plugins/advanced-custom-fields/';
|
21 |
-
}
|
22 |
-
|
23 |
-
?>
|
24 |
-
|
25 |
-
<div class="notice error is-dismissible">
|
26 |
-
<p><strong><?php esc_html_e( 'ACF to REST API', 'act-to-rest-api' ); ?></strong> <?php esc_html_e( 'depends on the last version of Advanced Custom Fields to work!', 'acf-to-rest-api' ); ?></p>
|
27 |
-
<p><a href="<?php echo esc_url( $url ); ?>" class="button button-primary"<?php if ( $target ) : ?> target="_blank"<?php endif; ?>><?php esc_html_e( $action . ' Advanced Custom Fields', 'acf-to-rest-api' ); ?></a></p>
|
28 |
</div>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
|
7 |
+
$is_installed = ACF_To_REST_API::is_plugin_installed( 'acf' );
|
8 |
+
|
9 |
+
$target = false;
|
10 |
+
$action = __( 'Install', 'acf-to-rest-api' );
|
11 |
+
if ( current_user_can( 'install_plugins' ) ) {
|
12 |
+
if ( $is_installed ) {
|
13 |
+
$action = __( 'Active', 'acf-to-rest-api' );
|
14 |
+
$url = wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin=' . $is_installed . '&plugin_status=active' ), 'activate-plugin_' . $is_installed );
|
15 |
+
} else {
|
16 |
+
$url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=advanced-custom-fields' ), 'install-plugin_advanced-custom-fields' );
|
17 |
+
}
|
18 |
+
} else {
|
19 |
+
$target = true;
|
20 |
+
$url = 'http://wordpress.org/plugins/advanced-custom-fields/';
|
21 |
+
}
|
22 |
+
|
23 |
+
?>
|
24 |
+
|
25 |
+
<div class="notice error is-dismissible">
|
26 |
+
<p><strong><?php esc_html_e( 'ACF to REST API', 'act-to-rest-api' ); ?></strong> <?php esc_html_e( 'depends on the last version of Advanced Custom Fields to work!', 'acf-to-rest-api' ); ?></p>
|
27 |
+
<p><a href="<?php echo esc_url( $url ); ?>" class="button button-primary"<?php if ( $target ) : ?> target="_blank"<?php endif; ?>><?php esc_html_e( $action . ' Advanced Custom Fields', 'acf-to-rest-api' ); ?></a></p>
|
28 |
</div>
|
includes/admin/views/html-notice-missing-rest-api.php
CHANGED
@@ -1,28 +1,28 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
-
exit;
|
5 |
-
}
|
6 |
-
|
7 |
-
$is_installed = ACF_To_REST_API::is_plugin_installed( 'rest-api' );
|
8 |
-
|
9 |
-
$target = false;
|
10 |
-
$action = __( 'Install', 'acf-to-rest-api' );
|
11 |
-
if ( current_user_can( 'install_plugins' ) ) {
|
12 |
-
if ( $is_installed ) {
|
13 |
-
$action = __( 'Active', 'acf-to-rest-api' );
|
14 |
-
$url = wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin=rest-api/plugin.php&plugin_status=active' ), 'activate-plugin_rest-api/plugin.php' );
|
15 |
-
} else {
|
16 |
-
$url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=rest-api' ), 'install-plugin_rest-api' );
|
17 |
-
}
|
18 |
-
} else {
|
19 |
-
$target = true;
|
20 |
-
$url = 'http://wordpress.org/plugins/rest-api/';
|
21 |
-
}
|
22 |
-
|
23 |
-
?>
|
24 |
-
|
25 |
-
<div class="notice error is-dismissible">
|
26 |
-
<p><strong><?php esc_html_e( 'ACF to REST API', 'act-to-rest-api' ); ?></strong> <?php esc_html_e( 'depends on the last version of WordPress REST API to work!', 'acf-to-rest-api' ); ?></p>
|
27 |
-
<p><a href="<?php echo esc_url( $url ); ?>" class="button button-primary"<?php if ( $target ) : ?> target="_blank"<?php endif; ?>><?php esc_html_e( $action . ' WordPress REST API', 'acf-to-rest-api' ); ?></a></p>
|
28 |
</div>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
|
7 |
+
$is_installed = ACF_To_REST_API::is_plugin_installed( 'rest-api' );
|
8 |
+
|
9 |
+
$target = false;
|
10 |
+
$action = __( 'Install', 'acf-to-rest-api' );
|
11 |
+
if ( current_user_can( 'install_plugins' ) ) {
|
12 |
+
if ( $is_installed ) {
|
13 |
+
$action = __( 'Active', 'acf-to-rest-api' );
|
14 |
+
$url = wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin=rest-api/plugin.php&plugin_status=active' ), 'activate-plugin_rest-api/plugin.php' );
|
15 |
+
} else {
|
16 |
+
$url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=rest-api' ), 'install-plugin_rest-api' );
|
17 |
+
}
|
18 |
+
} else {
|
19 |
+
$target = true;
|
20 |
+
$url = 'http://wordpress.org/plugins/rest-api/';
|
21 |
+
}
|
22 |
+
|
23 |
+
?>
|
24 |
+
|
25 |
+
<div class="notice error is-dismissible">
|
26 |
+
<p><strong><?php esc_html_e( 'ACF to REST API', 'act-to-rest-api' ); ?></strong> <?php esc_html_e( 'depends on the last version of WordPress REST API to work!', 'acf-to-rest-api' ); ?></p>
|
27 |
+
<p><a href="<?php echo esc_url( $url ); ?>" class="button button-primary"<?php if ( $target ) : ?> target="_blank"<?php endif; ?>><?php esc_html_e( $action . ' WordPress REST API', 'acf-to-rest-api' ); ?></a></p>
|
28 |
</div>
|
lib/endpoints/class-acf-to-rest-api-attachment-controller.php
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
-
exit;
|
5 |
-
}
|
6 |
-
|
7 |
-
if ( ! class_exists( 'ACF_To_REST_API_Attachment_Controller' ) ) {
|
8 |
-
class ACF_To_REST_API_Attachment_Controller extends ACF_To_REST_API_Controller {
|
9 |
-
public function register_hooks() {
|
10 |
-
$this->type = 'attachment';
|
11 |
-
parent::register_hooks();
|
12 |
-
}
|
13 |
-
}
|
14 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
|
7 |
+
if ( ! class_exists( 'ACF_To_REST_API_Attachment_Controller' ) ) {
|
8 |
+
class ACF_To_REST_API_Attachment_Controller extends ACF_To_REST_API_Controller {
|
9 |
+
public function register_hooks() {
|
10 |
+
$this->type = 'attachment';
|
11 |
+
parent::register_hooks();
|
12 |
+
}
|
13 |
+
}
|
14 |
+
}
|
lib/endpoints/class-acf-to-rest-api-term-controller.php
CHANGED
@@ -52,7 +52,7 @@ if ( ! class_exists( 'ACF_To_REST_API_Term_Controller' ) ) {
|
|
52 |
protected function show( $object ) {
|
53 |
global $wp_taxonomies;
|
54 |
|
55 |
-
$taxonomy = $this->get_rest_base( $
|
56 |
|
57 |
return $taxonomy && isset( $wp_taxonomies[$taxonomy]->show_in_rest ) && $wp_taxonomies[$taxonomy]->show_in_rest;
|
58 |
}
|
52 |
protected function show( $object ) {
|
53 |
global $wp_taxonomies;
|
54 |
|
55 |
+
$taxonomy = $this->get_rest_base( $object );
|
56 |
|
57 |
return $taxonomy && isset( $wp_taxonomies[$taxonomy]->show_in_rest ) && $wp_taxonomies[$taxonomy]->show_in_rest;
|
58 |
}
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: airesvsg
|
3 |
Tags: acf, api, rest, wp-api, wp-rest-api, json, wp, wordpress, wp-rest-api
|
4 |
Requires at least: 4.3
|
5 |
-
Tested up to: 4.
|
6 |
-
Stable tag: 2.1.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -22,6 +22,9 @@ http://github.com/airesvsg/acf-to-rest-api
|
|
22 |
|
23 |
== Changelog ==
|
24 |
|
|
|
|
|
|
|
25 |
= 2.1.0 =
|
26 |
adding rest base support
|
27 |
adding new filter acf/rest_api/default_rest_base
|
2 |
Contributors: airesvsg
|
3 |
Tags: acf, api, rest, wp-api, wp-rest-api, json, wp, wordpress, wp-rest-api
|
4 |
Requires at least: 4.3
|
5 |
+
Tested up to: 4.5
|
6 |
+
Stable tag: 2.1.1
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
22 |
|
23 |
== Changelog ==
|
24 |
|
25 |
+
= 2.1.1 =
|
26 |
+
bugfix term endpoint
|
27 |
+
|
28 |
= 2.1.0 =
|
29 |
adding rest base support
|
30 |
adding new filter acf/rest_api/default_rest_base
|