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/taxonomy.php

    r47610 r47611  
    12121212 * @param int    $term_id    Term ID.
    12131213 * @param string $meta_key   Metadata name.
    1214  * @param mixed  $meta_value Metadata value.
    1215  * @param bool   $unique     Optional. Whether to bail if an entry with the same key is found for the term.
     1214 * @param mixed  $meta_value Metadata value. Must be serializable if non-scalar.
     1215 * @param bool   $unique     Optional. Whether the same key should not be added.
    12161216 *                           Default false.
    1217  * @return int|WP_Error|bool Meta ID on success. WP_Error when term_id is ambiguous between taxonomies.
    1218  *                           False on failure.
     1217 * @return int|false|WP_Error Meta ID on success, false on failure.
     1218 *                            WP_Error when term_id is ambiguous between taxonomies.
    12191219 */
    12201220function add_term_meta( $term_id, $meta_key, $meta_value, $unique = false ) {
     
    12331233 * @param int    $term_id    Term ID.
    12341234 * @param string $meta_key   Metadata name.
    1235  * @param mixed  $meta_value Optional. Metadata value. If provided, rows will only be removed that match the value.
     1235 * @param mixed  $meta_value Optional. Metadata value. If provided,
     1236 *                           rows will only be removed that match the value.
     1237 *                           Must be serializable if non-scalar. Default empty.
    12361238 * @return bool True on success, false on failure.
    12371239 */
     
    12461248 *
    12471249 * @param int    $term_id Term ID.
    1248  * @param string $key     Optional. The meta key to retrieve. If no key is provided, fetches all metadata for the term.
    1249  * @param bool   $single  Optional. Whether to return a single value. If false, an array of all values matching the
    1250  *                        `$term_id`/`$key` pair will be returned. Default false.
    1251  * @return mixed If `$single` is false, an array of metadata values. If `$single` is true, a single metadata value.
     1250 * @param string $key     Optional. The meta key to retrieve. By default,
     1251 *                        returns data for all keys. Default empty.
     1252 * @param bool   $single  Optional. Whether to return a single value.
     1253 *                        This parameter has no effect if $key is not specified.
     1254 *                        Default false.
     1255 * @return mixed An array if $single is false. The value of the meta field
     1256 *               if $single is true.
    12521257 */
    12531258function get_term_meta( $term_id, $key = '', $single = false ) {
     
    12661271 * @param int    $term_id    Term ID.
    12671272 * @param string $meta_key   Metadata key.
    1268  * @param mixed  $meta_value Metadata value.
    1269  * @param mixed  $prev_value Optional. Previous value to check before updating. Default empty.
    1270  * @return int|WP_Error|bool Meta ID if the key didn't previously exist. True on successful update.
    1271  *                           WP_Error when term_id is ambiguous between taxonomies. False on failure.
     1273 * @param mixed  $meta_value Metadata value. Must be serializable if non-scalar.
     1274 * @param mixed  $prev_value Optional. Previous value to check before updating.
     1275 *                           Default empty.
     1276 * @return int|bool|WP_Error Meta ID if the key didn't exist. true on successful update,
     1277 *                           false on failure. WP_Error when term_id is ambiguous
     1278 *                           between taxonomies.
    12721279 */
    12731280function update_term_meta( $term_id, $meta_key, $meta_value, $prev_value = '' ) {
     
    12881295 *
    12891296 * @param array $term_ids List of term IDs.
    1290  * @return array|false Returns false if there is nothing to update. Returns an array of metadata on success.
     1297 * @return array|false An array of metadata on success, false if there is nothing to update.
    12911298 */
    12921299function update_termmeta_cache( $term_ids ) {
Note: See TracChangeset for help on using the changeset viewer.