get_usernumposts

FILTER wp-includes\user.php (ligne 645) github
Filters the number of posts a user has written.

Paramètres

Entrée :
$count, $userid, $post_type, $public_only
Sortie :
@param string       $count       The user's post count as a numeric string.
@param int          $userid      User ID.
@param string|array $post_type   Single post type or array of post types to count the number of posts for.
@param bool         $public_only Whether to limit counted posts to public posts.

Utilisation

// Modifier la valeur avec le filtre 'get_usernumposts'
add_filter('get_usernumposts', 'ma_fonction_filtre', 10, 1);

function ma_fonction_filtre($count) {
    // Modifier la valeur
    return $count;
}

Actualités

Chargement des actualités...