wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema
get_the_attachment_link is deprecated since version 2.5.0!
Alternative: Ver página de detalhe para wp_get_attachment_link »" href="https://pt.wpseek.com/function/wp_get_attachment_link/">wp_get_attachment_link()
Alternative: Ver página de detalhe para wp_get_attachment_link »" href="https://pt.wpseek.com/function/wp_get_attachment_link/">wp_get_attachment_link()
get_the_attachment_link › WordPress Function
Desde2.0.0
Obsoleto2.5.0
› get_the_attachment_link ( $id = 0, $fullsize = false, $max_dims = false, $permalink = false )
Parâmetros: (4) |
|
Ver: | |
Retorna: |
|
Definido em: |
|
Codex: |
Retrieve HTML content of attachment image with link.
Funções relacionadas: get_attachment_link, the_attachment_link, the_attachment_links, wp_get_attachment_link, get_attachment_icon
Fonte
function get_the_attachment_link($id = 0, $fullsize = false, $max_dims = false, $permalink = false) { _deprecated_function( __FUNCTION__, '2.5.0', 'wp_get_attachment_link()' ); $id = (int) $id; $_post = get_post($id); if ( ('attachment' != $_post->post_type) || !$url = wp_get_attachment_url($_post->ID) ) return __('Missing Attachment'); if ( $permalink ) $url = get_attachment_link($_post->ID); $post_title = esc_attr($_post->post_title); $innerHTML = get_attachment_innerHTML($_post->ID, $fullsize, $max_dims); return "<a href='$url' title='$post_title'>$innerHTML</a>"; }