summaryrefslogtreecommitdiffstatshomepage
path: root/src/wp-includes/rest-api
diff options
context:
space:
mode:
authorJohn Blackbourn <johnbillion@git.wordpress.org>2021-01-03 22:02:13 +0000
committerJohn Blackbourn <johnbillion@git.wordpress.org>2021-01-03 22:02:13 +0000
commit679ccc35e63e62a90c768afcc16f46bd154dfb65 (patch)
treed1f8aecbddc39afc3fd960d1cae3860093a126cb /src/wp-includes/rest-api
parent374b41ed13a5cf26739287a2c3fee15b14d4cfc5 (diff)
downloadwordpress-679ccc35e63e62a90c768afcc16f46bd154dfb65.tar.gz
wordpress-679ccc35e63e62a90c768afcc16f46bd154dfb65.zip
Docs: Promote many `bool` types to `true` or `false` where only that value is used.
See #51800 git-svn-id: https://develop.svn.wordpress.org/trunk@49927 602fd350-edb4-49c9-b593-d223f7449a82
Diffstat (limited to 'src/wp-includes/rest-api')
-rw-r--r--src/wp-includes/rest-api/class-wp-rest-request.php2
-rw-r--r--src/wp-includes/rest-api/class-wp-rest-server.php2
-rw-r--r--src/wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php2
-rw-r--r--src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php6
-rw-r--r--src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php2
-rw-r--r--src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php2
-rw-r--r--src/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php4
-rw-r--r--src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php10
-rw-r--r--src/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php6
9 files changed, 18 insertions, 18 deletions
diff --git a/src/wp-includes/rest-api/class-wp-rest-request.php b/src/wp-includes/rest-api/class-wp-rest-request.php
index d65a32eae4..94a0a28790 100644
--- a/src/wp-includes/rest-api/class-wp-rest-request.php
+++ b/src/wp-includes/rest-api/class-wp-rest-request.php
@@ -855,7 +855,7 @@ class WP_REST_Request implements ArrayAccess {
*
* @since 4.4.0
*
- * @return bool|WP_Error True if there are no parameters to validate or if all pass validation,
+ * @return true|WP_Error True if there are no parameters to validate or if all pass validation,
* WP_Error if required parameters are missing.
*/
public function has_valid_params() {
diff --git a/src/wp-includes/rest-api/class-wp-rest-server.php b/src/wp-includes/rest-api/class-wp-rest-server.php
index 85866e26d9..6a972b6468 100644
--- a/src/wp-includes/rest-api/class-wp-rest-server.php
+++ b/src/wp-includes/rest-api/class-wp-rest-server.php
@@ -1203,7 +1203,7 @@ class WP_REST_Server {
*
* @since 4.4.0
*
- * @return bool|string Boolean false or string error message.
+ * @return false|string Boolean false or string error message.
*/
protected function get_json_last_error() {
$last_error_code = json_last_error();
diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php
index c3cf4938a2..7b20f78caa 100644
--- a/src/wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php
+++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php
@@ -50,7 +50,7 @@ class WP_REST_Block_Directory_Controller extends WP_REST_Controller {
*
* @param WP_REST_Request $request Full details about the request.
*
- * @return WP_Error|bool True if the request has permission, WP_Error object otherwise.
+ * @return WP_Error|true True if the request has permission, WP_Error object otherwise.
*/
public function get_items_permissions_check( $request ) {
if ( ! current_user_can( 'install_plugins' ) || ! current_user_can( 'activate_plugins' ) ) {
diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php
index 95068df920..8ad098703f 100644
--- a/src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php
+++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php
@@ -114,7 +114,7 @@ class WP_REST_Block_Types_Controller extends WP_REST_Controller {
* @since 5.5.0
*
* @param WP_REST_Request $request Full details about the request.
- * @return WP_Error|bool True if the request has read access, WP_Error object otherwise.
+ * @return WP_Error|true True if the request has read access, WP_Error object otherwise.
*/
public function get_items_permissions_check( $request ) {
return $this->check_read_permission();
@@ -160,7 +160,7 @@ class WP_REST_Block_Types_Controller extends WP_REST_Controller {
* @since 5.5.0
*
* @param WP_REST_Request $request Full details about the request.
- * @return WP_Error|bool True if the request has read access for the item, WP_Error object otherwise.
+ * @return WP_Error|true True if the request has read access for the item, WP_Error object otherwise.
*/
public function get_item_permissions_check( $request ) {
$check = $this->check_read_permission();
@@ -181,7 +181,7 @@ class WP_REST_Block_Types_Controller extends WP_REST_Controller {
*
* @since 5.5.0
*
- * @return WP_Error|bool True if the block type is visible, WP_Error otherwise.
+ * @return WP_Error|true True if the block type is visible, WP_Error otherwise.
*/
protected function check_read_permission() {
if ( current_user_can( 'edit_posts' ) ) {
diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php
index 03763b4eb0..06913af48f 100644
--- a/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php
+++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php
@@ -443,7 +443,7 @@ abstract class WP_REST_Controller {
*
* @param object $object Data model like WP_Term or WP_Post.
* @param WP_REST_Request $request Full details about the request.
- * @return bool|WP_Error True on success, WP_Error object if a field cannot be updated.
+ * @return true|WP_Error True on success, WP_Error object if a field cannot be updated.
*/
protected function update_additional_fields_for_object( $object, $request ) {
$additional_fields = $this->get_additional_fields();
diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
index ccd0dbfb18..bd74fdc3cc 100644
--- a/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
+++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
@@ -426,7 +426,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
* @since 4.7.0
*
* @param WP_REST_Request $request Full details about the request.
- * @return bool|WP_Error True if the request has read access for the item, WP_Error object otherwise.
+ * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise.
*/
public function get_item_permissions_check( $request ) {
$post = $this->get_post( $request['id'] );
diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php
index 8a7e5e2adc..ef22922abf 100644
--- a/src/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php
+++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php
@@ -362,7 +362,7 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
* @since 4.7.0
*
* @param WP_REST_Request $request Full details about the request.
- * @return bool|WP_Error True if the request has read access for the item, WP_Error object otherwise.
+ * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise.
*/
public function get_item_permissions_check( $request ) {
return $this->get_items_permissions_check( $request );
@@ -397,7 +397,7 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
* @since 4.7.0
*
* @param WP_REST_Request $request Full details about the request.
- * @return bool|WP_Error True if the request has access to delete the item, WP_Error object otherwise.
+ * @return true|WP_Error True if the request has access to delete the item, WP_Error object otherwise.
*/
public function delete_item_permissions_check( $request ) {
$parent = $this->get_parent( $request['parent'] );
diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php
index afb6054beb..189040a310 100644
--- a/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php
+++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php
@@ -140,7 +140,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
* @since 4.7.0
*
* @param WP_REST_Request $request Full details about the request.
- * @return bool|WP_Error True if the request has read access, otherwise false or WP_Error object.
+ * @return true|WP_Error True if the request has read access, otherwise false or WP_Error object.
*/
public function get_items_permissions_check( $request ) {
$tax_obj = get_taxonomy( $this->taxonomy );
@@ -347,7 +347,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
* @since 4.7.0
*
* @param WP_REST_Request $request Full details about the request.
- * @return bool|WP_Error True if the request has read access for the item, otherwise false or WP_Error object.
+ * @return true|WP_Error True if the request has read access for the item, otherwise false or WP_Error object.
*/
public function get_item_permissions_check( $request ) {
$term = $this->get_term( $request['id'] );
@@ -392,7 +392,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
* @since 4.7.0
*
* @param WP_REST_Request $request Full details about the request.
- * @return bool|WP_Error True if the request has access to create items, false or WP_Error object otherwise.
+ * @return true|WP_Error True if the request has access to create items, false or WP_Error object otherwise.
*/
public function create_item_permissions_check( $request ) {
@@ -528,7 +528,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
* @since 4.7.0
*
* @param WP_REST_Request $request Full details about the request.
- * @return bool|WP_Error True if the request has access to update the item, false or WP_Error object otherwise.
+ * @return true|WP_Error True if the request has access to update the item, false or WP_Error object otherwise.
*/
public function update_item_permissions_check( $request ) {
$term = $this->get_term( $request['id'] );
@@ -629,7 +629,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
* @since 4.7.0
*
* @param WP_REST_Request $request Full details about the request.
- * @return bool|WP_Error True if the request has access to delete the item, otherwise false or WP_Error object.
+ * @return true|WP_Error True if the request has access to delete the item, otherwise false or WP_Error object.
*/
public function delete_item_permissions_check( $request ) {
$term = $this->get_term( $request['id'] );
diff --git a/src/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php b/src/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php
index 199c54f8f1..81806e1b65 100644
--- a/src/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php
+++ b/src/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php
@@ -213,7 +213,7 @@ abstract class WP_REST_Meta_Fields {
* @param int $object_id Object ID the field belongs to.
* @param string $meta_key Key for the field.
* @param string $name Name for the field that is exposed in the REST API.
- * @return bool|WP_Error True if meta field is deleted, WP_Error otherwise.
+ * @return true|WP_Error True if meta field is deleted, WP_Error otherwise.
*/
protected function delete_meta_value( $object_id, $meta_key, $name ) {
$meta_type = $this->get_meta_type();
@@ -255,7 +255,7 @@ abstract class WP_REST_Meta_Fields {
* @param string $meta_key Key for the custom field.
* @param string $name Name for the field that is exposed in the REST API.
* @param array $values List of values to update to.
- * @return bool|WP_Error True if meta fields are updated, WP_Error otherwise.
+ * @return true|WP_Error True if meta fields are updated, WP_Error otherwise.
*/
protected function update_multi_meta_value( $object_id, $meta_key, $name, $values ) {
$meta_type = $this->get_meta_type();
@@ -350,7 +350,7 @@ abstract class WP_REST_Meta_Fields {
* @param string $meta_key Key for the custom field.
* @param string $name Name for the field that is exposed in the REST API.
* @param mixed $value Updated value.
- * @return bool|WP_Error True if the meta field was updated, WP_Error otherwise.
+ * @return true|WP_Error True if the meta field was updated, WP_Error otherwise.
*/
protected function update_meta_value( $object_id, $meta_key, $name, $value ) {
$meta_type = $this->get_meta_type();