Version Description
- Fixed issue causing unintentional unlocking of endpoints when another WP_Error existed before this plugin did its job
Download this release
Release Info
Developer | dmchale |
Plugin | Disable REST API |
Version | 1.4.2 |
Comparing to | |
See all releases |
Code changes from version 1.4.1 to 1.4.2
- classes/disable-rest-api.php +4 -1
- disable-json-api.php +1 -1
- readme.txt +4 -1
classes/disable-rest-api.php
CHANGED
@@ -205,8 +205,11 @@ class Disable_REST_API {
|
|
205 |
*/
|
206 |
private function get_wp_error( $access ) {
|
207 |
$error_message = esc_html__( 'DRA: Only authenticated users can access the REST API.', 'disable-json-api' );
|
|
|
208 |
if ( is_wp_error( $access ) ) {
|
209 |
-
|
|
|
|
|
210 |
}
|
211 |
|
212 |
return new WP_Error( 'rest_cannot_access', $error_message, array( 'status' => rest_authorization_required_code() ) );
|
205 |
*/
|
206 |
private function get_wp_error( $access ) {
|
207 |
$error_message = esc_html__( 'DRA: Only authenticated users can access the REST API.', 'disable-json-api' );
|
208 |
+
|
209 |
if ( is_wp_error( $access ) ) {
|
210 |
+
$access->add( 'rest_cannot_access', $error_message, array( 'status' => rest_authorization_required_code() ) );
|
211 |
+
|
212 |
+
return $access;
|
213 |
}
|
214 |
|
215 |
return new WP_Error( 'rest_cannot_access', $error_message, array( 'status' => rest_authorization_required_code() ) );
|
disable-json-api.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Disable REST API
|
4 |
* Plugin URI: http://www.binarytemplar.com/disable-json-api
|
5 |
* Description: Disable the use of the JSON REST API on your website to anonymous users
|
6 |
-
* Version: 1.4.
|
7 |
* Author: Dave McHale
|
8 |
* Author URI: http://www.binarytemplar.com
|
9 |
* Text Domain: disable-json-api
|
3 |
* Plugin Name: Disable REST API
|
4 |
* Plugin URI: http://www.binarytemplar.com/disable-json-api
|
5 |
* Description: Disable the use of the JSON REST API on your website to anonymous users
|
6 |
+
* Version: 1.4.2
|
7 |
* Author: Dave McHale
|
8 |
* Author URI: http://www.binarytemplar.com
|
9 |
* Text Domain: disable-json-api
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: admin, api, json, REST, rest-api, disable
|
|
4 |
Requires at least: 4.4
|
5 |
Requires PHP: 5.3
|
6 |
Tested up to: 4.8
|
7 |
-
Stable tag: 1.4.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -56,6 +56,9 @@ disabled so long as this plugin is active. Namespaces and routes may be whitelis
|
|
56 |
|
57 |
== Changelog ==
|
58 |
|
|
|
|
|
|
|
59 |
= 1.4.1 =
|
60 |
* Fixed echo of text URL to primary Plugins page in WP Dashboard
|
61 |
|
4 |
Requires at least: 4.4
|
5 |
Requires PHP: 5.3
|
6 |
Tested up to: 4.8
|
7 |
+
Stable tag: 1.4.2
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
56 |
|
57 |
== Changelog ==
|
58 |
|
59 |
+
= 1.4.2 =
|
60 |
+
* Fixed issue causing unintentional unlocking of endpoints when another WP_Error existed before this plugin did its job
|
61 |
+
|
62 |
= 1.4.1 =
|
63 |
* Fixed echo of text URL to primary Plugins page in WP Dashboard
|
64 |
|