Ticket #26080: 26080.diff
File 26080.diff, 1.0 KB (added by , 11 years ago) |
---|
-
wp-content/themes/twentyfourteen/inc/featured-content.php
427 427 if ( empty( $input['tag-name'] ) ) { 428 428 $output['tag-id'] = 0; 429 429 } else { 430 $new_tag = wp_create_tag( $input['tag-name'] ); 431 if ( ! is_wp_error( $new_tag ) && isset( $new_tag['term_id'] ) ) { 432 $output['tag-id'] = $new_tag['term_id']; 430 $term = get_term_by( 'name', $input['tag-name'], 'post_tag' ); 431 432 if ( $term ) { 433 $output['tag-id'] = $term->term_id; 433 434 } else { 434 $term = get_term_by( 'name', $input['tag-name'], 'post_tag' ); 435 $output['tag-id'] = $term ? $term->term_id : 0; 435 $new_tag = wp_create_tag( $input['tag-name'] ); 436 437 if ( ! is_wp_error( $new_tag ) && isset( $new_tag['term_id'] ) ) { 438 $output['tag-id'] = $new_tag['term_id']; 439 } 436 440 } 441 437 442 $output['tag-name'] = $input['tag-name']; 438 443 } 439 444