wp_get_attachment_thumb_file

FUNCTION wp-includes\deprecated.php (ligne 4334) github
Retrieves thumbnail for an attachment. Note that this works only for the (very) old image metadata style where 'thumb' was set, and the 'sizes' array did not exist. This function returns false for the newer image metadata style despite that 'thumbnail' is present in the 'sizes' array.

Paramètres

Entrée :
$post_id = 0
Sortie :
@param int $post_id Optional. Attachment ID. Default is the ID of the global `$post`.
@return string|false Thumbnail file path on success, false on failure.

Utilisation

// Utilisation de la fonction wp_get_attachment_thumb_file
$result = wp_get_attachment_thumb_file($post_id = 0);

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

Actualités

Chargement des actualités...