Skip to:
Content

bbPress.org

Changeset 7250


Ignore:
Timestamp:
03/08/2022 08:44:02 PM (2 years ago)
Author:
johnjamesjacoby
Message:

Subscriptions: use topic title in Subject, instead of site name.

This change adds helpful context to email subjects and eliminates duplication between From & Subject mail headers.

Props dd32.

In branches/2.6, for 2.6.10.

Fixes #3446.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.6/src/includes/common/functions.php

    r7237 r7250  
    11401140
    11411141    // Strip tags from text and setup mail data
    1142     $blog_name         = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
     1142    $forum_title       = wp_specialchars_decode( strip_tags( bbp_get_forum_title( $forum_id ) ), ENT_QUOTES );
    11431143    $topic_title       = wp_specialchars_decode( strip_tags( bbp_get_topic_title( $topic_id ) ), ENT_QUOTES );
    11441144    $reply_author_name = wp_specialchars_decode( strip_tags( $reply_author_name ), ENT_QUOTES );
     
    11701170
    11711171    // For plugins to filter titles per reply/topic/user
    1172     $subject = apply_filters( 'bbp_subscription_mail_title', '[' . $blog_name . '] ' . $topic_title, $reply_id, $topic_id );
     1172    $subject = apply_filters( 'bbp_subscription_mail_title', '[' . $forum_title . '] ' . $topic_title, $reply_id, $topic_id );
    11731173    if ( empty( $subject ) ) {
    11741174        return;
     
    13071307
    13081308    // Strip tags from text and setup mail data
    1309     $blog_name         = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
     1309    $forum_title       = wp_specialchars_decode( strip_tags( bbp_get_forum_title( $forum_id ) ), ENT_QUOTES );
    13101310    $topic_title       = wp_specialchars_decode( strip_tags( bbp_get_topic_title( $topic_id ) ), ENT_QUOTES );
    13111311    $topic_author_name = wp_specialchars_decode( strip_tags( $topic_author_name ), ENT_QUOTES );
     
    13371337
    13381338    // For plugins to filter titles per reply/topic/user
    1339     $subject = apply_filters( 'bbp_forum_subscription_mail_title', '[' . $blog_name . '] ' . $topic_title, $topic_id, $forum_id, $user_id );
     1339    $subject = apply_filters( 'bbp_forum_subscription_mail_title', '[' . $forum_title . '] ' . $topic_title, $topic_id, $forum_id, $user_id );
    13401340    if ( empty( $subject ) ) {
    13411341        return;
Note: See TracChangeset for help on using the changeset viewer.