Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/10/2012 09:02:53 PM (12 years ago)
Author:
johnjamesjacoby
Message:

Remove unneeded globals and clean up some code in Messages component. See #3989.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-messages/bp-messages-filters.php

    r4825 r5696  
    11<?php
     2
     3/**
     4 * BuddyPress Messages Filters
     5 *
     6 * Apply WordPress defined filters to private messages
     7 *
     8 * @package BuddyPress
     9 * @subpackage MessagesFilters
     10 */
     11
    212// Exit if accessed directly
    313if ( !defined( 'ABSPATH' ) ) exit;
    414
    5 /* Apply WordPress defined filters */
    6 add_filter( 'bp_get_message_notice_subject', 'wp_filter_kses', 1 );
    7 add_filter( 'bp_get_message_notice_text', 'wp_filter_kses', 1 );
    8 add_filter( 'bp_get_message_thread_subject', 'wp_filter_kses', 1 );
    9 add_filter( 'bp_get_message_thread_excerpt', 'wp_filter_kses', 1 );
    10 add_filter( 'bp_get_messages_subject_value', 'wp_filter_kses', 1 );
    11 add_filter( 'bp_get_messages_content_value', 'wp_filter_kses', 1 );
    12 add_filter( 'bp_get_the_thread_message_content', 'wp_filter_kses', 1 );
     15add_filter( 'bp_get_message_notice_subject',        'wp_filter_kses', 1 );
     16add_filter( 'bp_get_message_notice_text',           'wp_filter_kses', 1 );
     17add_filter( 'bp_get_message_thread_subject',        'wp_filter_kses', 1 );
     18add_filter( 'bp_get_message_thread_excerpt',        'wp_filter_kses', 1 );
     19add_filter( 'bp_get_messages_subject_value',        'wp_filter_kses', 1 );
     20add_filter( 'bp_get_messages_content_value',        'wp_filter_kses', 1 );
     21add_filter( 'bp_get_the_thread_message_content',    'wp_filter_kses', 1 );
    1322
    1423add_filter( 'messages_message_content_before_save', 'wp_filter_kses', 1 );
    1524add_filter( 'messages_message_subject_before_save', 'wp_filter_kses', 1 );
    16 add_filter( 'messages_notice_message_before_save', 'wp_filter_kses', 1 );
    17 add_filter( 'messages_notice_subject_before_save', 'wp_filter_kses', 1 );
     25add_filter( 'messages_notice_message_before_save',  'wp_filter_kses', 1 );
     26add_filter( 'messages_notice_subject_before_save',  'wp_filter_kses', 1 );
    1827
    19 add_filter( 'bp_get_the_thread_message_content', 'wp_filter_kses', 1 );
    20 add_filter( 'bp_get_the_thread_subject', 'wp_filter_kses', 1 );
     28add_filter( 'bp_get_the_thread_message_content',    'wp_filter_kses', 1 );
     29add_filter( 'bp_get_the_thread_subject',            'wp_filter_kses', 1 );
    2130
    2231add_filter( 'messages_message_content_before_save', 'force_balance_tags' );
    2332add_filter( 'messages_message_subject_before_save', 'force_balance_tags' );
    24 add_filter( 'messages_notice_message_before_save', 'force_balance_tags' );
    25 add_filter( 'messages_notice_subject_before_save', 'force_balance_tags' );
     33add_filter( 'messages_notice_message_before_save',  'force_balance_tags' );
     34add_filter( 'messages_notice_subject_before_save',  'force_balance_tags' );
    2635
    27 add_filter( 'bp_get_message_notice_subject', 'wptexturize' );
    28 add_filter( 'bp_get_message_notice_text', 'wptexturize' );
    29 add_filter( 'bp_get_message_thread_subject', 'wptexturize' );
    30 add_filter( 'bp_get_message_thread_excerpt', 'wptexturize' );
     36add_filter( 'bp_get_message_notice_subject',     'wptexturize' );
     37add_filter( 'bp_get_message_notice_text',        'wptexturize' );
     38add_filter( 'bp_get_message_thread_subject',     'wptexturize' );
     39add_filter( 'bp_get_message_thread_excerpt',     'wptexturize' );
    3140add_filter( 'bp_get_the_thread_message_content', 'wptexturize' );
    3241
    33 add_filter( 'bp_get_message_notice_subject', 'convert_smilies', 2 );
    34 add_filter( 'bp_get_message_notice_text', 'convert_smilies', 2 );
    35 add_filter( 'bp_get_message_thread_subject', 'convert_smilies', 2 );
    36 add_filter( 'bp_get_message_thread_excerpt', 'convert_smilies', 2 );
     42add_filter( 'bp_get_message_notice_subject',     'convert_smilies', 2 );
     43add_filter( 'bp_get_message_notice_text',        'convert_smilies', 2 );
     44add_filter( 'bp_get_message_thread_subject',     'convert_smilies', 2 );
     45add_filter( 'bp_get_message_thread_excerpt',     'convert_smilies', 2 );
    3746add_filter( 'bp_get_the_thread_message_content', 'convert_smilies', 2 );
    3847
    39 add_filter( 'bp_get_message_notice_subject', 'convert_chars' );
    40 add_filter( 'bp_get_message_notice_text', 'convert_chars' );
    41 add_filter( 'bp_get_message_thread_subject', 'convert_chars' );
    42 add_filter( 'bp_get_message_thread_excerpt', 'convert_chars' );
     48add_filter( 'bp_get_message_notice_subject',     'convert_chars' );
     49add_filter( 'bp_get_message_notice_text',        'convert_chars' );
     50add_filter( 'bp_get_message_thread_subject',     'convert_chars' );
     51add_filter( 'bp_get_message_thread_excerpt',     'convert_chars' );
    4352add_filter( 'bp_get_the_thread_message_content', 'convert_chars' );
    4453
    45 add_filter( 'bp_get_message_notice_text', 'make_clickable', 9 );
    46 add_filter( 'bp_get_message_thread_excerpt', 'make_clickable', 9 );
     54add_filter( 'bp_get_message_notice_text',        'make_clickable', 9 );
     55add_filter( 'bp_get_message_thread_excerpt',     'make_clickable', 9 );
    4756add_filter( 'bp_get_the_thread_message_content', 'make_clickable', 9 );
    4857
    49 add_filter( 'bp_get_message_notice_text', 'wpautop' );
     58add_filter( 'bp_get_message_notice_text',        'wpautop' );
    5059add_filter( 'bp_get_the_thread_message_content', 'wpautop' );
    5160
    52 add_filter( 'bp_get_message_notice_subject', 'stripslashes_deep' );
    53 add_filter( 'bp_get_message_notice_text', 'stripslashes_deep' );
    54 add_filter( 'bp_get_message_thread_subject', 'stripslashes_deep' );
    55 add_filter( 'bp_get_message_thread_excerpt', 'stripslashes_deep' );
    56 add_filter( 'bp_get_messages_subject_value', 'stripslashes_deep' );
    57 add_filter( 'bp_get_messages_content_value', 'stripslashes_deep' );
     61add_filter( 'bp_get_message_notice_subject',     'stripslashes_deep' );
     62add_filter( 'bp_get_message_notice_text',        'stripslashes_deep' );
     63add_filter( 'bp_get_message_thread_subject',     'stripslashes_deep' );
     64add_filter( 'bp_get_message_thread_excerpt',     'stripslashes_deep' );
     65add_filter( 'bp_get_messages_subject_value',     'stripslashes_deep' );
     66add_filter( 'bp_get_messages_content_value',     'stripslashes_deep' );
    5867add_filter( 'bp_get_the_thread_message_content', 'stripslashes_deep' );
    59 
    60 add_filter( 'bp_get_the_thread_message_content', 'stripslashes_deep' );
    61 add_filter( 'bp_get_the_thread_subject', 'stripslashes_deep' );
     68add_filter( 'bp_get_the_thread_subject',         'stripslashes_deep' );
    6269
    6370?>
Note: See TracChangeset for help on using the changeset viewer.