Changeset 52992
- Timestamp:
- 03/25/2022 04:51:06 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r52991 r52992 248 248 249 249 /** 250 * Return the names or objects of the taxonomies which are registered for the requested object or object type, such as251 * a post object or post type name.250 * Returns the names or objects of the taxonomies which are registered for the requested object or object type, 251 * such as a post object or post type name. 252 252 * 253 253 * Example: … … 305 305 * 306 306 * @param string $taxonomy Name of taxonomy object to return. 307 * @return WP_Taxonomy|false The Taxonomy Object or false if $taxonomy doesn't exist.307 * @return WP_Taxonomy|false The taxonomy object or false if $taxonomy doesn't exist. 308 308 */ 309 309 function get_taxonomy( $taxonomy ) { … … 381 381 * @since 4.5.0 Introduced `publicly_queryable` argument. 382 382 * @since 4.7.0 Introduced `show_in_rest`, 'rest_base' and 'rest_controller_class' 383 * arguments to register the Taxonomy in REST API.383 * arguments to register the taxonomy in REST API. 384 384 * @since 5.1.0 Introduced `meta_box_sanitize_cb` argument. 385 385 * @since 5.4.0 Added the registered taxonomy object as a return value. … … 736 736 737 737 /** 738 * Add an already registered taxonomy to an object type.738 * Adds an already registered taxonomy to an object type. 739 739 * 740 740 * @since 3.0.0 … … 778 778 779 779 /** 780 * Remove an already registered taxonomy from an object type.780 * Removes an already registered taxonomy from an object type. 781 781 * 782 782 * @since 3.7.0 … … 824 824 825 825 /** 826 * Retrieve object IDs of valid taxonomy and term.826 * Retrieves object IDs of valid taxonomy and term. 827 827 * 828 828 * The strings of `$taxonomies` must exist before this function will continue. … … 906 906 907 907 /** 908 * Get all Term data from database by Term ID.908 * Gets all term data from database by term ID. 909 909 * 910 910 * The usage of the get_term function is to apply filters to a term object. It … … 919 919 * the second is for the taxonomy name, 'term_$taxonomy'. Both hooks gets the 920 920 * term object, and the taxonomy name as parameters. Both hooks are expected to 921 * return a Term object.921 * return a term object. 922 922 * 923 923 * {@see 'get_term'} hook - Takes two parameters the term Object and the taxonomy name. … … 1033 1033 1034 1034 /** 1035 * Get all Term data from database by Term field and data.1035 * Gets all term data from database by term field and data. 1036 1036 * 1037 1037 * Warning: $value is not escaped for 'name' $field. You must do it yourself, if … … 1042 1042 * 1043 1043 * If $value does not exist, the return value will be false. If $taxonomy exists 1044 * and $field and $value combinations exist, the Term will be returned.1044 * and $field and $value combinations exist, the term will be returned. 1045 1045 * 1046 1046 * This function will always return the first term that matches the `$field`- … … 1134 1134 1135 1135 /** 1136 * Merge all term children into a single array of their IDs.1136 * Merges all term children into a single array of their IDs. 1137 1137 * 1138 1138 * This recursive function will merge all of the children of $term into the same … … 1145 1145 * @param int $term_id ID of term to get children. 1146 1146 * @param string $taxonomy Taxonomy name. 1147 * @return array|WP_Error List of Term IDs. WP_Error returned if `$taxonomy` does not exist.1147 * @return array|WP_Error List of term IDs. WP_Error returned if `$taxonomy` does not exist. 1148 1148 */ 1149 1149 function get_term_children( $term_id, $taxonomy ) { … … 1176 1176 1177 1177 /** 1178 * Get sanitized Term field.1178 * Gets sanitized term field. 1179 1179 * 1180 1180 * The function is for contextual reasons and for simplicity of usage. … … 1210 1210 1211 1211 /** 1212 * Sanitizes Term for editing.1212 * Sanitizes term for editing. 1213 1213 * 1214 1214 * Return value is sanitize_term() and usage is for sanitizing the term for … … 1457 1457 1458 1458 /** 1459 * Get all meta data, including meta IDs, for the given term ID.1459 * Gets all meta data, including meta IDs, for the given term ID. 1460 1460 * 1461 1461 * @since 4.9.0 … … 1615 1615 1616 1616 /** 1617 * Check if a term is an ancestor of another term.1617 * Checks if a term is an ancestor of another term. 1618 1618 * 1619 1619 * You can use either an ID or the term object for both parameters. … … 1645 1645 1646 1646 /** 1647 * Sanitize all term fields.1647 * Sanitizes all term fields. 1648 1648 * 1649 1649 * Relies on sanitize_term_field() to sanitize the term. The difference is that … … 1691 1691 1692 1692 /** 1693 * Cleansethe field value in the term based on the context.1693 * Sanitizes the field value in the term based on the context. 1694 1694 * 1695 1695 * Passing a term field value through the function should be assumed to have … … 1873 1873 1874 1874 /** 1875 * Count how many terms are in Taxonomy.1875 * Counts how many terms are in taxonomy. 1876 1876 * 1877 1877 * Default $args is 'hide_empty' which can be 'hide_empty=true' or array('hide_empty' => true). … … 1923 1923 1924 1924 /** 1925 * Will unlinkthe object from the taxonomy or taxonomies.1925 * Unlinks the object from the taxonomy or taxonomies. 1926 1926 * 1927 1927 * Will remove all relationships between the object and any terms in … … 2311 2311 2312 2312 /** 2313 * Add a new term to the database.2313 * Adds a new term to the database. 2314 2314 * 2315 2315 * A non-existent term is inserted in the following sequence: … … 2560 2560 * Filters the duplicate term check that takes place during term creation. 2561 2561 * 2562 * Term parent +taxonomy+slug combinations are meant to be unique, and wp_insert_term()2562 * Term parent + taxonomy + slug combinations are meant to be unique, and wp_insert_term() 2563 2563 * performs a last-minute confirmation of this uniqueness before allowing a new term 2564 2564 * to be created. Plugins with different uniqueness requirements may use this filter … … 2706 2706 2707 2707 /** 2708 * Create Term and Taxonomy Relationships.2709 * 2710 * Relates an object (post, link etc) to a term and taxonomy type. Creates the2708 * Creates term and taxonomy relationships. 2709 * 2710 * Relates an object (post, link, etc.) to a term and taxonomy type. Creates the 2711 2711 * term and taxonomy relationship if it doesn't already exist. Creates a term if 2712 2712 * it doesn't exist (using the slug). … … 2890 2890 2891 2891 /** 2892 * Add term(s) associated with a given object.2892 * Adds term(s) associated with a given object. 2893 2893 * 2894 2894 * @since 3.6.0 … … 2904 2904 2905 2905 /** 2906 * Remove term(s) associated with a given object.2906 * Removes term(s) associated with a given object. 2907 2907 * 2908 2908 * @since 3.6.0 … … 2991 2991 2992 2992 /** 2993 * Will makeslug unique, if it isn't already.2993 * Makes term slug unique, if it isn't already. 2994 2994 * 2995 2995 * The `$slug` has to be unique global to every taxonomy, meaning that one … … 3094 3094 3095 3095 /** 3096 * Update term based on arguments provided.3096 * Updates term based on arguments provided. 3097 3097 * 3098 3098 * The `$args` will indiscriminately override all values with the same field name. … … 3289 3289 * @since 2.9.0 3290 3290 * 3291 * @param int $term_id Term ID 3291 * @param int $term_id Term ID. 3292 3292 * @param string $taxonomy Taxonomy slug. 3293 3293 */ … … 3398 3398 3399 3399 /** 3400 * Enable or disableterm counting.3400 * Enables or disables term counting. 3401 3401 * 3402 3402 * @since 2.5.0 … … 3465 3465 3466 3466 /** 3467 * Perform term count update immediately.3467 * Performs term count update immediately. 3468 3468 * 3469 3469 * @since 2.5.0 … … 3552 3552 3553 3553 /** 3554 * Will removeall of the term IDs from the cache.3554 * Removes all of the term IDs from the cache. 3555 3555 * 3556 3556 * @since 2.3.0 … … 3617 3617 3618 3618 /** 3619 * Clean the caches for a taxonomy.3619 * Cleans the caches for a taxonomy. 3620 3620 * 3621 3621 * @since 4.9.0 … … 3778 3778 3779 3779 /** 3780 * Updates Terms to Taxonomyin cache.3780 * Updates terms in cache. 3781 3781 * 3782 3782 * @since 2.3.0 … … 3804 3804 3805 3805 /** 3806 * Retrieves children of taxonomy as Term IDs.3806 * Retrieves children of taxonomy as term IDs. 3807 3807 * 3808 3808 * @access private … … 3810 3810 * 3811 3811 * @param string $taxonomy Taxonomy name. 3812 * @return array Empty if $taxonomy isn't hierarchical or returns children as Term IDs.3812 * @return array Empty if $taxonomy isn't hierarchical or returns children as term IDs. 3813 3813 */ 3814 3814 function _get_term_hierarchy( $taxonomy ) { … … 3842 3842 3843 3843 /** 3844 * Get the subset of $terms that are descendants of $term_id.3844 * Gets the subset of $terms that are descendants of $term_id. 3845 3845 * 3846 3846 * If `$terms` is an array of objects, then _get_term_children() returns an array of objects. … … 3918 3918 3919 3919 /** 3920 * Add count of children to parent count.3920 * Adds count of children to parent count. 3921 3921 * 3922 3922 * Recalculates term counts by including items from child terms. Assumes all … … 4025 4025 4026 4026 /** 4027 * Will updateterm count based on object types of the current taxonomy.4027 * Updates term count based on object types of the current taxonomy. 4028 4028 * 4029 4029 * Private function for the default callback for post_tag and category … … 4035 4035 * @global wpdb $wpdb WordPress database abstraction object. 4036 4036 * 4037 * @param int[] $terms List of Term taxonomy IDs.4037 * @param int[] $terms List of term taxonomy IDs. 4038 4038 * @param WP_Taxonomy $taxonomy Current taxonomy object of terms. 4039 4039 */ … … 4095 4095 4096 4096 /** 4097 * Will updateterm count based on number of objects.4097 * Updates term count based on number of objects. 4098 4098 * 4099 4099 * Default callback for the 'link_category' taxonomy. … … 4122 4122 4123 4123 /** 4124 * Create a new term for a term_taxonomy item that currently shares its term4124 * Creates a new term for a term_taxonomy item that currently shares its term 4125 4125 * with another term_taxonomy. 4126 4126 * … … 4369 4369 /** 4370 4370 * In order to avoid the _wp_batch_split_terms() job being accidentally removed, 4371 * check that it's still scheduled while we haven't finished splitting terms.4371 * checks that it's still scheduled while we haven't finished splitting terms. 4372 4372 * 4373 4373 * @ignore … … 4381 4381 4382 4382 /** 4383 * Check default categories when a term gets split to see if any of them need to be updated.4383 * Checks default categories when a term gets split to see if any of them need to be updated. 4384 4384 * 4385 4385 * @ignore … … 4404 4404 4405 4405 /** 4406 * Check menu items when a term gets split to see if any of them need to be updated.4406 * Checks menu items when a term gets split to see if any of them need to be updated. 4407 4407 * 4408 4408 * @ignore … … 4440 4440 4441 4441 /** 4442 * If the term being split is a nav_menu, change associations.4442 * If the term being split is a nav_menu, changes associations. 4443 4443 * 4444 4444 * @ignore … … 4466 4466 4467 4467 /** 4468 * Get data about terms that previously shared a single term_id, but have since been split.4468 * Gets data about terms that previously shared a single term_id, but have since been split. 4469 4469 * 4470 4470 * @since 4.2.0 … … 4485 4485 4486 4486 /** 4487 * Get the new term ID corresponding to a previously split term.4487 * Gets the new term ID corresponding to a previously split term. 4488 4488 * 4489 4489 * @since 4.2.0 … … 4507 4507 4508 4508 /** 4509 * Determine whether a term is shared between multiple taxonomies.4509 * Determines whether a term is shared between multiple taxonomies. 4510 4510 * 4511 4511 * Shared taxonomy terms began to be split in 4.3, but failed cron tasks or … … 4531 4531 4532 4532 /** 4533 * Generate a permalink for a taxonomy term archive.4533 * Generates a permalink for a taxonomy term archive. 4534 4534 * 4535 4535 * @since 2.5.0 … … 4645 4645 4646 4646 /** 4647 * Display the taxonomies of a post with available options.4647 * Displays the taxonomies of a post with available options. 4648 4648 * 4649 4649 * This function can be used within the loop to display the taxonomies for a … … 4677 4677 4678 4678 /** 4679 * Retrieve all taxonomies associated with a post.4679 * Retrieves all taxonomies associated with a post. 4680 4680 * 4681 4681 * This function can be used within the loop. It will also return an array of … … 4745 4745 4746 4746 /** 4747 * Retrieve all taxonomy names for the given post.4747 * Retrieves all taxonomy names for the given post. 4748 4748 * 4749 4749 * @since 2.5.0 … … 4759 4759 4760 4760 /** 4761 * Determine if the given object is associated with any of the given terms.4761 * Determines if the given object is associated with any of the given terms. 4762 4762 * 4763 4763 * The given terms are checked against the object's terms' term_ids, names and slugs. … … 4834 4834 4835 4835 /** 4836 * Determine if the given object type is associated with the given taxonomy.4836 * Determines if the given object type is associated with the given taxonomy. 4837 4837 * 4838 4838 * @since 3.0.0 … … 4851 4851 4852 4852 /** 4853 * Get an array of ancestor IDs for a given object.4853 * Gets an array of ancestor IDs for a given object. 4854 4854 * 4855 4855 * @since 3.1.0 … … 4907 4907 4908 4908 /** 4909 * Returns the term's parent's term _ID.4909 * Returns the term's parent's term ID. 4910 4910 * 4911 4911 * @since 3.1.0
Note: See TracChangeset
for help on using the changeset viewer.