wp_count_attachments

FUNCTION wp-includes\post.php (ligne 3422) github
This filter is documented in wp-includes/post.php  		return apply_filters( 'wp_count_posts', $counts, $type, $perm );

Paramètres

Entrée :
$mime_type = ''
Sortie :
@param stdClass $counts An object containing the current post_type's post
@param string   $type   Post type.
@param string   $perm   The permission to determine if the posts are 'readable'
@param string|string[] $mime_type Optional. Array or comma-separated list of
@return stdClass An object containing the attachment counts by mime type.

Utilisation

// Utilisation de la fonction wp_count_attachments
$result = wp_count_attachments($mime_type = '');

if ($result) {
    // Votre logique ici
}

Actualités

Chargement des actualités...