wp_get_original_image_path

FUNCTION wp-includes\post.php (ligne 8429) github
Filters the list of available post MIME types for the given post type.

Paramètres

Entrée :
$attachment_id, $unfiltered = false
Sortie :
@param string[]|null $mime_types An array of MIME types. Default null.
@param string        $type       The post type name. Usually 'attachment' but can be any post type.
@param int  $attachment_id Attachment ID.
@param bool $unfiltered Optional. Passed through to `get_attached_file()`. Default false.
@return string|false Path to the original image file or false if the attachment is not an image.

Utilisation

// Utilisation de la fonction wp_get_original_image_path
$result = wp_get_original_image_path($attachment_id, $unfiltered = false);

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

Actualités

Chargement des actualités...