- Timestamp:
- 11/19/2013 03:26:56 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyfourteen/inc/featured-content.php
r26260 r26270 449 449 $output['tag-id'] = 0; 450 450 } else { 451 $new_tag = wp_create_tag( $input['tag-name'] ); 452 if ( ! is_wp_error( $new_tag ) && isset( $new_tag['term_id'] ) ) { 453 $output['tag-id'] = $new_tag['term_id']; 451 $term = get_term_by( 'name', $input['tag-name'], 'post_tag' ); 452 453 if ( $term ) { 454 $output['tag-id'] = $term->term_id; 454 455 } else { 455 $term = get_term_by( 'name', $input['tag-name'], 'post_tag' ); 456 $output['tag-id'] = $term ? $term->term_id : 0; 456 $new_tag = wp_create_tag( $input['tag-name'] ); 457 458 if ( ! is_wp_error( $new_tag ) && isset( $new_tag['term_id'] ) ) { 459 $output['tag-id'] = $new_tag['term_id']; 460 } 457 461 } 462 458 463 $output['tag-name'] = $input['tag-name']; 459 464 }
Note: See TracChangeset
for help on using the changeset viewer.