wp_image_src_get_dimensions

FUNCTION wp-includes\media.php (ligne 1690) github
Filters whether an image path or URI matches image meta.

Paramètres

Entrée :
$image_src, $image_meta, $attachment_id = 0
Sortie :
@param bool   $match          Whether the image relative path from the image meta
@param string $image_location Full path or URI to the tested image file.
@param array  $image_meta     The image meta data as returned by 'wp_get_attachment_metadata()'.
@param int    $attachment_id  The image attachment ID or 0 if not supplied.
@param string $image_src     The image source file.
@param array  $image_meta    The image meta data as returned by 'wp_get_attachment_metadata()'.
@param int    $attachment_id Optional. The image attachment ID. Default 0.
@return array|false Array with first element being the width and second element being the height,

Utilisation

// Utilisation de la fonction wp_image_src_get_dimensions
$result = wp_image_src_get_dimensions($image_src, $image_meta, $attachment_id = 0);

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

Actualités

Chargement des actualités...