wp_get_attachment_link

FUNCTION wp-includes\post-template.php (ligne 1636) github
Retrieves an attachment page link using an image or icon, if possible.

Paramètres

Entrée :
$post = 0, $size = 'thumbnail', $permalink = false, $icon = false, $text = false, $attr = ''
Sortie :
@param int|WP_Post  $post      Optional. Post ID or post object.
@param string|int[] $size      Optional. Image size. Accepts any registered image size name, or an array
@param bool         $permalink Optional. Whether to add permalink to image. Default false.
@param bool         $icon      Optional. Whether the attachment is an icon. Default false.
@param string|false $text      Optional. Link text to use. Activated by passing a string, false otherwise.
@param array|string $attr      Optional. Array or string of attributes. Default empty.
@return string HTML content.

Utilisation

// Utilisation de la fonction wp_get_attachment_link
$result = wp_get_attachment_link($post = 0, $size = 'thumbnail', $permalink = false, $icon = false, $text = false, $attr = '');

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

Actualités

Chargement des actualités...