Make WordPress Core


Ignore:
Timestamp:
09/01/2024 06:28:22 PM (6 weeks ago)
Author:
SergeyBiryukov
Message:

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

This adds a note that the functions return either an empty array or an empty string for a valid but non-existing ID, depending on the $single parameter.

Follow-up to [48658], [50641].

Props rodrigosprimo, jrf.
See #61608.

File:
1 edited

Legend:

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

    r58097 r58962  
    10701070 *               The value of meta data field if `$single` is true.
    10711071 *               False for an invalid `$site_id` (non-numeric, zero, or negative value).
    1072  *               An empty string if a valid but non-existing site ID is passed.
     1072 *               An empty array if a valid but non-existing site ID is passed and `$single` is false.
     1073 *               An empty string if a valid but non-existing site ID is passed and `$single` is true.
    10731074 */
    10741075function get_site_meta( $site_id, $key = '', $single = false ) {
Note: See TracChangeset for help on using the changeset viewer.