Changeset 4866 for trunk/includes/core/filters.php
- Timestamp:
- 04/26/2013 11:00:38 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/core/filters.php
r4780 r4866 84 84 85 85 // Links 86 add_filter( 'paginate_links', 87 add_filter( 'bbp_get_topic_permalink', 88 add_filter( 'bbp_get_reply_permalink', 89 add_filter( 'bbp_get_forum_permalink', 86 add_filter( 'paginate_links', 'bbp_add_view_all' ); 87 add_filter( 'bbp_get_topic_permalink', 'bbp_add_view_all' ); 88 add_filter( 'bbp_get_reply_permalink', 'bbp_add_view_all' ); 89 add_filter( 'bbp_get_forum_permalink', 'bbp_add_view_all' ); 90 90 91 91 // wp_filter_kses on new/edit topic/reply title 92 add_filter( 'bbp_new_reply_pre_title', 'wp_filter_kses' ); 93 add_filter( 'bbp_new_topic_pre_title', 'wp_filter_kses' ); 94 add_filter( 'bbp_edit_reply_pre_title', 'wp_filter_kses' ); 95 add_filter( 'bbp_edit_topic_pre_title', 'wp_filter_kses' ); 96 97 // Code filters on output (hooked in early for plugin compatibility) 98 add_filter( 'bbp_get_reply_content', 'bbp_code_trick', 3 ); 99 add_filter( 'bbp_get_topic_content', 'bbp_code_trick', 3 ); 100 101 // Code filters on input 102 add_filter( 'bbp_new_reply_pre_content', 'bbp_code_trick_reverse' ); 103 add_filter( 'bbp_edit_reply_pre_content', 'bbp_code_trick_reverse' ); 104 add_filter( 'bbp_new_topic_pre_content', 'bbp_code_trick_reverse' ); 105 add_filter( 'bbp_edit_topic_pre_content', 'bbp_code_trick_reverse' ); 106 107 // balanceTags, wp_filter_kses and wp_rel_nofollow on new/edit topic/reply text 108 add_filter( 'bbp_new_reply_pre_content', 'wp_rel_nofollow' ); 109 add_filter( 'bbp_new_reply_pre_content', 'bbp_filter_kses' ); 110 add_filter( 'bbp_new_reply_pre_content', 'balanceTags', 50 ); 111 add_filter( 'bbp_new_topic_pre_content', 'wp_rel_nofollow' ); 112 add_filter( 'bbp_new_topic_pre_content', 'bbp_filter_kses' ); 113 add_filter( 'bbp_new_topic_pre_content', 'balanceTags', 50 ); 114 add_filter( 'bbp_edit_reply_pre_content', 'wp_rel_nofollow' ); 115 add_filter( 'bbp_edit_reply_pre_content', 'bbp_filter_kses' ); 116 add_filter( 'bbp_edit_reply_pre_content', 'balanceTags', 50 ); 117 add_filter( 'bbp_edit_topic_pre_content', 'wp_rel_nofollow' ); 118 add_filter( 'bbp_edit_topic_pre_content', 'bbp_filter_kses' ); 119 add_filter( 'bbp_edit_topic_pre_content', 'balanceTags', 50 ); 92 add_filter( 'bbp_new_reply_pre_title', 'wp_filter_kses' ); 93 add_filter( 'bbp_new_topic_pre_title', 'wp_filter_kses' ); 94 add_filter( 'bbp_edit_reply_pre_title', 'wp_filter_kses' ); 95 add_filter( 'bbp_edit_topic_pre_title', 'wp_filter_kses' ); 96 97 // Prevent posting malicious or malformed content on new/edit topic/reply 98 add_filter( 'bbp_new_reply_pre_content', 'bbp_encode_bad', 10 ); 99 add_filter( 'bbp_new_reply_pre_content', 'bbp_code_trick', 20 ); 100 add_filter( 'bbp_new_reply_pre_content', 'bbp_filter_kses', 30 ); 101 add_filter( 'bbp_new_reply_pre_content', 'balanceTags', 40 ); 102 add_filter( 'bbp_new_topic_pre_content', 'bbp_encode_bad', 10 ); 103 add_filter( 'bbp_new_topic_pre_content', 'bbp_code_trick', 20 ); 104 add_filter( 'bbp_new_topic_pre_content', 'bbp_filter_kses', 30 ); 105 add_filter( 'bbp_new_topic_pre_content', 'balanceTags', 40 ); 106 add_filter( 'bbp_edit_reply_pre_content', 'bbp_encode_bad', 10 ); 107 add_filter( 'bbp_edit_reply_pre_content', 'bbp_code_trick', 20 ); 108 add_filter( 'bbp_edit_reply_pre_content', 'bbp_filter_kses', 30 ); 109 add_filter( 'bbp_edit_reply_pre_content', 'balanceTags', 40 ); 110 add_filter( 'bbp_edit_topic_pre_content', 'bbp_encode_bad', 10 ); 111 add_filter( 'bbp_edit_topic_pre_content', 'bbp_code_trick', 20 ); 112 add_filter( 'bbp_edit_topic_pre_content', 'bbp_filter_kses', 30 ); 113 add_filter( 'bbp_edit_topic_pre_content', 'balanceTags', 40 ); 120 114 121 115 // No follow and stripslashes on user profile links 122 add_filter( 'bbp_get_reply_author_link', ' wp_rel_nofollow' );123 add_filter( 'bbp_get_reply_author_link', 'stripslashes' );124 add_filter( 'bbp_get_topic_author_link', ' wp_rel_nofollow' );125 add_filter( 'bbp_get_topic_author_link', 'stripslashes' );126 add_filter( 'bbp_get_user_favorites_link', ' wp_rel_nofollow' );127 add_filter( 'bbp_get_user_favorites_link', 'stripslashes' );128 add_filter( 'bbp_get_user_subscribe_link', ' wp_rel_nofollow' );129 add_filter( 'bbp_get_user_subscribe_link', 'stripslashes' );130 add_filter( 'bbp_get_user_profile_link', ' wp_rel_nofollow' );131 add_filter( 'bbp_get_user_profile_link', 'stripslashes' );132 add_filter( 'bbp_get_user_profile_edit_link', ' wp_rel_nofollow' );133 add_filter( 'bbp_get_user_profile_edit_link', 'stripslashes' );116 add_filter( 'bbp_get_reply_author_link', 'bbp_rel_nofollow' ); 117 add_filter( 'bbp_get_reply_author_link', 'stripslashes' ); 118 add_filter( 'bbp_get_topic_author_link', 'bbp_rel_nofollow' ); 119 add_filter( 'bbp_get_topic_author_link', 'stripslashes' ); 120 add_filter( 'bbp_get_user_favorites_link', 'bbp_rel_nofollow' ); 121 add_filter( 'bbp_get_user_favorites_link', 'stripslashes' ); 122 add_filter( 'bbp_get_user_subscribe_link', 'bbp_rel_nofollow' ); 123 add_filter( 'bbp_get_user_subscribe_link', 'stripslashes' ); 124 add_filter( 'bbp_get_user_profile_link', 'bbp_rel_nofollow' ); 125 add_filter( 'bbp_get_user_profile_link', 'stripslashes' ); 126 add_filter( 'bbp_get_user_profile_edit_link', 'bbp_rel_nofollow' ); 127 add_filter( 'bbp_get_user_profile_edit_link', 'stripslashes' ); 134 128 135 129 // Run filters on reply content … … 142 136 add_filter( 'bbp_get_reply_content', 'force_balance_tags', 30 ); 143 137 add_filter( 'bbp_get_reply_content', 'wpautop', 40 ); 138 add_filter( 'bbp_get_reply_content', 'bbp_rel_nofollow', 50 ); 144 139 145 140 // Run filters on topic content … … 152 147 add_filter( 'bbp_get_topic_content', 'force_balance_tags', 30 ); 153 148 add_filter( 'bbp_get_topic_content', 'wpautop', 40 ); 149 add_filter( 'bbp_get_topic_content', 'bbp_rel_nofollow', 50 ); 150 151 // Form textarea output - undo the code-trick done pre-save, and sanitize 152 add_filter( 'bbp_get_form_reply_content', 'bbp_code_trick_reverse' ); 153 add_filter( 'bbp_get_form_reply_content', 'esc_html' ); 154 add_filter( 'bbp_get_form_reply_content', 'trim' ); 155 add_filter( 'bbp_get_form_topic_content', 'bbp_code_trick_reverse' ); 156 add_filter( 'bbp_get_form_topic_content', 'esc_html' ); 157 add_filter( 'bbp_get_form_topic_content', 'trim' ); 154 158 155 159 // Add number format filter to functions requiring numeric output
Note: See TracChangeset
for help on using the changeset viewer.