Changeset 11528
- Timestamp:
- 02/08/2022 05:20:50 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/inc/class-plugin.php
r10673 r11528 57 57 add_action( 'bbp_new_reply', array( $this, 'notify_term_subscribers_of_new_reply' ), 10, 5 ); 58 58 59 // Replace the title of subscription emails with the term-specific prefix. 60 // This applies to all notification emails sent related to the topic, not just the term-specific emails. 61 add_filter( 'bbp_forum_subscription_mail_title', array( $this, 'replace_forum_subscription_mail_title' ), 10, 2 ); 62 add_filter( 'bbp_subscription_mail_title', array( $this, 'replace_topic_subscription_mail_title' ), 10, 3 ); 63 59 64 add_action( 'bbp_template_after_user_subscriptions', array( $this, 'user_subscriptions' ) ); 65 60 66 } 61 67 … … 188 194 // Replace forum-specific messaging with term subscription messaging. 189 195 add_filter( 'bbp_forum_subscription_mail_message', array( $this, 'replace_forum_subscription_mail_message' ), 10, 4 ); 190 add_filter( 'bbp_forum_subscription_mail_title', array( $this, 'replace_forum_subscription_mail_title' ), 10, 2 );191 196 192 197 // Replace forum subscriber list with term subscribers, avoiding duplicates. … … 199 204 remove_filter( 'bbp_forum_subscription_user_ids', array( $this, 'add_term_subscribers_to_forum' ) ); 200 205 remove_filter( 'bbp_forum_subscription_mail_message', array( $this, 'replace_forum_subscription_mail_message' ), 10 ); 201 remove_filter( 'bbp_forum_subscription_mail_title', array( $this, 'replace_forum_subscription_mail_title' ) );202 206 203 207 } … … 256 260 */ 257 261 public function replace_forum_subscription_mail_title( $title, $topic_id ) { 262 $terms = get_the_terms( $topic_id, $this->taxonomy ); 263 if ( ! $terms ) { 264 return $title; 265 } 266 258 267 if ( $this->directory && $this->directory->title() ) { 259 268 $blog_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); … … 306 315 // Replace topic-specific messaging with term subscription messaging. 307 316 add_filter( 'bbp_subscription_mail_message', array( $this, 'replace_topic_subscription_mail_message' ), 10, 3 ); 308 add_filter( 'bbp_subscription_mail_title', array( $this, 'replace_topic_subscription_mail_title' ), 10, 3 );309 317 310 318 // Replace forum subscriber list with term subscribers, avoiding duplicates. … … 317 325 remove_filter( 'bbp_topic_subscription_user_ids', array( $this, 'add_term_subscribers_to_topic' ) ); 318 326 remove_filter( 'bbp_subscription_mail_message', array( $this, 'replace_topic_subscription_mail_message' ) ); 319 remove_filter( 'bbp_subscription_mail_title', array( $this, 'replace_topic_subscription_mail_title' ) );320 327 } 321 328 … … 373 380 */ 374 381 public function replace_topic_subscription_mail_title( $title, $reply_id, $topic_id ) { 382 $terms = get_the_terms( $topic_id, $this->taxonomy ); 383 if ( ! $terms ) { 384 return $title; 385 } 386 375 387 if ( $this->directory && $this->directory->title() ) { 376 388 $blog_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
Note: See TracChangeset
for help on using the changeset viewer.