Make WordPress Core


Ignore:
Timestamp:
04/02/2021 03:47:34 PM (4 years ago)
Author:
davidbaumwald
Message:

Docs: Clarify return results for a non-existing ID in metadata functions.

[48658] documented that various metadata functions return false for an invalid ID. However, that does not clarify what an invalid ID is: a non-numeric, zero, or negative value. This change adds the clarification in all relevant metadata function docblocks.

Props icopydoc, SergeyBiryukov, davidkryzaniak, audrasjb.
Fixes #51797.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ms-site.php

    r49927 r50641  
    10851085 *                        returns data for all keys. Default empty.
    10861086 * @param bool   $single  Optional. Whether to return a single value.
    1087  *                        This parameter has no effect if $key is not specified.
     1087 *                        This parameter has no effect if `$key` is not specified.
    10881088 *                        Default false.
    1089  * @return mixed An array if $single is false. The value of meta data field
    1090  *               if $single is true. False for an invalid $site_id.
     1089 * @return mixed An array of values if `$single` is false.
     1090 *               The value of meta data field if `$single` is true.
     1091 *               False for an invalid `$site_id` (non-numeric, zero, or negative value).
     1092 *               An empty string if a valid but non-existing site ID is passed.
    10911093 */
    10921094function get_site_meta( $site_id, $key = '', $single = false ) {
Note: See TracChangeset for help on using the changeset viewer.