Skip to:
Content

bbPress.org


Ignore:
Timestamp:
03/17/2017 05:57:33 PM (6 years ago)
Author:
johnjamesjacoby
Message:

Mentions: Move topic/reply content filters into the same section of filters.php.

Also add wp_make_content_images_responsive filter, to match core content areas.

See #2963.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/core/filters.php

    r6380 r6381  
    163163add_filter( 'bbp_get_topic_content', 'bbp_rel_nofollow',   60 );
    164164
     165// Admin-only
     166if ( is_admin() ) {
     167
     168    // Run wp_kses_data on topic/reply content in admin section
     169    add_filter( 'bbp_get_reply_content', 'bbp_kses_data' );
     170    add_filter( 'bbp_get_topic_content', 'bbp_kses_data' );
     171
     172// Filters outside of wp-admin
     173} else {
     174
     175    // Responsive images
     176    add_filter( 'bbp_get_reply_content', 'wp_make_content_images_responsive', 60 );
     177    add_filter( 'bbp_get_topic_content', 'wp_make_content_images_responsive', 60 );
     178
     179    // Revisions
     180    add_filter( 'bbp_get_reply_content', 'bbp_reply_content_append_revisions',  99,  2 );
     181    add_filter( 'bbp_get_topic_content', 'bbp_topic_content_append_revisions',  99,  2 );
     182}
     183
    165184// Form textarea output - undo the code-trick done pre-save, and sanitize
    166185add_filter( 'bbp_get_form_forum_content', 'bbp_code_trick_reverse' );
     
    228247add_filter( 'bbp_get_displayed_user_field', 'bbp_sanitize_displayed_user_field', 10, 3 );
    229248
    230 // Run wp_kses_data on topic/reply content in admin section
    231 if ( is_admin() ) {
    232     add_filter( 'bbp_get_reply_content', 'bbp_kses_data' );
    233     add_filter( 'bbp_get_topic_content', 'bbp_kses_data' );
    234 
    235 // Revisions (only when not in admin)
    236 } else {
    237     add_filter( 'bbp_get_reply_content', 'bbp_reply_content_append_revisions',  99,  2 );
    238     add_filter( 'bbp_get_topic_content', 'bbp_topic_content_append_revisions',  99,  2 );
    239 }
    240 
    241249// Suppress private forum details
    242250add_filter( 'bbp_get_forum_topic_count',    'bbp_suppress_private_forum_meta',  10, 2 );
Note: See TracChangeset for help on using the changeset viewer.