Changeset 47122 for trunk/src/wp-includes/taxonomy.php
- Timestamp:
- 01/29/2020 12:43:23 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r46985 r47122 8 8 9 9 // 10 // Taxonomy Registration10 // Taxonomy registration. 11 11 // 12 12 … … 681 681 682 682 // 683 // Term API 683 // Term API. 684 684 // 685 685 … … 978 978 $term = array_shift( $terms ); 979 979 980 // In the case of 'term_taxonomy_id', override the provided `$taxonomy` with whatever we find in the db.980 // In the case of 'term_taxonomy_id', override the provided `$taxonomy` with whatever we find in the DB. 981 981 if ( 'term_taxonomy_id' === $field ) { 982 982 $taxonomy = $term->taxonomy; … … 1596 1596 $value = apply_filters( "pre_{$taxonomy}_{$field}", $value ); 1597 1597 1598 // Back compat filters 1598 // Back compat filters. 1599 1599 if ( 'slug' === $field ) { 1600 1600 /** … … 1693 1693 $args = wp_parse_args( $args, $defaults ); 1694 1694 1695 // backward compatibility1695 // Backward compatibility. 1696 1696 if ( isset( $args['ignore_empty'] ) ) { 1697 1697 $args['hide_empty'] = $args['ignore_empty']; … … 1777 1777 $defaults['default'] = (int) get_option( 'default_category' ); 1778 1778 if ( $defaults['default'] === $term ) { 1779 return 0; // Don't delete the default category 1779 return 0; // Don't delete the default category. 1780 1780 } 1781 1781 } … … 1804 1804 do_action( 'pre_delete_term', $term, $taxonomy ); 1805 1805 1806 // Update children to point to new parent 1806 // Update children to point to new parent. 1807 1807 if ( is_taxonomy_hierarchical( $taxonomy ) ) { 1808 1808 $term_obj = get_term( $term, $taxonomy ); … … 2270 2270 $term_id = (int) $wpdb->insert_id; 2271 2271 2272 // Seems unreachable , However, Is used in the case that a term name is provided, which sanitizes to an empty string.2272 // Seems unreachable. However, is used in the case that a term name is provided, which sanitizes to an empty string. 2273 2273 if ( empty( $slug ) ) { 2274 2274 $slug = sanitize_title( $slug, $term_id ); … … 2818 2818 $term_id = (int) $term_id; 2819 2819 2820 // First, get all of the original args 2820 // First, get all of the original args. 2821 2821 $term = get_term( $term_id, $taxonomy ); 2822 2822 … … 2912 2912 $parent = (int) apply_filters( 'wp_update_term_parent', $args['parent'], $term_id, $taxonomy, $parsed_args, $args ); 2913 2913 2914 // Check for duplicate slug 2914 // Check for duplicate slug. 2915 2915 $duplicate = get_term_by( 'slug', $slug, $taxonomy ); 2916 2916 if ( $duplicate && $duplicate->term_id !== $term_id ) { … … 3069 3069 if ( is_bool( $defer ) ) { 3070 3070 $_defer = $defer; 3071 // flush any deferred counts3071 // Flush any deferred counts. 3072 3072 if ( ! $defer ) { 3073 3073 wp_update_term_count( null, null, true ); … … 3149 3149 3150 3150 if ( $object_types == array_filter( $object_types, 'post_type_exists' ) ) { 3151 // Only post types are attached to this taxonomy 3151 // Only post types are attached to this taxonomy. 3152 3152 _update_post_term_count( $terms, $taxonomy ); 3153 3153 } else { 3154 // Default count updater 3154 // Default count updater. 3155 3155 _update_generic_term_count( $terms, $taxonomy ); 3156 3156 } … … 3163 3163 3164 3164 // 3165 // Cache 3165 // Cache. 3166 3166 // 3167 3167 … … 3453 3453 3454 3454 // 3455 // Private 3455 // Private. 3456 3456 // 3457 3457 … … 3670 3670 3671 3671 // 3672 // Default callbacks 3672 // Default callbacks. 3673 3673 // 3674 3674 … … 4238 4238 $termlink = home_url( user_trailingslashit( $termlink, 'category' ) ); 4239 4239 } 4240 // Back Compat filters. 4240 4241 // Back compat filters. 4241 4242 if ( 'post_tag' === $taxonomy ) { 4242 4243 … … 4570 4571 */ 4571 4572 function wp_check_term_hierarchy_for_loops( $parent, $term_id, $taxonomy ) { 4572 // Nothing fancy here - bail 4573 // Nothing fancy here - bail. 4573 4574 if ( ! $parent ) { 4574 4575 return 0; … … 4583 4584 $loop = wp_find_hierarchy_loop( 'wp_get_term_taxonomy_parent_id', $term_id, $parent, array( $taxonomy ) ); 4584 4585 if ( ! $loop ) { 4585 return $parent; // No loop 4586 return $parent; // No loop. 4586 4587 } 4587 4588
Note: See TracChangeset
for help on using the changeset viewer.