Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




the_attachment_links [ WordPress Function ]

the_attachment_links ( $id = false )
Parameters:
  • (unknown_type) $id
Returns:
  • (unknown)
Defined at:



{@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_textareawp_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 basenamewp_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

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics