Make WordPress Core

Changeset 49929


Ignore:
Timestamp:
01/04/2021 05:16:43 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Docs: In various @return tags, list the expected type first, instead of false or WP_Error.

Follow-up to [46696], [47060], [49926], [49927].

See #51800.

Location:
trunk/src
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-community-events.php

    r49927 r49929  
    307307     *
    308308     * @param array $location Should contain 'latitude' and 'longitude' indexes.
    309      * @return false|string false on failure, or a string on success.
     309     * @return string|false Transient key on success, false on failure.
    310310     */
    311311    protected function get_events_transient_key( $location ) {
  • trunk/src/wp-admin/includes/deprecated.php

    r49927 r49929  
    129129 * @param int $level         Optional. Number of levels deep to display. Default 0.
    130130 * @param array $categories  Optional. Categories to include in the control. Default 0.
    131  * @return false|void False if no categories were found.
     131 * @return void|false False if no categories were found.
    132132 */
    133133function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) {
  • trunk/src/wp-admin/includes/file.php

    r49927 r49929  
    131131 * @param int      $levels     Optional. Levels of folders to follow, Default 100 (PHP Loop limit).
    132132 * @param string[] $exclusions Optional. List of folders and files to skip.
    133  * @return false|string[] False on failure, else array of files.
     133 * @return string[]|false Array of files on success, false on failure.
    134134 */
    135135function list_files( $folder = '', $levels = 100, $exclusions = array() ) {
  • trunk/src/wp-admin/includes/image.php

    r49927 r49929  
    681681 *
    682682 * @param string $file
    683  * @return false|array False on failure. Image metadata array on success.
     683 * @return array|false Image metadata array on success, false on failure.
    684684 */
    685685function wp_read_image_metadata( $file ) {
  • trunk/src/wp-admin/includes/ms.php

    r49927 r49929  
    312312 *
    313313 * @param int $id The user ID.
    314  * @return false|int The ID of the refreshed user or false if the user does not exist.
     314 * @return int|false The ID of the refreshed user or false if the user does not exist.
    315315 */
    316316function refresh_user_details( $id ) {
  • trunk/src/wp-includes/class-wp-hook.php

    r49928 r49929  
    195195     * @param string         $tag               Optional. The name of the filter hook. Default empty.
    196196     * @param callable|false $function_to_check Optional. The callback to check for. Default false.
    197      * @return int|bool If `$function_to_check` is omitted, returns boolean for whether the hook has
     197     * @return bool|int If `$function_to_check` is omitted, returns boolean for whether the hook has
    198198     *                  anything registered. When checking a specific function, the priority of that
    199199     *                  hook is returned, or false if the function is not attached.
  • trunk/src/wp-includes/class-wp-recovery-mode-email-service.php

    r49927 r49929  
    290290     *
    291291     * @param array $extension The extension that caused the error.
    292      * @return false|array A plugin array {@see get_plugins()} or `false` if no plugin was found.
     292     * @return array|false A plugin array {@see get_plugins()} or `false` if no plugin was found.
    293293     */
    294294    private function get_plugin( $extension ) {
  • trunk/src/wp-includes/cron.php

    r49927 r49929  
    755755 * @since 5.1.0 Return value added to indicate success or failure.
    756756 *
    757  * @return false|int On success an integer indicating number of events spawned (0 indicates no
     757 * @return int|false On success an integer indicating number of events spawned (0 indicates no
    758758 *                   events needed to be spawned), false if spawning fails for one or more events.
    759759 */
  • trunk/src/wp-includes/functions.php

    r49927 r49929  
    939939 * @param string $url        URL to retrieve HTTP headers from.
    940940 * @param bool   $deprecated Not Used.
    941  * @return false|string False on failure, headers on success.
     941 * @return string|false Headers on success, false on failure.
    942942 */
    943943function wp_get_http_headers( $url, $deprecated = false ) {
     
    69156915 *                        the similarly arbitrary {@see '$context_memory_limit'} filter will be
    69166916 *                        invoked. Default 'admin'.
    6917  * @return false|int|string The limit that was set or false on failure.
     6917 * @return int|string|false The limit that was set or false on failure.
    69186918 */
    69196919function wp_raise_memory_limit( $context = 'admin' ) {
  • trunk/src/wp-includes/plugin.php

    r49928 r49929  
    133133 * @param string         $tag               The name of the filter hook.
    134134 * @param callable|false $function_to_check Optional. The callback to check for. Default false.
    135  * @return int|bool If `$function_to_check` is omitted, returns boolean for whether the hook has
     135 * @return bool|int If `$function_to_check` is omitted, returns boolean for whether the hook has
    136136 *                  anything registered. When checking a specific function, the priority of that
    137137 *                  hook is returned, or false if the function is not attached.
     
    566566 * @param string         $tag               The name of the action hook.
    567567 * @param callable|false $function_to_check Optional. The callback to check for. Default false.
    568  * @return int|bool If `$function_to_check` is omitted, returns boolean for whether the hook has
     568 * @return bool|int If `$function_to_check` is omitted, returns boolean for whether the hook has
    569569 *                  anything registered. When checking a specific function, the priority of that
    570570 *                  hook is returned, or false if the function is not attached.
  • trunk/src/wp-includes/post.php

    r49927 r49929  
    50615061 *
    50625062 * @param int|WP_Post $post_id Post ID or object.
    5063  * @return false|string[] Array of URLs already pinged for the given post, false if the post is not found.
     5063 * @return string[]|false Array of URLs already pinged for the given post, false if the post is not found.
    50645064 */
    50655065function get_pung( $post_id ) {
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php

    r49927 r49929  
    5151     * @param WP_REST_Request $request Full details about the request.
    5252     *
    53      * @return WP_Error|true True if the request has permission, WP_Error object otherwise.
     53     * @return true|WP_Error True if the request has permission, WP_Error object otherwise.
    5454     */
    5555    public function get_items_permissions_check( $request ) {
     
    7272     * @param WP_REST_Request $request Full details about the request.
    7373     *
    74      * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
     74     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    7575     */
    7676    public function get_items( $request ) {
     
    116116     * @param WP_REST_Request $request Request object.
    117117     *
    118      * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
     118     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    119119     */
    120120    public function prepare_item_for_response( $plugin, $request ) {
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php

    r49927 r49929  
    115115     *
    116116     * @param WP_REST_Request $request Full details about the request.
    117      * @return WP_Error|true True if the request has read access, WP_Error object otherwise.
     117     * @return true|WP_Error True if the request has read access, WP_Error object otherwise.
    118118     */
    119119    public function get_items_permissions_check( $request ) {
     
    127127     *
    128128     * @param WP_REST_Request $request Full details about the request.
    129      * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
     129     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    130130     */
    131131    public function get_items( $request ) {
     
    161161     *
    162162     * @param WP_REST_Request $request Full details about the request.
    163      * @return WP_Error|true True if the request has read access for the item, WP_Error object otherwise.
     163     * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise.
    164164     */
    165165    public function get_item_permissions_check( $request ) {
     
    182182     * @since 5.5.0
    183183     *
    184      * @return WP_Error|true True if the block type is visible, WP_Error otherwise.
     184     * @return true|WP_Error True if the block type is visible, WP_Error otherwise.
    185185     */
    186186    protected function check_read_permission() {
     
    220220     *
    221221     * @param WP_REST_Request $request Full details about the request.
    222      * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
     222     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    223223     */
    224224    public function get_item( $request ) {
  • trunk/src/wp-includes/rss.php

    r49927 r49929  
    404404 * @subpackage MagpieRSS
    405405 *
    406  * @param string $url URL to retrieve feed
    407  * @return false|MagpieRSS false on failure or MagpieRSS object on success.
     406 * @param string $url URL to retrieve feed.
     407 * @return MagpieRSS|false MagpieRSS object on success, false on failure.
    408408 */
    409409function fetch_rss ($url) {
  • trunk/src/wp-includes/taxonomy.php

    r49927 r49929  
    744744 * @param string|array $taxonomies String of taxonomy name or Array of string values of taxonomy names.
    745745 * @param array|string $args       Change the order of the object_ids, either ASC or DESC.
    746  * @return WP_Error|array If the taxonomy does not exist, then WP_Error will be returned. On success.
    747  *  the array can be empty meaning that there are no $object_ids found or it will return the $object_ids found.
     746 * @return array|WP_Error An array of $object_ids on success, WP_Error if the taxonomy does not exist.
    748747 */
    749748function get_objects_in_term( $term_ids, $taxonomies, $args = array() ) {
  • trunk/src/wp-includes/user.php

    r49927 r49929  
    15381538 *
    15391539 * @param object|WP_User $user User object or database row to be cached
    1540  * @return false|void Returns false on failure.
     1540 * @return void|false Returns false on failure.
    15411541 */
    15421542function update_user_caches( $user ) {
Note: See TracChangeset for help on using the changeset viewer.