Skip to:
Content

bbPress.org

Changeset 6614


Ignore:
Timestamp:
07/04/2017 04:09:35 PM (4 years ago)
Author:
johnjamesjacoby
Message:

Subscriptions: Use bbp_remove_all_filters() with restore option.

This change uses the bbPress version of remove_all_filters() which allows those filters to be restored. We need to restore filters after emails are sent so that template titles & content render correctly within their respective templates.

See #6613.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/common/functions.php

    r6613 r6614  
    10811081    // Remove filters from reply content and topic title to prevent content
    10821082    // from being encoded with HTML entities, wrapped in paragraph tags, etc...
    1083     remove_all_filters( 'bbp_get_reply_content' );
    1084     remove_all_filters( 'bbp_get_topic_title'   );
    1085     remove_all_filters( 'the_title'             );
     1083    bbp_remove_all_filters( 'bbp_get_reply_content' );
     1084    bbp_remove_all_filters( 'bbp_get_topic_title'   );
     1085    bbp_remove_all_filters( 'the_title'             );
    10861086
    10871087    // Strip tags from text and setup mail data
     
    11481148
    11491149    do_action( 'bbp_post_notify_subscribers', $reply_id, $topic_id, $user_ids );
     1150
     1151    // Restore previously removed filters
     1152    bbp_restore_all_filters( 'bbp_get_topic_content' );
     1153    bbp_restore_all_filters( 'bbp_get_topic_title'   );
     1154    bbp_restore_all_filters( 'the_title'             );
    11501155
    11511156    return true;
     
    12291234    // Remove filters from reply content and topic title to prevent content
    12301235    // from being encoded with HTML entities, wrapped in paragraph tags, etc...
    1231     remove_all_filters( 'bbp_get_topic_content' );
    1232     remove_all_filters( 'bbp_get_topic_title'   );
    1233     remove_all_filters( 'the_title'             );
     1236    bbp_remove_all_filters( 'bbp_get_topic_content' );
     1237    bbp_remove_all_filters( 'bbp_get_topic_title'   );
     1238    bbp_remove_all_filters( 'the_title'             );
    12341239
    12351240    // Strip tags from text and setup mail data
     
    12961301
    12971302    do_action( 'bbp_post_notify_forum_subscribers', $topic_id, $forum_id, $user_ids );
     1303
     1304    // Restore previously removed filters
     1305    bbp_restore_all_filters( 'bbp_get_topic_content' );
     1306    bbp_restore_all_filters( 'bbp_get_topic_title'   );
     1307    bbp_restore_all_filters( 'the_title'             );
    12981308
    12991309    return true;
Note: See TracChangeset for help on using the changeset viewer.