Changeset 8634
- Timestamp:
- 04/12/2019 07:09:13 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-directory-compat.php
r8620 r8634 294 294 if ( ! $this->term && $this->get_object( $this->slug() ) ) { 295 295 $term = wp_insert_term( $this->slug(), $this->taxonomy() ); 296 $this->term = get_term( $term['term_id'] ); 296 297 // Term exists already? Race-condition, or get_term_by() couldn't find $slug.. 298 if ( is_wp_error( $term ) && $term->get_error_data( 'term_exists' ) ) { 299 $this->term = get_term( $term->get_error_data( 'term_exists' ) ); 300 } elseif ( isset( $term['term_id'] ) ) { 301 $this->term = get_term( $term['term_id'] ); 302 } 297 303 } 298 304 … … 749 755 750 756 $term_subscription = ''; 751 if ( ! $this->term && $this->get_object( $this->slug() ) ) {752 // New compats won't have any support topics or reviews, so will753 // not yet exist as a compat term.754 $term = wp_insert_term( $this->slug(), $this->taxonomy() );755 $this->term = get_term( $term['term_id'] );756 }757 757 if ( $this->term ) { 758 758 $subscribe = $unsubscribe = '';
Note: See TracChangeset
for help on using the changeset viewer.