Changeset 12698 for trunk/src/bp-core/bp-core-moderation.php
- Timestamp:
- 07/31/2020 02:26:38 PM (7 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-moderation.php
r12694 r12698 188 188 * Check for blocked keys. 189 189 * 190 * @since 1.6.0 191 * @since 2.6.0 Added $error_type parameter. 192 * 193 * @todo Why don't we use wp_blacklist_check() for this? 190 * @since 7.0.0 194 191 * 195 192 * @param int $user_id User ID. … … 199 196 * @return bool|WP_Error True if test is passed, false if fail. 200 197 */ 201 function bp_core_check_for_ blacklist( $user_id = 0, $title = '', $content = '', $error_type = 'bool' ) {198 function bp_core_check_for_disallowed_keys( $user_id = 0, $title = '', $content = '', $error_type = 'bool' ) { 202 199 203 200 /** … … 205 202 * 206 203 * @since 2.2.0 204 * @deprecated 7.0.0 Use 'bp_bypass_check_for_disallowed_keys' instead. 207 205 * 208 206 * @param bool $value Whether or not to bypass checking. Default false. … … 211 209 * @param string $content $the content being posted. 212 210 */ 213 if ( apply_filters( 'bp_bypass_check_for_blacklist', false, $user_id, $title, $content ) ) { 211 if ( apply_filters_deprecated( 'bp_bypass_check_for_blacklist', array( false, $user_id, $title, $content ), '7.0.0', 'bp_bypass_check_for_disallowed_keys' ) ) { 212 return true; 213 } 214 215 /** 216 * Filters whether or not to bypass checking for blocked keys. 217 * 218 * @since 7.0.0 219 * 220 * @param bool $value Whether or not to bypass checking. Default false. 221 * @param int $user_id Topic of reply author ID. 222 * @param string $title The title of the content. 223 * @param string $content $the content being posted. 224 */ 225 if ( apply_filters( 'bp_bypass_check_for_disallowed_keys', false, $user_id, $title, $content ) ) { 214 226 return true; 215 227 } … … 294 306 return false; 295 307 } else { 296 return new WP_Error( 'bp_moderation_ blacklist_match', _x( 'You have posted an inappropriate word.', 'Comment blacklist', 'buddypress' ) );308 return new WP_Error( 'bp_moderation_disallowed_key_match', _x( 'You have posted an inappropriate word.', 'Comment disallowed key', 'buddypress' ) ); 297 309 } 298 310 }
Note: See TracChangeset
for help on using the changeset viewer.