check_is_user_spammed
Filter HookDescription
Filters whether the user has been marked as a spammer.Hook Information
File Location |
wp-includes/user.php
View on GitHub
|
Hook Type | Filter |
Line Number | 565 |
Hook Parameters
Type | Name | Description |
---|---|---|
bool
|
$spammed
|
Whether the user is considered a spammer. |
WP_User
|
$user
|
User to check against. |
Usage Examples
Basic Usage
<?php
// Hook into check_is_user_spammed
add_filter('check_is_user_spammed', 'my_custom_filter', 10, 2);
function my_custom_filter($spammed, $user) {
// Your custom filtering logic here
return $spammed;
}
Source Code Context
wp-includes/user.php:565
- How this hook is used in WordPress core
<?php
560 * @since 3.7.0
561 *
562 * @param bool $spammed Whether the user is considered a spammer.
563 * @param WP_User $user User to check against.
564 */
565 $spammed = apply_filters( 'check_is_user_spammed', is_user_spammy( $user ), $user );
566
567 if ( $spammed ) {
568 return new WP_Error( 'spammer_account', __( '<strong>Error:</strong> Your account has been marked as a spammer.' ) );
569 }
570 }
PHP Documentation
<?php
/**
* Filters whether the user has been marked as a spammer.
*
* @since 3.7.0
*
* @param bool $spammed Whether the user is considered a spammer.
* @param WP_User $user User to check against.
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-includes/user.php
Related Hooks
Related hooks will be displayed here in future updates.