PluginProbe
WP Attachments / 3.5
WP Attachments v3.5
6.0.2 6.0.3 trunk 2.0 3 3.0.1 3.0.2 3.0.3 3.1 3.1.1 3.1.2 3.1.3 3.1.4 3.2 3.2.1 3.2.2 3.2.3 3.2.4 3.3 3.4 3.5 3.5.1 3.5.2 3.5.3 3.5.4 All 52 releases
wp-attachments / html / metabox.php

metabox.php in WP Attachments 3.5, at html/metabox.php

64 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if ($attachments->have_posts()): ?>
2 <div id="ij-post-attachments" class="ij-post-attachment-list">
3 <ul class="alignleft">
4 <?php while ($attachments->have_posts()): $atchment = $attachments->next_post(); ?>
5 <li class="ij-post-attachment"
6 data-mimetype="<?php echo $atchment->post_mime_type; ?>"
7 data-alt="<?php echo esc_attr(get_post_meta(611, '_wp_attachment_image_alt', true)); ?>"
8 data-attachmentid="<?php echo $atchment->ID; ?>"
9 data-url="<?php echo wp_get_attachment_url($atchment->ID); ?>"
10 data-title="<?php echo esc_attr($atchment->post_title); ?>">
11 <!--Item title-->
12 <div class="ij-post-attachment-title">
13 <div style="float:left;">
14 <?php echo wp_get_attachment_image($atchment->ID, array(80, 60), true); ?>
15 </div>
16 <div style="float:right;">
17 <?php
18 $wpatt_option_includeimages_get = get_option('wpatt_option_includeimages');
19 if (!($wpatt_option_includeimages_get == '1' && wp_attachment_is_image($atchment->ID))) {
20 echo '<img title="This file will be listed in the front-end" src="' . plugin_dir_url(__FILE__) . 'eye.png"/>';
21 }
22 ?>
23 <a href="#insert-media-button" class="button button-small"><?php _e('Insert into post'); ?></a>
24 <a href="<?php echo wp_get_attachment_url($atchment->ID); ?>" class="button button-small"><?php _e('Edit'); ?></a>
25 <?php $url = admin_url('tools.php?page=unattach&noheader=true&&id=' . $atchment->ID); ?>
26 <a class="button button-small " href="<?php echo esc_url( $url );?>" onclick = "if (! confirm('<?php _e('Are you sure you want to do this?');?>')) { return false; }"><?php echo _e('Unattach','wp-attachments'); ?></a>
27 <a href="<?php echo get_delete_post_link($atchment->ID); ?>" class="button button-small" onclick = "if (! confirm('<?php _e('Are you sure you want to do this?');?>')) { return false; }"><?php _e('Remove'); ?></a>
28 </div>
29 <h3>
30 <?php echo (strlen($atchment->post_title) > 22) ? (substr(esc_html($atchment->post_title), 0, 22) . '...') : esc_html($atchment->post_title); ?></h3>
31 </div>
32
33 <!--Item body-->
34 <div style="padding:1px 5px 5px">
35 <div class="ij-post-attachment-type">
36 <?php
37 echo '<div style="float:right;"><b>';
38 if ((file_exists(get_attached_file($atchment->ID)))) {
39 $wpatt_fs = wpatt_format_bytes(filesize(get_attached_file($atchment->ID)));
40 } else {
41 $wpatt_fs = 'not found';
42 }
43 echo $wpatt_fs;
44 echo '</b></div>';
45 $strr = array("image/", "application/");
46 echo strtoupper(str_replace($strr, '', get_post_mime_type($atchment->ID)));
47 ?>
48 </div>
49
50 </div>
51 </li>
52 <?php endwhile; ?>
53 </ul>
54 <div class="clear"></div>
55 </div>
56 <center>
57 <a href="<?php echo admin_url('media-upload.php?post_id=' . $post->ID); ?>&TB_iframe=1&width=640&height=693"
58 onclick="return false" class="button-primary thickbox">
59 <?php _e('Add Media'); ?>
60 </a>
61 </center>
62 <?php else: ?>
63 <p><?php _e('No media attachments found.'); ?></p>
64 <?php endif; ?>