Make WordPress Core

Ticket #34626: 34626.1.patch

File 34626.1.patch, 4.9 KB (added by barryceelen, 10 years ago)

Fixes incorrect comment on delete_metadata_by_mid(), adds term meta code comment love to other meta functions

  • wp-includes/meta-functions.php

    From 062a030a20fc560a4bceac00348fd95d474effda Mon Sep 17 00:00:00 2001
    From: Barry Ceelen <b@rryceelen.com>
    Date: Mon, 9 Nov 2015 10:17:17 +0100
    Subject: [PATCH] Update code comments
    
    ---
     wp-includes/meta-functions.php | 18 +++++++++---------
     1 file changed, 9 insertions(+), 9 deletions(-)
    
    diff --git a/wp-includes/meta-functions.php b/wp-includes/meta-functions.php
    index 29cf291..43a484c 100644
    a b  
    1818 *
    1919 * @global wpdb $wpdb WordPress database abstraction object.
    2020 *
    21  * @param string $meta_type  Type of object metadata is for (e.g., comment, post, or user)
     21 * @param string $meta_type  Type of object metadata is for (e.g., comment, post, term, or user)
    2222 * @param int    $object_id  ID of the object metadata is for
    2323 * @param string $meta_key   Metadata key
    2424 * @param mixed  $meta_value Metadata value. Must be serializable if non-scalar.
    function add_metadata($meta_type, $object_id, $meta_key, $meta_value, $unique = 
    133133 *
    134134 * @global wpdb $wpdb WordPress database abstraction object.
    135135 *
    136  * @param string $meta_type  Type of object metadata is for (e.g., comment, post, or user)
     136 * @param string $meta_type  Type of object metadata is for (e.g., comment, post, term, or user)
    137137 * @param int    $object_id  ID of the object metadata is for
    138138 * @param string $meta_key   Metadata key
    139139 * @param mixed  $meta_value Metadata value. Must be serializable if non-scalar.
    function update_metadata($meta_type, $object_id, $meta_key, $meta_value, $prev_v 
    171171         * Filter whether to update metadata of a specific type.
    172172         *
    173173         * The dynamic portion of the hook, `$meta_type`, refers to the meta
    174          * object type (comment, post, or user). Returning a non-null value
     174         * object type (comment, post, term, or user). Returning a non-null value
    175175         * will effectively short-circuit the function.
    176176         *
    177177         * @since 3.1.0
    function update_metadata($meta_type, $object_id, $meta_key, $meta_value, $prev_v 
    295295 *
    296296 * @global wpdb $wpdb WordPress database abstraction object.
    297297 *
    298  * @param string $meta_type  Type of object metadata is for (e.g., comment, post, or user)
     298 * @param string $meta_type  Type of object metadata is for (e.g., comment, post, term, or user)
    299299 * @param int    $object_id  ID of the object metadata is for
    300300 * @param string $meta_key   Metadata key
    301301 * @param mixed  $meta_value Optional. Metadata value. Must be serializable if non-scalar. If specified, only delete
    function delete_metadata($meta_type, $object_id, $meta_key, $meta_value = '', $d 
    447447 *
    448448 * @since 2.9.0
    449449 *
    450  * @param string $meta_type Type of object metadata is for (e.g., comment, post, or user)
     450 * @param string $meta_type Type of object metadata is for (e.g., comment, post, term, or user)
    451451 * @param int    $object_id ID of the object metadata is for
    452452 * @param string $meta_key  Optional. Metadata key. If not specified, retrieve all metadata for
    453453 *                                  the specified object.
    function get_metadata($meta_type, $object_id, $meta_key = '', $single = false) { 
    518518 *
    519519 * @since 3.3.0
    520520 *
    521  * @param string $meta_type Type of object metadata is for (e.g., comment, post, or user)
     521 * @param string $meta_type Type of object metadata is for (e.g., comment, post, term, or user)
    522522 * @param int    $object_id ID of the object metadata is for
    523523 * @param string $meta_key  Metadata key.
    524524 * @return bool True of the key is set, false if not.
    function metadata_exists( $meta_type, $object_id, $meta_key ) { 
    558558 *
    559559 * @global wpdb $wpdb WordPress database abstraction object.
    560560 *
    561  * @param string $meta_type Type of object metadata is for (e.g., comment, post, meta, or user).
     561 * @param string $meta_type Type of object metadata is for (e.g., comment, post, term, or user).
    562562 * @param int    $meta_id   ID for a specific meta row
    563563 * @return object|false Meta object or false.
    564564 */
    function get_metadata_by_mid( $meta_type, $meta_id ) { 
    599599 *
    600600 * @global wpdb $wpdb WordPress database abstraction object.
    601601 *
    602  * @param string $meta_type  Type of object metadata is for (e.g., comment, post, or user)
     602 * @param string $meta_type  Type of object metadata is for (e.g., comment, post, term, or user)
    603603 * @param int    $meta_id    ID for a specific meta row
    604604 * @param string $meta_value Metadata value
    605605 * @param string $meta_key   Optional, you can provide a meta key to update it
    function delete_metadata_by_mid( $meta_type, $meta_id ) { 
    779779 *
    780780 * @global wpdb $wpdb WordPress database abstraction object.
    781781 *
    782  * @param string    $meta_type  Type of object metadata is for (e.g., comment, post, or user)
     782 * @param string    $meta_type  Type of object metadata is for (e.g., comment, post, term, or user)
    783783 * @param int|array $object_ids Array or comma delimited list of object IDs to update cache for
    784784 * @return array|false Metadata cache for the specified objects, or false on failure.
    785785 */