Docs: Correct @return values for a few REST API class methods.

Includes listing the expected type first, instead of `WP_Error`.

Follow-up to [39031], [39033], [46696], [49927], [49929], [50993], [51286], [51973], [52079], [52286], [53152], [56415].

Props antonvlasenko.
See #61593.
Built from https://develop.svn.wordpress.org/trunk@58704


git-svn-id: http://core.svn.wordpress.org/trunk@58106 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2024-07-10 11:12:16 +00:00
parent ccc46f8ada
commit a5efdd1cc9
8 changed files with 11 additions and 11 deletions

View File

@ -78,7 +78,7 @@ class WP_REST_Block_Pattern_Categories_Controller extends WP_REST_Controller {
* @since 6.0.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 ) {
$response = array();

View File

@ -50,7 +50,7 @@ class WP_REST_Edit_Site_Export_Controller extends WP_REST_Controller {
*
* @since 5.9.0
*
* @return WP_Error|true True if the request has access, or WP_Error object.
* @return true|WP_Error True if the request has access, or WP_Error object.
*/
public function permissions_check() {
if ( current_user_can( 'edit_theme_options' ) ) {
@ -70,7 +70,7 @@ class WP_REST_Edit_Site_Export_Controller extends WP_REST_Controller {
*
* @since 5.9.0
*
* @return WP_Error|void
* @return void|WP_Error
*/
public function export() {
// Generate the export file.

View File

@ -77,7 +77,7 @@ class WP_REST_Menu_Locations_Controller extends WP_REST_Controller {
* @since 5.9.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 ( ! current_user_can( 'edit_theme_options' ) ) {
@ -97,7 +97,7 @@ class WP_REST_Menu_Locations_Controller extends WP_REST_Controller {
* @since 5.9.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();
@ -140,7 +140,7 @@ class WP_REST_Menu_Locations_Controller extends WP_REST_Controller {
* @since 5.9.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 ) {
$registered_menus = get_registered_nav_menus();

View File

@ -149,7 +149,7 @@ class WP_REST_Taxonomies_Controller extends WP_REST_Controller {
* @since 4.7.0
*
* @param WP_REST_Request $request Full details about the request.
* @return true|WP_Error True if the request has read access for the item, otherwise false or WP_Error object.
* @return bool|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 ) {

View File

@ -462,7 +462,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 true|WP_Error True if the request has access to create items, false or WP_Error object otherwise.
* @return bool|WP_Error True if the request has access to create items, otherwise false or WP_Error object.
*/
public function create_item_permissions_check( $request ) {

View File

@ -192,7 +192,7 @@ class WP_REST_URL_Details_Controller extends WP_REST_Controller {
*
* @since 5.9.0
*
* @return WP_Error|bool True if the request has permission, else WP_Error.
* @return true|WP_Error True if the request has permission, else WP_Error.
*/
public function permissions_check() {
if ( current_user_can( 'edit_posts' ) ) {

View File

@ -133,7 +133,7 @@ class WP_REST_Widgets_Controller extends WP_REST_Controller {
* @since 5.8.0
*
* @param WP_REST_Request $request Full details about the request.
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
* @return WP_REST_Response Response object.
*/
public function get_items( $request ) {
$this->retrieve_widgets();

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.7-alpha-58703';
$wp_version = '6.7-alpha-58704';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.