Make WordPress Core


Ignore:
Timestamp:
09/01/2024 06:28:22 PM (5 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/comment.php

    r58401 r58962  
    480480 *               The value of meta data field if `$single` is true.
    481481 *               False for an invalid `$comment_id` (non-numeric, zero, or negative value).
    482  *               An empty string if a valid but non-existing comment ID is passed.
     482 *               An empty array if a valid but non-existing comment ID is passed and `$single` is false.
     483 *               An empty string if a valid but non-existing comment ID is passed and `$single` is true.
    483484 */
    484485function get_comment_meta( $comment_id, $key = '', $single = false ) {
Note: See TracChangeset for help on using the changeset viewer.