wp_get_attachment_link [ WordPress-Funktionen ]
wp_get_attachment_link ( $id = 0, $size = 'thumbnail', $permalink = false, $icon = false, $text = false )
| Parameter: |
|
| Nutzt: | |
| Gibt zurück: |
|
| Definiert in: |
|
| Codex |
Ähnliche Funktionen: get_attachment_link, wp_get_attachment_url, get_the_attachment_link, wp_get_attachment_image, the_attachment_link
Retrieve an attachment page link using an image or icon, if possible.
Quellcode
function wp_get_attachment_link( $id = 0, $size = 'thumbnail', $permalink = false, $icon = false, $text = false ) {
$id = intval( $id );
$_post = get_post( $id );
if ( empty( $_post ) || ( '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 );
if ( $text )
$link_text = $text;
elseif ( $size && 'none' != $size )
$link_text = wp_get_attachment_image( $id, $size, $icon );
else
$link_text = '';
if ( trim( $link_text ) == '' )
$link_text = $_post->post_title;
return apply_filters( 'wp_get_attachment_link', "<a href='$url' title='$post_title'>$link_text</a>", $id, $size, $permalink, $icon, $text );
}Beispiele [ wp-snippets.com ]
Top Google Suchergebnisse
- Function Reference/wp get attachment link « WordPress Codex
Description. Returns an HTML hyperlink to an attachment file or page, containing either. An image at some specified size, for image attachments; or; A media ...
codex.wordpress.org - WordPress add filter to wp_get_attachment_link - Stack Overflow
I need custom class for filter to wp_get_attachment_link. So what I so: ... Try function modify_attachment_link( $markup, $id, $size, $permalink ) ...
stackoverflow.com - wp_get_attachment_link:WordPress私的マニュアル - 常用漢字一覧
2011年1月4日 ... WordPressの関数: wp_get_attachment_link - 添付ファイルへのリンクを示すHTML テキストを取得する.
elearn.jp - wp_get_attachment_link (WordPress Function) - WPSeek.com
Retrieve an attachment page link using an image or icon, if possible. WordPress lookup for wp_get_attachment_link, a WordPress Function.
wpseek.com
Nutzerduskussionen [ wordpress.org ]
- charl99cfc on "add_filter for wp_get_attachment_link ADD ID param"
- charl99cfc on "wp_get_attachment_link custom filter"
- kbkisan on "Create filter for wp_get_attachment_link"
- jobmeer on "hook on wp_get_attachment_link"
- Matthew on "Getting attachment width for medium size"
- Matthew on "Getting attachment width for medium size"
- Matthew on "Getting attachment width for medium size"
- Matthew on "Getting attachment width for medium size"
- wprabbit on "How do you show an attachment without linking to the raw file"
- generalsalt on "wp_get_attachment_link"
