diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index ac73242b5c..2c63e23b27 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -264,26 +264,26 @@ function get_taxonomies( $args = array(), $output = 'names', $operator = 'and' ) * * @global WP_Taxonomy[] $wp_taxonomies The registered taxonomies. * - * @param string|string[]|WP_Post $object Name of the type of taxonomy object, or an object (row from posts) - * @param string $output Optional. The type of output to return in the array. Accepts either - * 'names' or 'objects'. Default 'names'. + * @param string|string[]|WP_Post $object_type Name of the type of taxonomy object, or an object (row from posts). + * @param string $output Optional. The type of output to return in the array. Accepts either + * 'names' or 'objects'. Default 'names'. * @return string[]|WP_Taxonomy[] The names or objects of all taxonomies of `$object_type`. */ -function get_object_taxonomies( $object, $output = 'names' ) { +function get_object_taxonomies( $object_type, $output = 'names' ) { global $wp_taxonomies; - if ( is_object( $object ) ) { - if ( 'attachment' === $object->post_type ) { - return get_attachment_taxonomies( $object, $output ); + if ( is_object( $object_type ) ) { + if ( 'attachment' === $object_type->post_type ) { + return get_attachment_taxonomies( $object_type, $output ); } - $object = $object->post_type; + $object_type = $object_type->post_type; } - $object = (array) $object; + $object_type = (array) $object_type; $taxonomies = array(); foreach ( (array) $wp_taxonomies as $tax_name => $tax_obj ) { - if ( array_intersect( $object, (array) $tax_obj->object_type ) ) { + if ( array_intersect( $object_type, (array) $tax_obj->object_type ) ) { if ( 'names' === $output ) { $taxonomies[] = $tax_name; } else { @@ -1497,15 +1497,15 @@ function unregister_term_meta( $taxonomy, $meta_key ) { * * @global bool $_wp_suspend_cache_invalidation * - * @param int|string $term The term to check. Accepts term ID, slug, or name. - * @param string $taxonomy Optional. The taxonomy name to use. - * @param int $parent Optional. ID of parent term under which to confine the exists search. + * @param int|string $term The term to check. Accepts term ID, slug, or name. + * @param string $taxonomy Optional. The taxonomy name to use. + * @param int $parent_term Optional. ID of parent term under which to confine the exists search. * @return mixed Returns null if the term does not exist. * Returns the term ID if no taxonomy is specified and the term ID exists. * Returns an array of the term ID and the term taxonomy ID if the taxonomy is specified and the pairing exists. * Returns 0 if term ID 0 is passed to the function. */ -function term_exists( $term, $taxonomy = '', $parent = null ) { +function term_exists( $term, $taxonomy = '', $parent_term = null ) { global $_wp_suspend_cache_invalidation; if ( null === $term ) { @@ -1538,14 +1538,14 @@ function term_exists( $term, $taxonomy = '', $parent = null ) { * * @since 6.0.0 * - * @param array $defaults An array of arguments passed to get_terms(). - * @param int|string $term The term to check. Accepts term ID, slug, or name. - * @param string $taxonomy The taxonomy name to use. An empty string indicates - * the search is against all taxonomies. - * @param int|null $parent ID of parent term under which to confine the exists search. - * Null indicates the search is unconfined. + * @param array $defaults An array of arguments passed to get_terms(). + * @param int|string $term The term to check. Accepts term ID, slug, or name. + * @param string $taxonomy The taxonomy name to use. An empty string indicates + * the search is against all taxonomies. + * @param int|null $parent_term ID of parent term under which to confine the exists search. + * Null indicates the search is unconfined. */ - $defaults = apply_filters( 'term_exists_default_query_args', $defaults, $term, $taxonomy, $parent ); + $defaults = apply_filters( 'term_exists_default_query_args', $defaults, $term, $taxonomy, $parent_term ); if ( is_int( $term ) ) { if ( 0 === $term ) { @@ -1559,8 +1559,8 @@ function term_exists( $term, $taxonomy = '', $parent = null ) { return null; } - if ( ! empty( $taxonomy ) && is_numeric( $parent ) ) { - $defaults['parent'] = (int) $parent; + if ( ! empty( $taxonomy ) && is_numeric( $parent_term ) ) { + $defaults['parent'] = (int) $parent_term; } $args = wp_parse_args( array( 'slug' => sanitize_title( $term ) ), $defaults ); @@ -3214,7 +3214,7 @@ function wp_update_term( $term_id, $taxonomy, $args = array() ) { * * @since 3.1.0 * - * @param int $parent ID of the parent term. + * @param int $parent_term ID of the parent term. * @param int $term_id Term ID. * @param string $taxonomy Taxonomy slug. * @param array $parsed_args An array of potentially altered update arguments for the given term. @@ -4940,29 +4940,29 @@ function wp_get_term_taxonomy_parent_id( $term_id, $taxonomy ) { * * @since 3.1.0 * - * @param int $parent `term_id` of the parent for the term we're checking. - * @param int $term_id The term we're checking. - * @param string $taxonomy The taxonomy of the term we're checking. + * @param int $parent_term `term_id` of the parent for the term we're checking. + * @param int $term_id The term we're checking. + * @param string $taxonomy The taxonomy of the term we're checking. * @return int The new parent for the term. */ -function wp_check_term_hierarchy_for_loops( $parent, $term_id, $taxonomy ) { +function wp_check_term_hierarchy_for_loops( $parent_term, $term_id, $taxonomy ) { // Nothing fancy here - bail. - if ( ! $parent ) { + if ( ! $parent_term ) { return 0; } // Can't be its own parent. - if ( $parent === $term_id ) { + if ( $parent_term === $term_id ) { return 0; } // Now look for larger loops. - $loop = wp_find_hierarchy_loop( 'wp_get_term_taxonomy_parent_id', $term_id, $parent, array( $taxonomy ) ); + $loop = wp_find_hierarchy_loop( 'wp_get_term_taxonomy_parent_id', $term_id, $parent_term, array( $taxonomy ) ); if ( ! $loop ) { - return $parent; // No loop. + return $parent_term; // No loop. } - // Setting $parent to the given value causes a loop. + // Setting $parent_term to the given value causes a loop. if ( isset( $loop[ $term_id ] ) ) { return 0; } @@ -4972,7 +4972,7 @@ function wp_check_term_hierarchy_for_loops( $parent, $term_id, $taxonomy ) { wp_update_term( $loop_member, $taxonomy, array( 'parent' => 0 ) ); } - return $parent; + return $parent_term; } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 2bd3b7cf82..55c068a1bd 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.2-alpha-55010'; +$wp_version = '6.2-alpha-55011'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.