Changeset 28461
- Timestamp:
- 05/16/2014 09:28:05 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r28441 r28461 2889 2889 $args = wp_parse_args($args, $defaults); 2890 2890 $args = sanitize_term($args, $taxonomy, 'db'); 2891 extract($args, EXTR_SKIP);2891 $parsed_args = $args; 2892 2892 2893 2893 // expected_slashed ($name) 2894 $name = wp_unslash($name); 2895 $description = wp_unslash($description); 2894 $name = wp_unslash( $args['name'] ); 2895 $description = wp_unslash( $args['description'] ); 2896 2897 $parsed_args['name'] = $name; 2898 $parsed_args['description'] = $description; 2896 2899 2897 2900 if ( '' == trim($name) ) … … 2899 2902 2900 2903 $empty_slug = false; 2901 if ( empty( $slug) ) {2904 if ( empty( $args['slug'] ) ) { 2902 2905 $empty_slug = true; 2903 2906 $slug = sanitize_title($name); 2904 } 2905 2906 if ( $alias_of ) { 2907 $alias = $wpdb->get_row( $wpdb->prepare( "SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $alias_of) ); 2907 } else { 2908 $slug = $args['slug']; 2909 } 2910 2911 $parsed_args['slug'] = $slug; 2912 2913 if ( $args['alias_of'] ) { 2914 $alias = $wpdb->get_row( $wpdb->prepare( "SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $args['alias_of'] ) ); 2908 2915 if ( $alias->term_group ) { 2909 2916 // The alias we want is already in a group, so let's use that one. … … 2920 2927 do_action( 'edited_terms', $alias->term_id, $taxonomy ); 2921 2928 } 2929 2930 $parsed_args['term_group'] = $term_group; 2922 2931 } 2923 2932 … … 2929 2938 * @since 3.1.0 2930 2939 * 2931 * @param int $parent ID of the parent term.2932 * @param int $term_id Term ID.2933 * @param string $taxonomy Taxonomy slug.2934 * @param array $ args Compacted array ofupdate arguments for the given term.2935 * @param array $args An array of update arguments for the given term.2940 * @param int $parent ID of the parent term. 2941 * @param int $term_id Term ID. 2942 * @param string $taxonomy Taxonomy slug. 2943 * @param array $parsed_args An array of potentially altered update arguments for the given term. 2944 * @param array $args An array of update arguments for the given term. 2936 2945 */ 2937 $parent = apply_filters( 'wp_update_term_parent', $ parent, $term_id, $taxonomy, compact( array_keys( $args ) ), $args );2946 $parent = apply_filters( 'wp_update_term_parent', $args['parent'], $term_id, $taxonomy, $parsed_args, $args ); 2938 2947 2939 2948 // Check for duplicate slug
Note: See TracChangeset
for help on using the changeset viewer.