Changeset 28561 for trunk/src/wp-admin/includes/taxonomy.php
- Timestamp:
- 05/23/2014 07:28:45 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/taxonomy.php
r28500 r28561 235 235 return false; 236 236 237 $tags = wp_get_post_terms($post_id, $taxonomy, array()); 238 239 if ( !$tags ) { 237 $terms = get_object_term_cache( $post_id, $taxonomy ); 238 if ( false === $terms ) { 239 $terms = wp_get_object_terms( $post_id, $taxonomy ); 240 wp_cache_add( $post_id, $terms, $taxonomy . '_relationships' ); 241 } 242 243 if ( ! $terms ) { 240 244 return false; 241 245 } 242 if ( is_wp_error( $tags) ) {243 return $t ags;244 } 245 $t ag_names = array();246 foreach ( $t ags as $tag) {247 $t ag_names[] = $tag->name;248 } 249 250 $t ags_to_edit = esc_attr( join( ',', $tag_names ) );246 if ( is_wp_error( $terms ) ) { 247 return $terms; 248 } 249 $term_names = array(); 250 foreach ( $terms as $term ) { 251 $term_names[] = $term->name; 252 } 253 254 $terms_to_edit = esc_attr( join( ',', $term_names ) ); 251 255 252 256 /** … … 257 261 * @see get_terms_to_edit() 258 262 * 259 * @param array $t ags_to_edit An array of terms.263 * @param array $terms_to_edit An array of terms. 260 264 * @param string $taxonomy The taxonomy for which to retrieve terms. Default 'post_tag'. 261 265 */ 262 $t ags_to_edit = apply_filters( 'terms_to_edit', $tags_to_edit, $taxonomy );263 264 return $t ags_to_edit;266 $terms_to_edit = apply_filters( 'terms_to_edit', $terms_to_edit, $taxonomy ); 267 268 return $terms_to_edit; 265 269 } 266 270
Note: See TracChangeset
for help on using the changeset viewer.