mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-08 17:38:26 +01:00
Docs: Correct some documentation for wp_update_term()
.
See #49572. Built from https://develop.svn.wordpress.org/trunk@48599 git-svn-id: http://core.svn.wordpress.org/trunk@48361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4fcbb1ee5d
commit
faf85323a6
@ -2138,7 +2138,7 @@ function wp_get_object_terms( $object_ids, $taxonomies, $args = array() ) {
|
||||
* 3. The 'term_id_filter' is evaluated.
|
||||
* 4. The term cache is cleaned.
|
||||
* 5. Several more actions are fired.
|
||||
* 6. An array is returned containing the term_id and term_taxonomy_id.
|
||||
* 6. An array is returned containing the `term_id` and `term_taxonomy_id`.
|
||||
*
|
||||
* If the 'slug' argument is not empty, then it is checked to see if the term
|
||||
* is invalid. If it is not a valid, existing term, it is added and the term_id
|
||||
@ -2148,7 +2148,7 @@ function wp_get_object_terms( $object_ids, $taxonomies, $args = array() ) {
|
||||
* the term is inserted and the term_id will be given.
|
||||
*
|
||||
* Error handling:
|
||||
* If $taxonomy does not exist or $term is empty,
|
||||
* If `$taxonomy` does not exist or `$term` is empty,
|
||||
* a WP_Error object will be returned.
|
||||
*
|
||||
* If the term already exists on the same hierarchical level,
|
||||
@ -2430,7 +2430,7 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) {
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @param int $term_id Term ID.
|
||||
* @param int $tt_id Taxonomy term ID.
|
||||
* @param int $tt_id Term taxonomy ID.
|
||||
*/
|
||||
$term_id = apply_filters( 'term_id_filter', $term_id, $tt_id );
|
||||
|
||||
@ -2883,32 +2883,37 @@ function wp_unique_term_slug( $slug, $term ) {
|
||||
/**
|
||||
* Update term based on arguments provided.
|
||||
*
|
||||
* The $args will indiscriminately override all values with the same field name.
|
||||
* The `$args` will indiscriminately override all values with the same field name.
|
||||
* Care must be taken to not override important information need to update or
|
||||
* update will fail (or perhaps create a new term, neither would be acceptable).
|
||||
*
|
||||
* Defaults will set 'alias_of', 'description', 'parent', and 'slug' if not
|
||||
* defined in $args already.
|
||||
* defined in `$args` already.
|
||||
*
|
||||
* 'alias_of' will create a term group, if it doesn't already exist, and update
|
||||
* it for the $term.
|
||||
* 'alias_of' will create a term group, if it doesn't already exist, and
|
||||
* update it for the `$term`.
|
||||
*
|
||||
* If the 'slug' argument in $args is missing, then the 'name' in $args will be
|
||||
* used. It should also be noted that if you set 'slug' and it isn't unique then
|
||||
* a WP_Error will be passed back. If you don't pass any slug, then a unique one
|
||||
* will be created for you.
|
||||
*
|
||||
* For what can be overrode in `$args`, check the term scheme can contain and stay
|
||||
* away from the term keys.
|
||||
* If the 'slug' argument in `$args` is missing, then the 'name' will be used.
|
||||
* If you set 'slug' and it isn't unique, then a WP_Error is returned.
|
||||
* If you don't pass any slug, then a unique one will be created.
|
||||
*
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @global wpdb $wpdb WordPress database abstraction object.
|
||||
*
|
||||
* @param int $term_id The ID of the term
|
||||
* @param string $taxonomy The context in which to relate the term to the object.
|
||||
* @param array|string $args Optional. Array of get_terms() arguments. Default empty array.
|
||||
* @return array|WP_Error Returns Term ID and Taxonomy Term ID
|
||||
* @param int $term_id The ID of the term.
|
||||
* @param string $taxonomy The taxonomy of the term.
|
||||
* @param array|string $args {
|
||||
* Optional. Array or string of arguments for updating a term.
|
||||
*
|
||||
* @type string $alias_of Slug of the term to make this term an alias of.
|
||||
* Default empty string. Accepts a term slug.
|
||||
* @type string $description The term description. Default empty string.
|
||||
* @type int $parent The id of the parent term. Default 0.
|
||||
* @type string $slug The term slug to use. Default empty string.
|
||||
* }
|
||||
* @return array|WP_Error An array containing the `term_id` and `term_taxonomy_id`,
|
||||
* WP_Error otherwise.
|
||||
*/
|
||||
function wp_update_term( $term_id, $taxonomy, $args = array() ) {
|
||||
global $wpdb;
|
||||
|
@ -13,7 +13,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.5-beta3-48598';
|
||||
$wp_version = '5.5-beta3-48599';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user