WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/22/2020 10:29:34 AM (9 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/post.php

    r47610 r47611  
    20912091 * @param int    $post_id    Post ID.
    20922092 * @param string $meta_key   Metadata name.
    2093  * @param mixed  $meta_value Optional. Metadata value. Must be serializable if
    2094  *                           non-scalar. Default empty.
     2093 * @param mixed  $meta_value Optional. Metadata value. If provided,
     2094 *                           rows will only be removed that match the value.
     2095 *                           Must be serializable if non-scalar. Default empty.
    20952096 * @return bool True on success, false on failure.
    20962097 */
     
    21112112 *
    21122113 * @param int    $post_id Post ID.
    2113  * @param string $key     Optional. The meta key to retrieve. By default, returns
    2114  *                        data for all keys. Default empty.
    2115  * @param bool   $single  Optional. If true, returns only the first value for the specified meta key.
    2116  *                        This parameter has no effect if $key is not specified. Default false.
    2117  * @return mixed Will be an array if $single is false. Will be value of the meta
    2118  *               field if $single is true.
     2114 * @param string $key     Optional. The meta key to retrieve. By default,
     2115 *                        returns data for all keys. Default empty.
     2116 * @param bool   $single  Optional. Whether to return a single value.
     2117 *                        This parameter has no effect if $key is not specified.
     2118 *                        Default false.
     2119 * @return mixed An array if $single is false. The value of the meta field
     2120 *               if $single is true.
    21192121 */
    21202122function get_post_meta( $post_id, $key = '', $single = false ) {
     
    21372139 * @param string $meta_key   Metadata key.
    21382140 * @param mixed  $meta_value Metadata value. Must be serializable if non-scalar.
    2139  * @param mixed  $prev_value Optional. Previous value to check before updating. Default empty.
    2140  * @return int|bool The new meta field ID if a field with the given key didn't exist and was
    2141  *                  therefore added, true on successful update, false on failure.
     2141 * @param mixed  $prev_value Optional. Previous value to check before updating.
     2142 *                           Default empty.
     2143 * @return int|bool Meta ID if the key didn't exist, true on successful update,
     2144 *                  false on failure.
    21422145 */
    21432146function update_post_meta( $post_id, $meta_key, $meta_value, $prev_value = '' ) {
     
    67676770 *
    67686771 * @param int[] $post_ids Array of post IDs.
    6769  * @return array|false Returns false if there is nothing to update or an array
    6770  *                     of metadata.
     6772 * @return array|false An array of metadata on success, false if there is nothing to update.
    67716773 */
    67726774function update_postmeta_cache( $post_ids ) {
Note: See TracChangeset for help on using the changeset viewer.