Changeset 8620 for sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-directory-compat.php
- Timestamp:
- 04/10/2019 05:20:19 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
r8617 r8620 290 290 $this->term = get_term_by( 'slug', $this->slug(), $this->taxonomy() ); 291 291 292 // New compats won't have any support topics or reviews, so will 293 // not yet exist as a compat term. 294 if ( ! $this->term && $this->get_object( $this->slug() ) ) { 295 $term = wp_insert_term( $this->slug(), $this->taxonomy() ); 296 $this->term = get_term( $term['term_id'] ); 297 } 298 292 299 // Add plugin- and theme-specific filters and actions. 293 300 add_action( 'wporg_compat_view_sidebar', array( $this, 'do_view_sidebar' ) ); … … 742 749 743 750 $term_subscription = ''; 744 $term = $this->term; 745 if ( ! $term ) { 751 if ( ! $this->term && $this->get_object( $this->slug() ) ) { 746 752 // New compats won't have any support topics or reviews, so will 747 753 // not yet exist as a compat term. 748 754 $term = wp_insert_term( $this->slug(), $this->taxonomy() ); 749 $term = get_term( $term['term_id'] ); 750 } 751 if ( $term ) { 752 $this->term = $term; 755 $this->term = get_term( $term['term_id'] ); 756 } 757 if ( $this->term ) { 753 758 $subscribe = $unsubscribe = ''; 754 759 if ( 'plugin' == $this->compat() ) { … … 760 765 } 761 766 $term_subscription = Term_Subscription\Plugin::get_subscription_link( array( 762 'term_id' => $t erm->term_id,767 'term_id' => $this->term->term_id, 763 768 'taxonomy' => $this->taxonomy(), 764 769 'subscribe' => $subscribe,
Note: See TracChangeset
for help on using the changeset viewer.