PluginProbe ʕ •ᴥ•ʔ
Folders – Unlimited Folders to Organize Media Library Folder, Pages, Posts, File Manager / 2.6.4
Folders – Unlimited Folders to Organize Media Library Folder, Pages, Posts, File Manager v2.6.4
3.1.9 3.1.8 3.1.7 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 trunk 1.3.7 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3 2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 2.4 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.5 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.6.6 2.6.7 2.6.8 2.6.9 2.7 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.8.9 2.9 2.9.1 2.9.2
folders / templates / admin / media-replace.php
folders / templates / admin Last commit date
admin-content.php 5 years ago folder-deactivate-form.php 6 years ago folder-popup.php 5 years ago general-settings.php 5 years ago help.php 6 years ago media-replace.php 5 years ago recommended-plugins.php 5 years ago update.php 6 years ago upgrade-table.php 5 years ago upgrade-to-pro.php 5 years ago
media-replace.php
93 lines
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) exit;
3
4 if (!current_user_can('upload_files'))
5 wp_die(esc_html__('You do not have permission to upload files.', 'enable-media-replace'));
6
7 global $wpdb;
8
9 $attachment_id = intval($_GET['attachment_id']);
10 $attachment = get_post($attachment_id);
11
12 $size = 0;
13 if(isset($attachment->guid)) {
14 $size = $this->getFileSize($attachment_id);
15 }
16 //$url = wp_get_attachment_url($attachment_id); die;
17 $guid = $attachment->guid;
18 $url = wp_get_attachment_url($attachment_id);
19 if(!empty($url)) {
20 $guid = $url;
21 }
22 $guid = explode(".", $guid);
23 $ext = array_pop($guid);
24 $image_meta = wp_get_attachment_metadata($attachment_id);
25 $thumb = wp_get_attachment_image_src($attachment_id, 'thumbnail');
26 $source_type = get_post_mime_type($attachment_id);
27 $url = "";
28 if(isset($thumb[0])) {
29 $url = $thumb[0];
30 }
31 $file_parts = pathinfo($attachment->guid);
32 $file_name = $file_parts['basename'];
33 ?>
34 <div class="wrap">
35 <h2><?php esc_html_e("Replace Media"); ?></h2>
36 <div class="file-type warning replace-message">
37 <?php esc_html_e("Replacement file is not the same filetype. This might cause unexpected issues", "folders"); ?>
38 </div>
39 <form enctype="multipart/form-data" method="POST" action="<?php echo esc_url($form_action) ?>">
40 <div class="replace-media-page">
41 <p><b><?php esc_html_e("Current File", "folders") ?></b>: <?php echo esc_attr($file_name) ?></p>
42 <p><?php esc_html_e("Upload a new file instead of the current one", "folders") ?></p>
43 <p><?php printf(__('Maximum file size: <strong>%s</strong>', 'enable-media-replace'), size_format(wp_max_upload_size())) ?></p>
44 <input type="hidden" name="attachment_id" value="<?php echo esc_attr__($attachment_id) ?>"/>
45 <input type="hidden" name="ext" id="file_ext" value="<?php echo esc_attr__($ext) ?>"/>
46 <div class="upload-media-box">
47
48 </div>
49 <div class="">
50 <div class="current-image-box">
51 <div class="file-option"><?php esc_html_e("Current File", "folders") ?></div>
52 <div class="preview-box">
53 <?php if (wp_attachment_is('image', $attachment_id)) { ?>
54 <?php if(!empty($url)) { ?>
55 <img src="<?php echo esc_url($url) ?>" />
56 <span class="image-size"><?php echo esc_attr($image_meta['width']." x ".$image_meta['height']) ?></span>
57 <?php } ?>
58 <?php } else { ?>
59 <span class="dashicons dashicons-media-document"></span>
60 <?php } ?>
61 </div>
62 <?php if(!empty($size)) { ?>
63 <div class="file-size"><?php echo esc_attr($size) ?></div>
64 <?php } ?>
65 </div>
66 <div class="new-image-box">
67 <div class="file-option"><?php esc_html_e("New File", "folders") ?></div>
68 <div class="preview-box">
69 <div class="container" >
70 <div class="container" >
71 <input type="file" name="new_media_file" id="media_file">
72
73 <!-- Drag and Drop container-->
74 <div class="upload-area" id="upload-file">
75 <div class="drag-and-drop-title">
76 <span>Click here to upload file</span>
77 </div>
78 </div>
79 </div>
80 </div>
81 </div>
82 <div class="file-size"></div>
83 </div>
84 <div class="clearfix"></div>
85 </div>
86 <div class="replace-media-buttons">
87 <button type="submit" class="button button-primary" disabled><?php echo esc_html_e("Change File", "bolders") ?></button>
88 <button type="button" class="button button-secondary" onclick="history.back();"><?php echo esc_html_e("Cancel", "bolders") ?></button>
89 </div>
90 </div>
91 </form>
92 </div>
93