Changeset 12410
- Timestamp:
- 02/21/2023 05:48:06 AM (20 months ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-directory-compat.php
r12347 r12410 19 19 abstract protected function name(); 20 20 abstract protected function parse_query(); 21 abstract protected function for_slug( $slug ); 21 22 abstract protected function do_view_sidebar(); 22 23 abstract protected function do_topic_sidebar(); … … 68 69 69 70 } 71 } 72 73 /** 74 * Maybe load the data for this compat directory class. 75 * 76 * @param int $topic_id The topic ID that we should initialize in the context of. 77 */ 78 public function init_for_topic( $topic_id ) { 79 $forum_id = bbp_get_topic_forum_id( $topic_id ); 80 if ( $forum_id != $this->forum_id() ) { 81 return; 82 } 83 84 $terms = get_the_terms( $topic_id, $this->taxonomy() ); 85 if ( ! $terms ) { 86 return; 87 } 88 89 $this->for_slug( $terms[0]->slug ); 70 90 } 71 91 … … 828 848 // Note: Not using $this->title() here so as to filter other terms of this taxonomy correctly. 829 849 830 $term->name = $this->get_object( $term->slug )->post_title ?? $term->name; 850 if ( ! is_admin() ) { 851 $term->name = $this->get_object( $term->slug )->post_title ?? $term->name; 852 } 831 853 832 854 return $term; -
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-emails.php
r12273 r12410 169 169 $topic_author = bbp_get_topic_author_id( $topic_id ); 170 170 171 // Setup the forum compat classes, as used by email filters for subject changes. 172 $forums = Plugin::get_instance(); 173 if ( $forums->plugins ) { 174 $forums->plugins->init_for_topic( $topic_id ); 175 $forums->themes->init_for_topic( $topic_id ); 176 } 177 171 178 // For performance reasons, we've removed the bbPress bbp_update_topic() method, and replaced it with our slightly altered variant. 172 179 $bbp_update_topic = [ Plugin::get_instance()->dropin, 'bbp_update_topic' ]; … … 203 210 } 204 211 212 // Setup the forum compat classes, as used by email filters for subject changes. 213 $forums = Plugin::get_instance(); 214 if ( $forums->plugins ) { 215 $forums->plugins->init_for_topic( $topic_id ); 216 $forums->themes->init_for_topic( $topic_id ); 217 } 218 205 219 // For performance reasons, we've removed the bbPress bbp_update_reply() method, and replaced it with our slightly altered variant. 206 220 $bbp_update_reply = [ Plugin::get_instance()->dropin, 'bbp_update_reply' ]; -
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-plugin-directory-compat.php
r11563 r12410 91 91 } 92 92 93 if ( ! $this->for_slug( $slug ) ) { 94 status_header( 404 ); 95 } 96 } 97 98 /** 99 * Set the directory instance to the slugs data. 100 * 101 * @param string $slug The plugin slug. 102 */ 103 public function for_slug( $slug ) { 93 104 $plugin = $this->get_object( $slug ); 94 105 if ( ! $plugin ) { 95 status_header( 404 ); 96 return; 106 return false; 97 107 } 98 108 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-theme-directory-compat.php
r10819 r12410 91 91 } 92 92 93 if ( ! $this->for_slug( $slug ) ) { 94 status_header( 404 ); 95 } 96 } 97 98 /** 99 * Set the directory instance to the slugs data. 100 * 101 * @param string $slug The theme slug. 102 */ 103 public function for_slug( $slug ) { 93 104 $theme = $this->get_object( $slug ); 94 105 if ( ! $theme ) { 95 status_header( 404 ); 96 return; 106 return false; 97 107 } 98 108
Note: See TracChangeset
for help on using the changeset viewer.