WordPress.org

Make WordPress Core

Changeset 48599


Ignore:
Timestamp:
07/24/2020 12:02:47 PM (2 months ago)
Author:
SergeyBiryukov
Message:

Docs: Correct some documentation for wp_update_term().

See #49572.

File:
1 edited

Legend:

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

    r48591 r48599  
    21392139 * 4. The term cache is cleaned.
    21402140 * 5. Several more actions are fired.
    2141  * 6. An array is returned containing the term_id and term_taxonomy_id.
     2141 * 6. An array is returned containing the `term_id` and `term_taxonomy_id`.
    21422142 *
    21432143 * If the 'slug' argument is not empty, then it is checked to see if the term
     
    21492149 *
    21502150 * Error handling:
    2151  * If $taxonomy does not exist or $term is empty,
     2151 * If `$taxonomy` does not exist or `$term` is empty,
    21522152 * a WP_Error object will be returned.
    21532153 *
     
    24312431     *
    24322432     * @param int $term_id Term ID.
    2433      * @param int $tt_id   Taxonomy term ID.
     2433     * @param int $tt_id   Term taxonomy ID.
    24342434     */
    24352435    $term_id = apply_filters( 'term_id_filter', $term_id, $tt_id );
     
    28842884 * Update term based on arguments provided.
    28852885 *
    2886  * The $args will indiscriminately override all values with the same field name.
     2886 * The `$args` will indiscriminately override all values with the same field name.
    28872887 * Care must be taken to not override important information need to update or
    28882888 * update will fail (or perhaps create a new term, neither would be acceptable).
    28892889 *
    28902890 * Defaults will set 'alias_of', 'description', 'parent', and 'slug' if not
    2891  * defined in $args already.
    2892  *
    2893  * 'alias_of' will create a term group, if it doesn't already exist, and update
    2894  * it for the $term.
    2895  *
    2896  * If the 'slug' argument in $args is missing, then the 'name' in $args will be
    2897  * used. It should also be noted that if you set 'slug' and it isn't unique then
    2898  * a WP_Error will be passed back. If you don't pass any slug, then a unique one
    2899  * will be created for you.
    2900  *
    2901  * For what can be overrode in `$args`, check the term scheme can contain and stay
    2902  * away from the term keys.
     2891 * defined in `$args` already.
     2892 *
     2893 * 'alias_of' will create a term group, if it doesn't already exist, and
     2894 * update it for the `$term`.
     2895 *
     2896 * If the 'slug' argument in `$args` is missing, then the 'name' will be used.
     2897 * If you set 'slug' and it isn't unique, then a WP_Error is returned.
     2898 * If you don't pass any slug, then a unique one will be created.
    29032899 *
    29042900 * @since 2.3.0
     
    29062902 * @global wpdb $wpdb WordPress database abstraction object.
    29072903 *
    2908  * @param int          $term_id  The ID of the term
    2909  * @param string       $taxonomy The context in which to relate the term to the object.
    2910  * @param array|string $args     Optional. Array of get_terms() arguments. Default empty array.
    2911  * @return array|WP_Error Returns Term ID and Taxonomy Term ID
     2904 * @param int          $term_id  The ID of the term.
     2905 * @param string       $taxonomy The taxonomy of the term.
     2906 * @param array|string $args {
     2907 *     Optional. Array or string of arguments for updating a term.
     2908 *
     2909 *     @type string $alias_of    Slug of the term to make this term an alias of.
     2910 *                               Default empty string. Accepts a term slug.
     2911 *     @type string $description The term description. Default empty string.
     2912 *     @type int    $parent      The id of the parent term. Default 0.
     2913 *     @type string $slug        The term slug to use. Default empty string.
     2914 * }
     2915 * @return array|WP_Error An array containing the `term_id` and `term_taxonomy_id`,
     2916 *                        WP_Error otherwise.
    29122917 */
    29132918function wp_update_term( $term_id, $taxonomy, $args = array() ) {
Note: See TracChangeset for help on using the changeset viewer.