check_is_user_spammed
Filters whether the user has been marked as a spammer.
Description
Parameters (2)
- 0. $is_user_spammy (bool) =>
is_user_spammy( $user )
- Whether the user is considered a spammer.
- 1. $user (WP_User)
- User to check against.
Usage
- To run the hook, copy the example below.
- $is_user_spammy = apply_filters( 'check_is_user_spammed', $is_user_spammy, $user );
- if ( !empty( $is_user_spammy ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the check_is_user_spammed callback
- function filter_check_is_user_spammed( $is_user_spammy, $user ) {
- // make filter magic happen here...
- return $is_user_spammy;
- };
- // add the filter
- add_filter( 'check_is_user_spammed', 'filter_check_is_user_spammed', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'check_is_user_spammed', 'filter_check_is_user_spammed', 10, 2 );
Defined (1)
The filter is defined in the following location(s).
- /wp-includes/user.php
- $spammed = apply_filters( 'check_is_user_spammed', is_user_spammy( $user ), $user );