Make WordPress Core

Changeset 52992


Ignore:
Timestamp:
03/25/2022 04:51:06 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Docs: Use third-person singular verbs for function descriptions in wp-includes/taxonomy.php, per the documentation standards.

See #54729.

File:
1 edited

Legend:

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

    r52991 r52992  
    248248
    249249/**
    250  * Return the names or objects of the taxonomies which are registered for the requested object or object type, such as
    251  * 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.
    252252 *
    253253 * Example:
     
    305305 *
    306306 * @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.
    308308 */
    309309function get_taxonomy( $taxonomy ) {
     
    381381 * @since 4.5.0 Introduced `publicly_queryable` argument.
    382382 * @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.
    384384 * @since 5.1.0 Introduced `meta_box_sanitize_cb` argument.
    385385 * @since 5.4.0 Added the registered taxonomy object as a return value.
     
    736736
    737737/**
    738  * Add an already registered taxonomy to an object type.
     738 * Adds an already registered taxonomy to an object type.
    739739 *
    740740 * @since 3.0.0
     
    778778
    779779/**
    780  * Remove an already registered taxonomy from an object type.
     780 * Removes an already registered taxonomy from an object type.
    781781 *
    782782 * @since 3.7.0
     
    824824
    825825/**
    826  * Retrieve object IDs of valid taxonomy and term.
     826 * Retrieves object IDs of valid taxonomy and term.
    827827 *
    828828 * The strings of `$taxonomies` must exist before this function will continue.
     
    906906
    907907/**
    908  * Get all Term data from database by Term ID.
     908 * Gets all term data from database by term ID.
    909909 *
    910910 * The usage of the get_term function is to apply filters to a term object. It
     
    919919 * the second is for the taxonomy name, 'term_$taxonomy'. Both hooks gets the
    920920 * term object, and the taxonomy name as parameters. Both hooks are expected to
    921  * return a Term object.
     921 * return a term object.
    922922 *
    923923 * {@see 'get_term'} hook - Takes two parameters the term Object and the taxonomy name.
     
    10331033
    10341034/**
    1035  * Get all Term data from database by Term field and data.
     1035 * Gets all term data from database by term field and data.
    10361036 *
    10371037 * Warning: $value is not escaped for 'name' $field. You must do it yourself, if
     
    10421042 *
    10431043 * 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.
    10451045 *
    10461046 * This function will always return the first term that matches the `$field`-
     
    11341134
    11351135/**
    1136  * Merge all term children into a single array of their IDs.
     1136 * Merges all term children into a single array of their IDs.
    11371137 *
    11381138 * This recursive function will merge all of the children of $term into the same
     
    11451145 * @param int    $term_id  ID of term to get children.
    11461146 * @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.
    11481148 */
    11491149function get_term_children( $term_id, $taxonomy ) {
     
    11761176
    11771177/**
    1178  * Get sanitized Term field.
     1178 * Gets sanitized term field.
    11791179 *
    11801180 * The function is for contextual reasons and for simplicity of usage.
     
    12101210
    12111211/**
    1212  * Sanitizes Term for editing.
     1212 * Sanitizes term for editing.
    12131213 *
    12141214 * Return value is sanitize_term() and usage is for sanitizing the term for
     
    14571457
    14581458/**
    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.
    14601460 *
    14611461 * @since 4.9.0
     
    16151615
    16161616/**
    1617  * Check if a term is an ancestor of another term.
     1617 * Checks if a term is an ancestor of another term.
    16181618 *
    16191619 * You can use either an ID or the term object for both parameters.
     
    16451645
    16461646/**
    1647  * Sanitize all term fields.
     1647 * Sanitizes all term fields.
    16481648 *
    16491649 * Relies on sanitize_term_field() to sanitize the term. The difference is that
     
    16911691
    16921692/**
    1693  * Cleanse the field value in the term based on the context.
     1693 * Sanitizes the field value in the term based on the context.
    16941694 *
    16951695 * Passing a term field value through the function should be assumed to have
     
    18731873
    18741874/**
    1875  * Count how many terms are in Taxonomy.
     1875 * Counts how many terms are in taxonomy.
    18761876 *
    18771877 * Default $args is 'hide_empty' which can be 'hide_empty=true' or array('hide_empty' => true).
     
    19231923
    19241924/**
    1925  * Will unlink the object from the taxonomy or taxonomies.
     1925 * Unlinks the object from the taxonomy or taxonomies.
    19261926 *
    19271927 * Will remove all relationships between the object and any terms in
     
    23112311
    23122312/**
    2313  * Add a new term to the database.
     2313 * Adds a new term to the database.
    23142314 *
    23152315 * A non-existent term is inserted in the following sequence:
     
    25602560     * Filters the duplicate term check that takes place during term creation.
    25612561     *
    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()
    25632563     * performs a last-minute confirmation of this uniqueness before allowing a new term
    25642564     * to be created. Plugins with different uniqueness requirements may use this filter
     
    27062706
    27072707/**
    2708  * Create Term and Taxonomy Relationships.
    2709  *
    2710  * Relates an object (post, link etc) to a term and taxonomy type. Creates the
     2708 * Creates term and taxonomy relationships.
     2709 *
     2710 * Relates an object (post, link, etc.) to a term and taxonomy type. Creates the
    27112711 * term and taxonomy relationship if it doesn't already exist. Creates a term if
    27122712 * it doesn't exist (using the slug).
     
    28902890
    28912891/**
    2892  * Add term(s) associated with a given object.
     2892 * Adds term(s) associated with a given object.
    28932893 *
    28942894 * @since 3.6.0
     
    29042904
    29052905/**
    2906  * Remove term(s) associated with a given object.
     2906 * Removes term(s) associated with a given object.
    29072907 *
    29082908 * @since 3.6.0
     
    29912991
    29922992/**
    2993  * Will make slug unique, if it isn't already.
     2993 * Makes term slug unique, if it isn't already.
    29942994 *
    29952995 * The `$slug` has to be unique global to every taxonomy, meaning that one
     
    30943094
    30953095/**
    3096  * Update term based on arguments provided.
     3096 * Updates term based on arguments provided.
    30973097 *
    30983098 * The `$args` will indiscriminately override all values with the same field name.
     
    32893289     * @since 2.9.0
    32903290     *
    3291      * @param int    $term_id  Term ID
     3291     * @param int    $term_id  Term ID.
    32923292     * @param string $taxonomy Taxonomy slug.
    32933293     */
     
    33983398
    33993399/**
    3400  * Enable or disable term counting.
     3400 * Enables or disables term counting.
    34013401 *
    34023402 * @since 2.5.0
     
    34653465
    34663466/**
    3467  * Perform term count update immediately.
     3467 * Performs term count update immediately.
    34683468 *
    34693469 * @since 2.5.0
     
    35523552
    35533553/**
    3554  * Will remove all of the term IDs from the cache.
     3554 * Removes all of the term IDs from the cache.
    35553555 *
    35563556 * @since 2.3.0
     
    36173617
    36183618/**
    3619  * Clean the caches for a taxonomy.
     3619 * Cleans the caches for a taxonomy.
    36203620 *
    36213621 * @since 4.9.0
     
    37783778
    37793779/**
    3780  * Updates Terms to Taxonomy in cache.
     3780 * Updates terms in cache.
    37813781 *
    37823782 * @since 2.3.0
     
    38043804
    38053805/**
    3806  * Retrieves children of taxonomy as Term IDs.
     3806 * Retrieves children of taxonomy as term IDs.
    38073807 *
    38083808 * @access private
     
    38103810 *
    38113811 * @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.
    38133813 */
    38143814function _get_term_hierarchy( $taxonomy ) {
     
    38423842
    38433843/**
    3844  * Get the subset of $terms that are descendants of $term_id.
     3844 * Gets the subset of $terms that are descendants of $term_id.
    38453845 *
    38463846 * If `$terms` is an array of objects, then _get_term_children() returns an array of objects.
     
    39183918
    39193919/**
    3920  * Add count of children to parent count.
     3920 * Adds count of children to parent count.
    39213921 *
    39223922 * Recalculates term counts by including items from child terms. Assumes all
     
    40254025
    40264026/**
    4027  * Will update term count based on object types of the current taxonomy.
     4027 * Updates term count based on object types of the current taxonomy.
    40284028 *
    40294029 * Private function for the default callback for post_tag and category
     
    40354035 * @global wpdb $wpdb WordPress database abstraction object.
    40364036 *
    4037  * @param int[]       $terms    List of Term taxonomy IDs.
     4037 * @param int[]       $terms    List of term taxonomy IDs.
    40384038 * @param WP_Taxonomy $taxonomy Current taxonomy object of terms.
    40394039 */
     
    40954095
    40964096/**
    4097  * Will update term count based on number of objects.
     4097 * Updates term count based on number of objects.
    40984098 *
    40994099 * Default callback for the 'link_category' taxonomy.
     
    41224122
    41234123/**
    4124  * Create a new term for a term_taxonomy item that currently shares its term
     4124 * Creates a new term for a term_taxonomy item that currently shares its term
    41254125 * with another term_taxonomy.
    41264126 *
     
    43694369/**
    43704370 * 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.
    43724372 *
    43734373 * @ignore
     
    43814381
    43824382/**
    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.
    43844384 *
    43854385 * @ignore
     
    44044404
    44054405/**
    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.
    44074407 *
    44084408 * @ignore
     
    44404440
    44414441/**
    4442  * If the term being split is a nav_menu, change associations.
     4442 * If the term being split is a nav_menu, changes associations.
    44434443 *
    44444444 * @ignore
     
    44664466
    44674467/**
    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.
    44694469 *
    44704470 * @since 4.2.0
     
    44854485
    44864486/**
    4487  * Get the new term ID corresponding to a previously split term.
     4487 * Gets the new term ID corresponding to a previously split term.
    44884488 *
    44894489 * @since 4.2.0
     
    45074507
    45084508/**
    4509  * Determine whether a term is shared between multiple taxonomies.
     4509 * Determines whether a term is shared between multiple taxonomies.
    45104510 *
    45114511 * Shared taxonomy terms began to be split in 4.3, but failed cron tasks or
     
    45314531
    45324532/**
    4533  * Generate a permalink for a taxonomy term archive.
     4533 * Generates a permalink for a taxonomy term archive.
    45344534 *
    45354535 * @since 2.5.0
     
    46454645
    46464646/**
    4647  * Display the taxonomies of a post with available options.
     4647 * Displays the taxonomies of a post with available options.
    46484648 *
    46494649 * This function can be used within the loop to display the taxonomies for a
     
    46774677
    46784678/**
    4679  * Retrieve all taxonomies associated with a post.
     4679 * Retrieves all taxonomies associated with a post.
    46804680 *
    46814681 * This function can be used within the loop. It will also return an array of
     
    47454745
    47464746/**
    4747  * Retrieve all taxonomy names for the given post.
     4747 * Retrieves all taxonomy names for the given post.
    47484748 *
    47494749 * @since 2.5.0
     
    47594759
    47604760/**
    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.
    47624762 *
    47634763 * The given terms are checked against the object's terms' term_ids, names and slugs.
     
    48344834
    48354835/**
    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.
    48374837 *
    48384838 * @since 3.0.0
     
    48514851
    48524852/**
    4853  * Get an array of ancestor IDs for a given object.
     4853 * Gets an array of ancestor IDs for a given object.
    48544854 *
    48554855 * @since 3.1.0
     
    49074907
    49084908/**
    4909  * Returns the term's parent's term_ID.
     4909 * Returns the term's parent's term ID.
    49104910 *
    49114911 * @since 3.1.0
Note: See TracChangeset for help on using the changeset viewer.