diff --git a/wp-admin/includes/class-plugin-upgrader.php b/wp-admin/includes/class-plugin-upgrader.php index cd09f04279..e4b6f54baa 100644 --- a/wp-admin/includes/class-plugin-upgrader.php +++ b/wp-admin/includes/class-plugin-upgrader.php @@ -450,7 +450,7 @@ class Plugin_Upgrader extends WP_Upgrader { * @param string $local_destination * @param string $remote_destination * @param array $plugin - * @return WP_Error|bool + * @return bool|WP_Error */ public function delete_old_plugin( $removed, $local_destination, $remote_destination, $plugin ) { global $wp_filesystem; diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php index cf33046f6e..aa629e4e52 100644 --- a/wp-admin/includes/class-wp-upgrader.php +++ b/wp-admin/includes/class-wp-upgrader.php @@ -76,7 +76,7 @@ class WP_Upgrader { * * @since 2.8.0 * - * @var WP_Error|array $result { + * @var array|WP_Error $result { * @type string $source The full path to the source the files were installed from. * @type string $source_files List of all the files in the source directory. * @type string $destination The full path to the installation destination folder. diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index edc92ed45e..a47fd79826 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -2086,7 +2086,7 @@ function request_filesystem_credentials( $form_post, $type = '', $error = false, * @param string[] $types Types of connections. * @param array $credentials Credentials to connect with. * @param string $type Chosen filesystem method. - * @param WP_Error|bool $error Error object or status. + * @param bool|WP_Error $error Error object or status. * @param string $context Full path to the directory that is tested for being writable. */ $types = apply_filters( 'fs_ftp_connection_types', $types, $credentials, $type, $error, $context ); diff --git a/wp-admin/includes/plugin.php b/wp-admin/includes/plugin.php index 54dea7324f..6a33e04115 100644 --- a/wp-admin/includes/plugin.php +++ b/wp-admin/includes/plugin.php @@ -613,7 +613,7 @@ function is_network_only_plugin( $plugin ) { * @param bool $network_wide Optional. Whether to enable the plugin for all sites in the network * or just the current site. Multisite only. Default false. * @param bool $silent Optional. Whether to prevent calling activation hooks. Default false. - * @return WP_Error|null WP_Error on invalid file or null on success. + * @return null|WP_Error WP_Error on invalid file or null on success. */ function activate_plugin( $plugin, $redirect = '', $network_wide = false, $silent = false ) { $plugin = plugin_basename( trim( $plugin ) ); @@ -1071,7 +1071,7 @@ function validate_active_plugins() { * @since 2.5.0 * * @param string $plugin Path to the plugin file relative to the plugins directory. - * @return WP_Error|int 0 on success, WP_Error on failure. + * @return int|WP_Error 0 on success, WP_Error on failure. */ function validate_plugin( $plugin ) { if ( validate_file( $plugin ) ) { diff --git a/wp-admin/includes/update-core.php b/wp-admin/includes/update-core.php index a42310b0ac..375cac2d44 100644 --- a/wp-admin/includes/update-core.php +++ b/wp-admin/includes/update-core.php @@ -880,7 +880,7 @@ $_new_bundled_files = array( * * @param string $from New release unzipped path. * @param string $to Path to old WordPress installation. - * @return WP_Error|null WP_Error on failure, null on success. + * @return null|WP_Error WP_Error on failure, null on success. */ function update_core( $from, $to ) { global $wp_filesystem, $_old_files, $_new_bundled_files, $wpdb; @@ -1314,7 +1314,7 @@ function update_core( $from, $to ) { * @param string $from Source directory. * @param string $to Destination directory. * @param string[] $skip_list Array of files/folders to skip copying. - * @return WP_Error|true WP_Error on failure, true on success. + * @return true|WP_Error WP_Error on failure, true on success. */ function _copy_dir( $from, $to, $skip_list = array() ) { global $wp_filesystem; diff --git a/wp-includes/class-wp-customize-nav-menus.php b/wp-includes/class-wp-customize-nav-menus.php index 44ac82a1e0..7e8198e0cc 100644 --- a/wp-includes/class-wp-customize-nav-menus.php +++ b/wp-includes/class-wp-customize-nav-menus.php @@ -135,7 +135,7 @@ final class WP_Customize_Nav_Menus { * 'post_type' and 'taxonomy'. Default is 'post_type'. * @param string $object Optional. Accepts any registered taxonomy or post type name. Default is 'page'. * @param int $page Optional. The page number used to generate the query offset. Default is '0'. - * @return WP_Error|array Returns either a WP_Error object or an array of menu items. + * @return array|WP_Error An array of menu items on success, a WP_Error object on failure. */ public function load_available_items_query( $type = 'post_type', $object = 'page', $page = 0 ) { $items = array(); diff --git a/wp-includes/class-wp-customize-widgets.php b/wp-includes/class-wp-customize-widgets.php index 297342238a..7c5098f8a9 100644 --- a/wp-includes/class-wp-customize-widgets.php +++ b/wp-includes/class-wp-customize-widgets.php @@ -621,7 +621,7 @@ final class WP_Customize_Widgets { * @since 3.9.0 * * @param string $setting_id Widget setting ID. - * @return WP_Error|array Array containing a widget's id_base and number components, + * @return array|WP_Error Array containing a widget's id_base and number components, * or a WP_Error object. */ public function parse_widget_setting_id( $setting_id ) { @@ -1392,7 +1392,7 @@ final class WP_Customize_Widgets { * @global array $wp_registered_widget_controls * * @param string $widget_id Widget ID. - * @return WP_Error|array Array containing the updated widget information. + * @return array|WP_Error Array containing the updated widget information. * A WP_Error object, otherwise. */ public function call_widget_update( $widget_id ) { diff --git a/wp-includes/class-wp-image-editor-gd.php b/wp-includes/class-wp-image-editor-gd.php index 8cfee31f90..18a349a347 100644 --- a/wp-includes/class-wp-image-editor-gd.php +++ b/wp-includes/class-wp-image-editor-gd.php @@ -252,7 +252,8 @@ class WP_Image_Editor_GD extends WP_Image_Editor { * @type int $height The maximum height in pixels. * @type bool $crop Whether to crop the image to exact dimensions. * } - * @return WP_Error|array WP_Error on error, or the image data array for inclusion in the `sizes` array in the image meta. + * @return array|WP_Error The image data array for inclusion in the `sizes` array in the image meta, + * WP_Error object on error. */ public function make_subsize( $size_data ) { if ( ! isset( $size_data['width'] ) && ! isset( $size_data['height'] ) ) { @@ -417,7 +418,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor { * @param resource $image * @param string|null $filename * @param string|null $mime_type - * @return WP_Error|array + * @return array|WP_Error */ protected function _save( $image, $filename = null, $mime_type = null ) { list( $filename, $extension, $mime_type ) = $this->get_output_format( $filename, $mime_type ); diff --git a/wp-includes/class-wp-image-editor-imagick.php b/wp-includes/class-wp-image-editor-imagick.php index 99c568d569..8fc70e6ac8 100644 --- a/wp-includes/class-wp-image-editor-imagick.php +++ b/wp-includes/class-wp-image-editor-imagick.php @@ -460,7 +460,8 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor { * @type int $height The maximum height in pixels. * @type bool $crop Whether to crop the image to exact dimensions. * } - * @return WP_Error|array WP_Error on error, or the image data array for inclusion in the `sizes` array in the image meta. + * @return array|WP_Error The image data array for inclusion in the `sizes` array in the image meta, + * WP_Error object on error. */ public function make_subsize( $size_data ) { if ( ! isset( $size_data['width'] ) && ! isset( $size_data['height'] ) ) { diff --git a/wp-includes/class-wp-oembed-controller.php b/wp-includes/class-wp-oembed-controller.php index bbea8b74ae..74b400078d 100644 --- a/wp-includes/class-wp-oembed-controller.php +++ b/wp-includes/class-wp-oembed-controller.php @@ -110,7 +110,7 @@ final class WP_oEmbed_Controller { * @since 4.4.0 * * @param WP_REST_Request $request Full data about the request. - * @return WP_Error|array oEmbed response data or WP_Error on failure. + * @return array|WP_Error oEmbed response data or WP_Error on failure. */ public function get_item( $request ) { $post_id = url_to_postid( $request['url'] ); diff --git a/wp-includes/class-wp-theme.php b/wp-includes/class-wp-theme.php index 2697aaf521..c6fb5bf606 100644 --- a/wp-includes/class-wp-theme.php +++ b/wp-includes/class-wp-theme.php @@ -179,7 +179,7 @@ final class WP_Theme implements ArrayAccess { * * @param string $theme_dir Directory of the theme within the theme_root. * @param string $theme_root Theme root. - * @param WP_Error|void $_child If this theme is a parent theme, the child may be passed for validation purposes. + * @param WP_Theme|null $_child If this theme is a parent theme, the child may be passed for validation purposes. */ public function __construct( $theme_dir, $theme_root, $_child = null ) { global $wp_theme_directories; diff --git a/wp-includes/feed.php b/wp-includes/feed.php index 3c88b4e1ec..d74667bc75 100644 --- a/wp-includes/feed.php +++ b/wp-includes/feed.php @@ -738,7 +738,7 @@ function feed_content_type( $type = '' ) { * using SimplePie's multifeed feature. * See also {@link http://simplepie.org/wiki/faq/typical_multifeed_gotchas} * - * @return WP_Error|SimplePie WP_Error object on failure or SimplePie object on success + * @return SimplePie|WP_Error SimplePie object on success or WP_Error object on failure. */ function fetch_feed( $url ) { if ( ! class_exists( 'SimplePie', false ) ) { diff --git a/wp-includes/http.php b/wp-includes/http.php index 3356b97162..8fca0c541d 100644 --- a/wp-includes/http.php +++ b/wp-includes/http.php @@ -41,7 +41,7 @@ function _wp_http_get_object() { * * @param string $url URL to retrieve. * @param array $args Optional. Request arguments. Default empty array. - * @return WP_Error|array The response or WP_Error on failure. + * @return array|WP_Error The response or WP_Error on failure. */ function wp_safe_remote_request( $url, $args = array() ) { $args['reject_unsafe_urls'] = true; @@ -62,7 +62,7 @@ function wp_safe_remote_request( $url, $args = array() ) { * * @param string $url URL to retrieve. * @param array $args Optional. Request arguments. Default empty array. - * @return WP_Error|array The response or WP_Error on failure. + * @return array|WP_Error The response or WP_Error on failure. */ function wp_safe_remote_get( $url, $args = array() ) { $args['reject_unsafe_urls'] = true; @@ -83,7 +83,7 @@ function wp_safe_remote_get( $url, $args = array() ) { * * @param string $url URL to retrieve. * @param array $args Optional. Request arguments. Default empty array. - * @return WP_Error|array The response or WP_Error on failure. + * @return array|WP_Error The response or WP_Error on failure. */ function wp_safe_remote_post( $url, $args = array() ) { $args['reject_unsafe_urls'] = true; @@ -104,7 +104,7 @@ function wp_safe_remote_post( $url, $args = array() ) { * * @param string $url URL to retrieve. * @param array $args Optional. Request arguments. Default empty array. - * @return WP_Error|array The response or WP_Error on failure. + * @return array|WP_Error The response or WP_Error on failure. */ function wp_safe_remote_head( $url, $args = array() ) { $args['reject_unsafe_urls'] = true; @@ -127,7 +127,7 @@ function wp_safe_remote_head( $url, $args = array() ) { * * @param string $url URL to retrieve. * @param array $args Optional. Request arguments. Default empty array. - * @return WP_Error|array { + * @return array|WP_Error { * The response array or a WP_Error on failure. * * @type string[] $headers Array of response headers keyed by their name. @@ -157,7 +157,7 @@ function wp_remote_request( $url, $args = array() ) { * * @param string $url URL to retrieve. * @param array $args Optional. Request arguments. Default empty array. - * @return WP_Error|array The response or WP_Error on failure. + * @return array|WP_Error The response or WP_Error on failure. */ function wp_remote_get( $url, $args = array() ) { $http = _wp_http_get_object(); @@ -174,7 +174,7 @@ function wp_remote_get( $url, $args = array() ) { * * @param string $url URL to retrieve. * @param array $args Optional. Request arguments. Default empty array. - * @return WP_Error|array The response or WP_Error on failure. + * @return array|WP_Error The response or WP_Error on failure. */ function wp_remote_post( $url, $args = array() ) { $http = _wp_http_get_object(); @@ -191,7 +191,7 @@ function wp_remote_post( $url, $args = array() ) { * * @param string $url URL to retrieve. * @param array $args Optional. Request arguments. Default empty array. - * @return WP_Error|array The response or WP_Error on failure. + * @return array|WP_Error The response or WP_Error on failure. */ function wp_remote_head( $url, $args = array() ) { $http = _wp_http_get_object(); diff --git a/wp-includes/post.php b/wp-includes/post.php index c6d25a65da..812be58ed8 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -1405,7 +1405,8 @@ function get_post_types( $args = array(), $output = 'names', $operator = 'and' ) * @type string $_edit_link FOR INTERNAL USE ONLY! URL segment to use for edit link of * this post type. Default 'post.php?post=%d'. * } - * @return WP_Post_Type|WP_Error The registered post type object, or an error object. + * @return WP_Post_Type|WP_Error The registered post type object on success, + * WP_Error object on failure. */ function register_post_type( $post_type, $args = array() ) { global $wp_post_types; diff --git a/wp-includes/rest-api.php b/wp-includes/rest-api.php index 1d223531de..c5093cc33b 100644 --- a/wp-includes/rest-api.php +++ b/wp-includes/rest-api.php @@ -504,7 +504,7 @@ function rest_ensure_request( $request ) { * * @since 4.4.0 * - * @param WP_Error|WP_HTTP_Response|mixed $response Response to check. + * @param WP_HTTP_Response|WP_Error|mixed $response Response to check. * @return WP_REST_Response|mixed If response generated an error, WP_Error, if response * is already an instance, WP_HTTP_Response, otherwise * returns a new WP_REST_Response instance. @@ -872,8 +872,7 @@ function rest_output_link_header() { * @global mixed $wp_rest_auth_cookie * * @param WP_Error|mixed $result Error from another authentication handler, - * null if we should handle it, or another value - * if not. + * null if we should handle it, or another value if not. * @return WP_Error|mixed|bool WP_Error if the cookie is invalid, the $result, otherwise true. */ function rest_cookie_check_errors( $result ) { @@ -1025,7 +1024,7 @@ function rest_authorization_required_code() { * @param mixed $value * @param WP_REST_Request $request * @param string $param - * @return WP_Error|boolean + * @return true|WP_Error */ function rest_validate_request_arg( $value, $request, $param ) { $attributes = $request->get_attributes(); diff --git a/wp-includes/rest-api/class-wp-rest-server.php b/wp-includes/rest-api/class-wp-rest-server.php index 9c7859b5ca..1caee5e793 100644 --- a/wp-includes/rest-api/class-wp-rest-server.php +++ b/wp-includes/rest-api/class-wp-rest-server.php @@ -129,7 +129,7 @@ class WP_REST_Server { * * @since 4.4.0 * - * @param WP_Error|null|bool WP_Error if authentication error, null if authentication + * @param WP_Error|null|true WP_Error if authentication error, null if authentication * method wasn't used, true if authentication succeeded. */ return apply_filters( 'rest_authentication_errors', null ); diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php index 5d046dd646..253b1f86e5 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php @@ -84,7 +84,7 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. - * @return WP_Error|true Boolean true if the attachment may be created, or a WP_Error if not. + * @return true|WP_Error Boolean true if the attachment may be created, or a WP_Error if not. */ public function create_item_permissions_check( $request ) { $ret = parent::create_item_permissions_check( $request ); @@ -116,7 +116,7 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. - * @return WP_Error|WP_REST_Response Response object on success, WP_Error object on failure. + * @return WP_REST_Response|WP_Error Response object on success, WP_Error object on failure. */ public function create_item( $request ) { @@ -274,7 +274,7 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. - * @return WP_Error|WP_REST_Response Response object on success, WP_Error object on failure. + * @return WP_REST_Response|WP_Error Response object on success, WP_Error object on failure. */ public function update_item( $request ) { if ( ! empty( $request['post'] ) && in_array( get_post_type( $request['post'] ), array( 'revision', 'attachment' ), true ) ) { @@ -352,7 +352,7 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Request object. - * @return WP_Error|stdClass $prepared_attachment Post object. + * @return stdClass|WP_Error Post object. */ protected function prepare_item_for_database( $request ) { $prepared_attachment = parent::prepare_item_for_database( $request ); diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php index 376959ad2a..4fce45878c 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php @@ -118,7 +118,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. - * @return WP_Error|bool True if the request has read access, error object otherwise. + * @return true|WP_Error True if the request has read access, error object otherwise. */ public function get_items_permissions_check( $request ) { @@ -175,7 +175,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. - * @return WP_Error|WP_REST_Response Response object on success, or error object on failure. + * @return WP_REST_Response|WP_Error Response object on success, or error object on failure. */ public function get_items( $request ) { @@ -349,7 +349,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller { * @since 4.7.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, error object otherwise. + * @return true|WP_Error True if the request has read access for the item, error object otherwise. */ public function get_item_permissions_check( $request ) { $comment = $this->get_comment( $request['id'] ); @@ -380,7 +380,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. - * @return WP_Error|WP_REST_Response Response object on success, or error object on failure. + * @return WP_REST_Response|WP_Error Response object on success, or error object on failure. */ public function get_item( $request ) { $comment = $this->get_comment( $request['id'] ); @@ -400,7 +400,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. - * @return WP_Error|bool True if the request has access to create items, error object otherwise. + * @return true|WP_Error True if the request has access to create items, error object otherwise. */ public function create_item_permissions_check( $request ) { if ( ! is_user_logged_in() ) { @@ -490,7 +490,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. - * @return WP_Error|WP_REST_Response Response object on success, or error object on failure. + * @return WP_REST_Response|WP_Error Response object on success, or error object on failure. */ public function create_item( $request ) { if ( ! empty( $request['id'] ) ) { @@ -667,7 +667,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. - * @return WP_Error|bool True if the request has access to update the item, error object otherwise. + * @return true|WP_Error True if the request has access to update the item, error object otherwise. */ public function update_item_permissions_check( $request ) { $comment = $this->get_comment( $request['id'] ); @@ -688,7 +688,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. - * @return WP_Error|WP_REST_Response Response object on success, or error object on failure. + * @return WP_REST_Response|WP_Error Response object on success, or error object on failure. */ public function update_item( $request ) { $comment = $this->get_comment( $request['id'] ); @@ -787,7 +787,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. - * @return WP_Error|bool True if the request has access to delete the item, error object otherwise. + * @return true|WP_Error True if the request has access to delete the item, error object otherwise. */ public function delete_item_permissions_check( $request ) { $comment = $this->get_comment( $request['id'] ); @@ -807,7 +807,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. - * @return WP_Error|WP_REST_Response Response object on success, or error object on failure. + * @return WP_REST_Response|WP_Error Response object on success, or error object on failure. */ public function delete_item( $request ) { $comment = $this->get_comment( $request['id'] ); @@ -1691,7 +1691,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller { * @param string $value Author email value submitted. * @param WP_REST_Request $request Full details about the request. * @param string $param The parameter name. - * @return WP_Error|string The sanitized email address, if valid, + * @return string|WP_Error The sanitized email address, if valid, * otherwise an error. */ public function check_comment_author_email( $value, $request, $param ) { diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-controller.php index 1bc38124e9..90b97f0f3b 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-controller.php @@ -54,7 +54,7 @@ abstract class WP_REST_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Full data about the request. - * @return WP_Error|bool True if the request has read access, WP_Error object otherwise. + * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_items_permissions_check( $request ) { /* translators: %s: Method name. */ @@ -67,7 +67,7 @@ abstract class WP_REST_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Full data about the request. - * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure. + * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { /* translators: %s: Method name. */ @@ -80,7 +80,7 @@ abstract class WP_REST_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Full data about the request. - * @return WP_Error|bool 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 ) { /* translators: %s: Method name. */ @@ -93,7 +93,7 @@ abstract class WP_REST_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Full data about the request. - * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure. + * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_item( $request ) { /* translators: %s: Method name. */ @@ -106,7 +106,7 @@ abstract class WP_REST_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Full data about the request. - * @return WP_Error|bool True if the request has access to create items, WP_Error object otherwise. + * @return true|WP_Error True if the request has access to create items, WP_Error object otherwise. */ public function create_item_permissions_check( $request ) { /* translators: %s: Method name. */ @@ -119,7 +119,7 @@ abstract class WP_REST_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Full data about the request. - * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure. + * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function create_item( $request ) { /* translators: %s: Method name. */ @@ -132,7 +132,7 @@ abstract class WP_REST_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Full data about the request. - * @return WP_Error|bool True if the request has access to update the item, WP_Error object otherwise. + * @return true|WP_Error True if the request has access to update the item, WP_Error object otherwise. */ public function update_item_permissions_check( $request ) { /* translators: %s: Method name. */ @@ -145,7 +145,7 @@ abstract class WP_REST_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Full data about the request. - * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure. + * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function update_item( $request ) { /* translators: %s: Method name. */ @@ -158,7 +158,7 @@ abstract class WP_REST_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Full data about the request. - * @return WP_Error|bool 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 ) { /* translators: %s: Method name. */ @@ -171,7 +171,7 @@ abstract class WP_REST_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Full data about the request. - * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure. + * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function delete_item( $request ) { /* translators: %s: Method name. */ @@ -184,7 +184,7 @@ abstract class WP_REST_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Request object. - * @return WP_Error|object The prepared item, or WP_Error object on failure. + * @return object|WP_Error The prepared item, or WP_Error object on failure. */ protected function prepare_item_for_database( $request ) { /* translators: %s: Method name. */ @@ -198,7 +198,7 @@ abstract class WP_REST_Controller { * * @param mixed $item WordPress representation of the item. * @param WP_REST_Request $request Request object. - * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure. + * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function prepare_item_for_response( $item, $request ) { /* translators: %s: Method name. */ diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php index c0cce245ba..318f6c1a43 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php @@ -78,7 +78,7 @@ class WP_REST_Post_Statuses_Controller extends WP_REST_Controller { * @since 4.7.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 true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_items_permissions_check( $request ) { if ( 'edit' === $request['context'] ) { @@ -101,7 +101,7 @@ class WP_REST_Post_Statuses_Controller extends WP_REST_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. - * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure. + * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { $data = array(); @@ -128,7 +128,7 @@ class WP_REST_Post_Statuses_Controller extends WP_REST_Controller { * @since 4.7.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 true|WP_Error True if the request has read access for the item, WP_Error object otherwise. */ public function get_item_permissions_check( $request ) { $status = get_post_status_object( $request['status'] ); @@ -178,7 +178,7 @@ class WP_REST_Post_Statuses_Controller extends WP_REST_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. - * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure. + * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_item( $request ) { $obj = get_post_status_object( $request['status'] ); diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php index 99a3c77071..9b84f9f79b 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php @@ -77,7 +77,7 @@ class WP_REST_Post_Types_Controller extends WP_REST_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. - * @return WP_Error|true True if the request has read access, WP_Error object otherwise. + * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_items_permissions_check( $request ) { if ( 'edit' === $request['context'] ) { @@ -99,7 +99,7 @@ class WP_REST_Post_Types_Controller extends WP_REST_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. - * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure. + * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { $data = array(); @@ -122,7 +122,7 @@ class WP_REST_Post_Types_Controller extends WP_REST_Controller { * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. - * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure. + * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_item( $request ) { $obj = get_post_type_object( $request['type'] ); diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php index 26a1385ba5..dacc327b0e 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php @@ -1125,7 +1125,7 @@ class WP_REST_Users_Controller extends WP_REST_Controller { * @param mixed $value The username submitted in the request. * @param WP_REST_Request $request Full details about the request. * @param string $param The parameter name. - * @return WP_Error|string The sanitized username, if valid, otherwise an error. + * @return string|WP_Error The sanitized username, if valid, otherwise an error. */ public function check_username( $value, $request, $param ) { $username = (string) $value; @@ -1154,7 +1154,7 @@ class WP_REST_Users_Controller extends WP_REST_Controller { * @param mixed $value The password submitted in the request. * @param WP_REST_Request $request Full details about the request. * @param string $param The parameter name. - * @return WP_Error|string The sanitized password, if valid, otherwise an error. + * @return string|WP_Error The sanitized password, if valid, otherwise an error. */ public function check_user_password( $value, $request, $param ) { $password = (string) $value; diff --git a/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php b/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php index 692542612f..ba46ca2e67 100644 --- a/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php +++ b/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php @@ -70,7 +70,7 @@ abstract class WP_REST_Meta_Fields { * * @param int $object_id Object ID to fetch meta for. * @param WP_REST_Request $request Full details about the request. - * @return WP_Error|object Object containing the meta values by name, otherwise WP_Error object. + * @return object|WP_Error Object containing the meta values by name, otherwise WP_Error object. */ public function get_value( $object_id, $request ) { $fields = $this->get_registered_fields(); @@ -128,7 +128,7 @@ abstract class WP_REST_Meta_Fields { * * @param array $meta Array of meta parsed from the request. * @param int $object_id Object ID to fetch meta for. - * @return WP_Error|null WP_Error if one occurs, null on success. + * @return null|WP_Error Null on success, WP_Error object on failure. */ public function update_value( $meta, $object_id ) { $fields = $this->get_registered_fields(); @@ -520,7 +520,7 @@ abstract class WP_REST_Meta_Fields { * @param mixed $value The meta value submitted in the request. * @param WP_REST_Request $request Full details about the request. * @param string $param The parameter name. - * @return WP_Error|string The meta array, if valid, otherwise an error. + * @return array|false The meta array, if valid, false otherwise. */ public function check_meta_is_array( $value, $request, $param ) { if ( ! is_array( $value ) ) { diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 163b957b9e..0eaecdf887 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -408,7 +408,7 @@ function is_taxonomy_hierarchical( $taxonomy ) { * @type bool $_builtin This taxonomy is a "built-in" taxonomy. INTERNAL USE ONLY! * Default false. * } - * @return WP_Error|void WP_Error, if errors. + * @return void|WP_Error Void on success, WP_Error object on failure. */ function register_taxonomy( $taxonomy, $object_type, $args = array() ) { global $wp_taxonomies; diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 824422cb91..06fb01e97d 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -79,7 +79,8 @@ function wp_get_themes( $args = array() ) { if ( isset( $_themes[ $theme_root['theme_root'] . '/' . $theme ] ) ) { $themes[ $theme ] = $_themes[ $theme_root['theme_root'] . '/' . $theme ]; } else { - $themes[ $theme ] = new WP_Theme( $theme, $theme_root['theme_root'] ); + $themes[ $theme ] = new WP_Theme( $theme, $theme_root['theme_root'] ); + $_themes[ $theme_root['theme_root'] . '/' . $theme ] = $themes[ $theme ]; } } diff --git a/wp-includes/version.php b/wp-includes/version.php index edfd7651d3..f7fbbf8ba6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.4-alpha-46695'; +$wp_version = '5.4-alpha-46696'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index c354df2f6b..5c2cc4afed 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -3499,7 +3499,7 @@ class wpdb { * @global string $wp_version * @global string $required_mysql_version * - * @return WP_Error|void + * @return void|WP_Error */ public function check_database_version() { global $wp_version, $required_mysql_version; diff --git a/wp-signup.php b/wp-signup.php index fc38eac6c9..22af182283 100644 --- a/wp-signup.php +++ b/wp-signup.php @@ -95,7 +95,7 @@ do_action( 'before_signup_form' ); * * @param string $blogname The new site name. * @param string $blog_title The new site title. - * @param WP_Error|string $errors A WP_Error object containing existing errors. Defaults to empty string. + * @param string|WP_Error $errors A WP_Error object containing existing errors. Defaults to empty string. */ function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) { if ( ! is_wp_error( $errors ) ) { @@ -246,7 +246,7 @@ function validate_blog_form() { * * @param string $user_name The entered username. * @param string $user_email The entered email address. - * @param WP_Error|string $errors A WP_Error object containing existing errors. Defaults to empty string. + * @param string|WP_Error $errors A WP_Error object containing existing errors. Defaults to empty string. */ function show_user_form( $user_name = '', $user_email = '', $errors = '' ) { if ( ! is_wp_error( $errors ) ) { @@ -304,7 +304,7 @@ function validate_user_form() { * * @param string $blogname The new site name * @param string $blog_title The new site title. - * @param WP_Error|string $errors A WP_Error object containing existing errors. Defaults to empty string. + * @param string|WP_Error $errors A WP_Error object containing existing errors. Defaults to empty string. */ function signup_another_blog( $blogname = '', $blog_title = '', $errors = '' ) { $current_user = wp_get_current_user(); @@ -553,7 +553,7 @@ function confirm_another_blog_signup( $domain, $path, $blog_title, $user_name, $ * * @param string $user_name The username. * @param string $user_email The user's email. - * @param WP_Error|string $errors A WP_Error object containing existing errors. Defaults to empty string. + * @param string|WP_Error $errors A WP_Error object containing existing errors. Defaults to empty string. */ function signup_user( $user_name = '', $user_email = '', $errors = '' ) { global $active_signup; @@ -691,7 +691,7 @@ function confirm_user_signup( $user_name, $user_email ) { * @param string $user_email The user's email address. * @param string $blogname The site name. * @param string $blog_title The site title. - * @param WP_Error|string $errors A WP_Error object containing existing errors. Defaults to empty string. + * @param string|WP_Error $errors A WP_Error object containing existing errors. Defaults to empty string. */ function signup_blog( $user_name = '', $user_email = '', $blogname = '', $blog_title = '', $errors = '' ) { if ( ! is_wp_error( $errors ) ) {