the_attachment_links [ WordPress Function ]
the_attachment_links ( $id = false )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: the_attachment_link, get_the_attachment_link, get_attachment_link, _fix_attachment_links, wp_get_attachment_link
{@internal Missing Short Description}}
Source
<?php
function the_attachment_links( $id = false ) {
$id = (int) $id;
$post = & get_post( $id );
if ( $post->post_type != 'attachment' )
return false;
$icon = wp_get_attachment_image( $post->ID, 'thumbnail', true );
$attachment_data = wp_get_attachment_metadata( $id );
$thumb = isset( $attachment_data['thumb'] );
?>
<form id="the-attachment-links">
<table>
<col />
<col class="widefat" />
<tr>
<th scope="row"><?php _e( 'URL' ) ?></th>
<td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><?php echo esc_textarea( wp_get_attachment_url() ); ?></textarea></td>
</tr>
<?php if ( $icon ) : ?>
<tr>
<th scope="row"><?php $thumb ? _e( 'Thumbnail linked to file' ) : _e( 'Image linked to file' ); ?></th>
<td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo wp_get_attachment_url(); ?>"><?php echo $icon ?></a></textarea></td>
</tr>
<tr>
<th scope="row"><?php $thumb ? _e( 'Thumbnail linked to page' ) : _e( 'Image linked to page' ); ?></th>
<td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link( $post->ID ) ?>" rel="attachment wp-att-<?php echo $post->ID; ?>"><?php echo $icon ?></a></textarea></td>
</tr>
<?php else : ?>
<tr>
<th scope="row"><?php _e( 'Link to file' ) ?></th>
<td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo wp_get_attachment_url(); ?>" class="attachmentlink"><?php echo basename( wp_get_attachment_url() ); ?></a></textarea></td>
</tr>
<tr>
<th scope="row"><?php _e( 'Link to page' ) ?></th>
<td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link( $post->ID ) ?>" rel="attachment wp-att-<?php echo $post->ID ?>"><?php the_title(); ?></a></textarea></td>
</tr>
<?php endif; ?>
</table>
</form>
<?php
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- the_attachment_link - WordPress Codex
Description. Outputs an HTML hyperlink to an attachment file or page, containing either. A full size image or thumbnail for image attachments; or; The ...
codex.wordpress.org - Function Reference/get attachment link « WordPress Codex
Related. the_attachment_link(), get_attachment_link(), wp_get_attachment_link() , wp_get_attachment_image(), wp_get_attachment_image_src(), ...
codex.wordpress.org - the_attachment_links (WordPress Function) - WPSeek.com
WordPress lookup for the_attachment_links, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - How to show WordPress post attachments
foreach($attachments as $attachment){ echo "<li>"; echo apply_filters('the_title', $ attachment->post_title); the_attachment_link($attachment->ID, false); ...
www.wprecipes.com