WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/22/2020 10:29:34 AM (5 months ago)
Author:
SergeyBiryukov
Message:

Docs: Synchronize parameter documentation for various metadata functions, update per the documentation standards.

See #49572.

File:
1 edited

Legend:

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

    r47610 r47611  
    448448 * @link https://developer.wordpress.org/reference/functions/add_comment_meta/
    449449 *
    450  * @param int $comment_id Comment ID.
    451  * @param string $meta_key Metadata name.
    452  * @param mixed $meta_value Metadata value.
    453  * @param bool $unique Optional. Whether the same key should not be added. Default false.
     450 * @param int    $comment_id Comment ID.
     451 * @param string $meta_key   Metadata name.
     452 * @param mixed  $meta_value Metadata value. Must be serializable if non-scalar.
     453 * @param bool   $unique     Optional. Whether the same key should not be added.
     454 *                           Default false.
    454455 * @return int|bool Meta ID on success, false on failure.
    455456 */
     
    468469 * @link https://developer.wordpress.org/reference/functions/delete_comment_meta/
    469470 *
    470  * @param int $comment_id comment ID
    471  * @param string $meta_key Metadata name.
    472  * @param mixed $meta_value Optional. Metadata value.
     471 * @param int    $comment_id Comment ID.
     472 * @param string $meta_key   Metadata name.
     473 * @param mixed  $meta_value Optional. Metadata value. If provided,
     474 *                           rows will only be removed that match the value.
     475 *                           Must be serializable if non-scalar. Default empty.
    473476 * @return bool True on success, false on failure.
    474477 */
     
    483486 * @link https://developer.wordpress.org/reference/functions/get_comment_meta/
    484487 *
    485  * @param int $comment_id Comment ID.
    486  * @param string $key Optional. The meta key to retrieve. By default, returns data for all keys.
    487  * @param bool $single Optional. Whether to return a single value. Default false.
    488  * @return mixed Will be an array if $single is false. Will be value of meta data field if $single
    489  *  is true.
     488 * @param int    $comment_id Comment ID.
     489 * @param string $key        Optional. The meta key to retrieve. By default,
     490 *                           returns data for all keys.
     491 * @param bool   $single     Optional. Whether to return a single value.
     492 *                           This parameter has no effect if $key is not specified.
     493 *                           Default false.
     494 * @return mixed An array if $single is false. The value of meta data field
     495 *               if $single is true.
    490496 */
    491497function get_comment_meta( $comment_id, $key = '', $single = false ) {
     
    504510 * @link https://developer.wordpress.org/reference/functions/update_comment_meta/
    505511 *
    506  * @param int $comment_id Comment ID.
    507  * @param string $meta_key Metadata key.
    508  * @param mixed $meta_value Metadata value.
    509  * @param mixed $prev_value Optional. Previous value to check before updating. Default empty.
    510  * @return int|bool Meta ID if the key didn't exist, true on successful update, false on failure.
     512 * @param int    $comment_id Comment ID.
     513 * @param string $meta_key   Metadata key.
     514 * @param mixed  $meta_value Metadata value. Must be serializable if non-scalar.
     515 * @param mixed  $prev_value Optional. Previous value to check before updating.
     516 *                           Default empty.
     517 * @return int|bool Meta ID if the key didn't exist, true on successful update,
     518 *                  false on failure.
    511519 */
    512520function update_comment_meta( $comment_id, $meta_key, $meta_value, $prev_value = '' ) {
Note: See TracChangeset for help on using the changeset viewer.