├── .gitignore ├── LICENSE ├── README.md ├── enable-media-replace.php ├── languages ├── enable-media-replace-da_DK.mo ├── enable-media-replace-da_DK.po ├── enable-media-replace-de_DE.mo ├── enable-media-replace-de_DE.po ├── enable-media-replace-es_ES.mo ├── enable-media-replace-es_ES.po ├── enable-media-replace-fr_FR.mo ├── enable-media-replace-fr_FR.po ├── enable-media-replace-it_IT.mo ├── enable-media-replace-it_IT.po ├── enable-media-replace-ja.mo ├── enable-media-replace-ja.po ├── enable-media-replace-nl_NL.mo ├── enable-media-replace-nl_NL.po ├── enable-media-replace-pt_BR.mo ├── enable-media-replace-pt_BR.po ├── enable-media-replace-pt_PT.mo ├── enable-media-replace-pt_PT.po ├── enable-media-replace-ru_RU.mo ├── enable-media-replace-ru_RU.po ├── enable-media-replace-sv_SE.mo ├── enable-media-replace-sv_SE.po ├── enable-media-replace-zh_CN.mo ├── enable-media-replace-zh_CN.po ├── enable-media-replace.mo └── enable-media-replace.po ├── popup.php ├── readme.txt └── upload.php /.gitignore: -------------------------------------------------------------------------------- 1 | /.DS_Store 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Enable Media Replace 2 | 3 | This plugin allows you to replace a file in your media library by uploading a new file in its place. No more deleting, renaming and re-uploading files! 4 | 5 | ## A real timesaver 6 | 7 | Don't you find it tedious and complicated to have to first delete a file and then upload one with the exact same name every time you want to update an image or any uploaded file inside the WordPress media library? 8 | 9 | Well, no longer! 10 | 11 | Now you'll be able to replace any uploaded file from the media "edit" view, where it should be. Media replacement can be done in one of two ways: 12 | 13 | ## It's simple to replace a file 14 | 15 | 1. Just replace the file. This option requires you to upload a file of the same type as the one you are replacing. The name of the attachment will stay the same no matter what the file you upload is called. 16 | 1. Replace the file, use new file name and update all links. If you check this option, the name and type of the file you are about to upload will replace the old file. All links pointing to the current file will be updated to point to the new file name. 17 | 18 | This plugin is very powerful and a must-have for any larger sites built with WordPress. 19 | 20 | ## Display file modification time 21 | 22 | There is a shortcode available which picks up the file modification date and displays it in a post or a page. The code is: 23 | `[file_modified id=XX format=XXXX]` where the "id" is required and the "format" is optional and defaults to your current WordPress settings for date and time format. 24 | 25 | So `[file_modified id=870]` would display the last time the file with ID 870 was updated on your site. To get the ID for a file, check the URL when editing a file in the media library (see screenshot #4) 26 | 27 | If you want more control over the format used to display the time, you can use the format option, so `[file_modified id=870 format=Y-m-d]` would display the file modification date but not the time. The format string uses [standard PHP date() formatting tags](http://php.net/manual/en/function.date.php). 28 | 29 | *** 30 | 31 | See [Enable Media Replace](http://wordpress.org/plugins/enable-media-replace/) at WordPress.org for more information. 32 | -------------------------------------------------------------------------------- /enable-media-replace.php: -------------------------------------------------------------------------------- 1 | 20 | * @copyright Måns Jonasson 13 sep 2010 21 | * @package wordpress 22 | * @subpackage enable-media-replace 23 | * 24 | */ 25 | 26 | add_action('admin_init', 'enable_media_replace_init'); 27 | add_action('admin_menu', 'emr_menu'); 28 | add_filter('attachment_fields_to_edit', 'enable_media_replace', 10, 2); 29 | add_filter('media_row_actions', 'add_media_action', 10, 2); 30 | 31 | add_shortcode('file_modified', 'emr_get_modified_date'); 32 | 33 | /** 34 | * Register this file in WordPress so we can call it with a ?page= GET var. 35 | * To suppress it in the menu we give it an empty menu title. 36 | */ 37 | function emr_menu() { 38 | add_submenu_page(NULL, __("Replace media", "enable-media-replace"), '','upload_files', 'enable-media-replace/enable-media-replace', 'emr_options'); 39 | } 40 | 41 | /** 42 | * Initialize this plugin. Called by 'admin_init' hook. 43 | * Only languages files needs loading during init. 44 | */ 45 | function enable_media_replace_init() { 46 | load_plugin_textdomain( 'enable-media-replace', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); 47 | } 48 | 49 | /** 50 | * Add some new fields to the attachment edit panel. 51 | * @param array form fields edit panel 52 | * @return array form fields with enable-media-replace fields added 53 | */ 54 | function enable_media_replace( $form_fields, $post ) { 55 | 56 | $url = admin_url( "upload.php?page=enable-media-replace/enable-media-replace.php&action=media_replace&attachment_id=" . $post->ID); 57 | $action = "media_replace"; 58 | $editurl = wp_nonce_url( $url, $action ); 59 | 60 | if (FORCE_SSL_ADMIN) { 61 | $editurl = str_replace("http:", "https:", $editurl); 62 | } 63 | $link = "href=\"$editurl\""; 64 | $form_fields["enable-media-replace"] = array("label" => __("Replace media", "enable-media-replace"), "input" => "html", "html" => "

" . __("Upload a new file", "enable-media-replace") . "

", "helps" => __("To replace the current file, click the link and upload a replacement.", "enable-media-replace")); 65 | 66 | return $form_fields; 67 | } 68 | 69 | /** 70 | * Load the replace media panel. 71 | * Panel is show on the action 'media-replace' and a given attachement. 72 | * Called by GET var ?page=enable-media-replace/enable-media-replace.php 73 | */ 74 | function emr_options() { 75 | 76 | if ( isset( $_GET['action'] ) && $_GET['action'] == 'media_replace' ) { 77 | check_admin_referer( 'media_replace' ); // die if invalid or missing nonce 78 | if ( array_key_exists("attachment_id", $_GET) && (int) $_GET["attachment_id"] > 0) { 79 | include("popup.php"); 80 | } 81 | } 82 | 83 | if ( isset( $_GET['action'] ) && $_GET['action'] == 'media_replace_upload' ) { 84 | $plugin_url = str_replace("enable-media-replace.php", "", __FILE__); 85 | check_admin_referer( 'media_replace_upload' ); // die if invalid or missing nonce 86 | require_once($plugin_url . "upload.php"); 87 | } 88 | 89 | } 90 | 91 | /** 92 | * Function called by filter 'media_row_actions' 93 | * Enables linking to EMR straight from the media library 94 | */ 95 | function add_media_action( $actions, $post) { 96 | $url = admin_url( "upload.php?page=enable-media-replace/enable-media-replace.php&action=media_replace&attachment_id=" . $post->ID); 97 | $action = "media_replace"; 98 | $editurl = wp_nonce_url( $url, $action ); 99 | 100 | if (FORCE_SSL_ADMIN) { 101 | $editurl = str_replace("http:", "https:", $editurl); 102 | } 103 | $link = "href=\"$editurl\""; 104 | 105 | $newaction['adddata'] = '' . __("Replace media", "enable-media-replace") . ''; 106 | return array_merge($actions,$newaction); 107 | } 108 | 109 | /** 110 | * Shorttag function to show the media file modification date/time. 111 | * @param array shorttag attributes 112 | * @return string content / replacement shorttag 113 | */ 114 | function emr_get_modified_date($atts) { 115 | $id=0; 116 | $format= ''; 117 | 118 | extract(shortcode_atts(array( 119 | 'id' => '', 120 | 'format' => get_option('date_format') . " " . get_option('time_format'), 121 | ), $atts)); 122 | 123 | if ($id == '') return false; 124 | 125 | // Get path to file 126 | $current_file = get_attached_file($id); 127 | 128 | if ( ! file_exists( $current_file ) ) { 129 | return false; 130 | } 131 | 132 | // Get file modification time 133 | $filetime = filemtime($current_file); 134 | 135 | if ( false !== $filetime ) { 136 | // do date conversion 137 | return date( $format, $filetime ); 138 | } 139 | 140 | return false; 141 | } 142 | 143 | // Add Last replaced by EMR plugin in the media edit screen metabox - Thanks Jonas Lundman (http://wordpress.org/support/topic/add-filter-hook-suggestion-to) 144 | function ua_admin_date_replaced_media_on_edit_media_screen() { 145 | if( !function_exists( 'enable_media_replace' ) ) return; 146 | global $post; 147 | $id = $post->ID; 148 | $shortcode = "[file_modified id=$id]"; 149 | 150 | $file_modified_time = do_shortcode($shortcode); 151 | if ( ! $file_modified_time ) { 152 | return; 153 | } 154 | ?> 155 |
156 | : 157 |
158 | \n" 8 | "Language-Team: \n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Poedit-KeywordsList: __;_e\n" 13 | "X-Poedit-Basepath: .\n" 14 | "X-Poedit-SearchPath-0: .\n" 15 | 16 | #: enable-media-replace.php:40 17 | #: enable-media-replace.php:68 18 | msgid "Replace media" 19 | msgstr "Udskift media" 20 | 21 | #: enable-media-replace.php:68 22 | msgid "Upload a new file" 23 | msgstr "Upload en ny fil" 24 | 25 | #: enable-media-replace.php:68 26 | msgid "To replace the current file, click the link and upload a replacement." 27 | msgstr "Hvis du ønsker at udskifte den aktuelle fil - klik på linket og upload den nye fil." 28 | 29 | #: popup.php:14 30 | #: upload.php:21 31 | msgid "You do not have permission to upload files." 32 | msgstr "Du har ikke tilladelse til at uploade filer." 33 | 34 | #: popup.php:30 35 | msgid "Replace Media Upload" 36 | msgstr "Replace Media Upload" 37 | 38 | #: popup.php:41 39 | msgid "NOTE: You are about to replace the media file" 40 | msgstr "OBS: Du er nu ved at overskrive filen," 41 | 42 | #: popup.php:41 43 | msgid "There is no undo. Think about it!" 44 | msgstr "Der er ingen mulighed for at fortryde, så tænkt dig godt om inden du accepterer." 45 | 46 | #: popup.php:43 47 | msgid "Choose a file to upload from your computer" 48 | msgstr "Vælg den fil du ønsker at uploade fra din computer." 49 | 50 | #: popup.php:47 51 | msgid "Select media replacement type:" 52 | msgstr "Vælg media type:" 53 | 54 | #: popup.php:49 55 | msgid "Just replace the file" 56 | msgstr "Udskift filen" 57 | 58 | #: popup.php:50 59 | msgid "Note: This option requires you to upload a file of the same type (" 60 | msgstr "OBS: Denne mulighed kræver at du uploader en fil af samme type (" 61 | 62 | #: popup.php:50 63 | msgid ") as the one you are replacing. The name of the attachment will stay the same (" 64 | msgstr ") som den du overskriver. Navnet på filen vil forblive det samme (" 65 | 66 | #: popup.php:50 67 | msgid ") no matter what the file you upload is called." 68 | msgstr ") uanset hvad den fil du uploader hedder." 69 | 70 | #: popup.php:52 71 | msgid "Replace the file, use new file name and update all links" 72 | msgstr "Overskriv filen, brug det nye fil navn og opdater alle links-" 73 | 74 | #: popup.php:53 75 | msgid "Note: If you check this option, the name and type of the file you are about to upload will replace the old file. All links pointing to the current file (" 76 | msgstr "OBS: Hvis du vælger denne mulighed - vil filnavnet og filtypen som du er ved at uploade overskrive den gamle fil. Alle links der peger på den nuværende fil (" 77 | 78 | #: popup.php:53 79 | msgid ") will be updated to point to the new file name." 80 | msgstr ") vil blive opdateret så de peger på den nye fil." 81 | 82 | #: popup.php:55 83 | msgid "Upload" 84 | msgstr "Upload" 85 | 86 | #: popup.php:55 87 | msgid "Cancel" 88 | msgstr "Fortryd" 89 | 90 | -------------------------------------------------------------------------------- /languages/enable-media-replace-de_DE.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mansj/enable-media-replace/95a53c32424b31121dbd69ce4e2ad74d77677b03/languages/enable-media-replace-de_DE.mo -------------------------------------------------------------------------------- /languages/enable-media-replace-de_DE.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: enable-media-replace\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2010-09-13 14:57+0100\n" 6 | "PO-Revision-Date: \n" 7 | "Last-Translator: Martin Lettner \n" 8 | "Language-Team: \n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Poedit-KeywordsList: __;_e\n" 13 | "X-Poedit-Basepath: .\n" 14 | "X-Poedit-SearchPath-0: .\n" 15 | 16 | #: enable-media-replace.php:40 17 | #: enable-media-replace.php:68 18 | msgid "Replace media" 19 | msgstr "Datei ersetzen" 20 | 21 | #: enable-media-replace.php:68 22 | msgid "Upload a new file" 23 | msgstr "Eine neue Datei hochladen" 24 | 25 | #: enable-media-replace.php:68 26 | msgid "To replace the current file, click the link and upload a replacement." 27 | msgstr "Eine neue Datei hochladen, die die aktuelle ersetzen soll." 28 | 29 | #: popup.php:14 30 | #: upload.php:21 31 | msgid "You do not have permission to upload files." 32 | msgstr "Sie haben nicht die benötigten Rechte um Dateien hochzuladen." 33 | 34 | #: popup.php:30 35 | msgid "Replace Media Upload" 36 | msgstr "Medien-Datei ersetzen" 37 | 38 | #: popup.php:41 39 | msgid "NOTE: You are about to replace the media file" 40 | msgstr "HINWEIS: Sie sind dabei, eine Datei in der Mediathek zu ersetzen" 41 | 42 | #: popup.php:41 43 | msgid "There is no undo. Think about it!" 44 | msgstr "Diese Aktion kann nicht rückgängig gemacht werden!" 45 | 46 | #: popup.php:43 47 | msgid "Choose a file to upload from your computer" 48 | msgstr "Datei vom Computer auswählen:" 49 | 50 | #: popup.php:47 51 | msgid "Select media replacement type:" 52 | msgstr "Wählen Sie die gewünschte Aktion:" 53 | 54 | #: popup.php:49 55 | msgid "Just replace the file" 56 | msgstr "Datei einfach ersetzen" 57 | 58 | #: popup.php:50 59 | msgid "Note: This option requires you to upload a file of the same type (" 60 | msgstr "Hinweis: Die Datei muss vom selben Dateityp sein (" 61 | 62 | #: popup.php:50 63 | msgid ") as the one you are replacing. The name of the attachment will stay the same (" 64 | msgstr ") wie die Datei, die Sie ersetzen. Der Name der der Datei bleibt erhalten (" 65 | 66 | #: popup.php:50 67 | msgid ") no matter what the file you upload is called." 68 | msgstr "), ganz egal wie die neue Datei heißt." 69 | 70 | #: popup.php:52 71 | msgid "Replace the file, use new file name and update all links" 72 | msgstr "Datei ersetzen, aber neuen Dateinamen verwenden und alle Links automatisch aktualisieren" 73 | 74 | #: popup.php:53 75 | msgid "Note: If you check this option, the name and type of the file you are about to upload will replace the old file. All links pointing to the current file (" 76 | msgstr "Hinweis: Der Name der neuen Datei wird die alte ersetzen. Alle Verweise auf die aktuelle Datei (" 77 | 78 | #: popup.php:53 79 | msgid ") will be updated to point to the new file name." 80 | msgstr ") werden auf die neue aktualisiert." 81 | 82 | #: popup.php:55 83 | msgid "Upload" 84 | msgstr "Hochladen" 85 | 86 | #: popup.php:55 87 | msgid "Cancel" 88 | msgstr "Abbrechen" 89 | 90 | -------------------------------------------------------------------------------- /languages/enable-media-replace-es_ES.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mansj/enable-media-replace/95a53c32424b31121dbd69ce4e2ad74d77677b03/languages/enable-media-replace-es_ES.mo -------------------------------------------------------------------------------- /languages/enable-media-replace-es_ES.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: Enable Media Replace\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2017-08-24 13:19+0200\n" 6 | "PO-Revision-Date: \n" 7 | "Last-Translator: Pacotole \n" 8 | "Language-Team: Creame \n" 9 | "Language: es_ES\n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-KeywordsList: __;_e\n" 14 | "X-Poedit-Basepath: .\n" 15 | "X-Generator: Poedit 1.8.7.1\n" 16 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 17 | "X-Poedit-SourceCharset: UTF-8\n" 18 | "X-Poedit-SearchPath-0: .\n" 19 | "X-Poedit-SearchPath-1: ..\n" 20 | 21 | #: ../enable-media-replace.php:38 ../enable-media-replace.php:64 22 | #: ../enable-media-replace.php:105 23 | msgid "Replace media" 24 | msgstr "Remplazar medio" 25 | 26 | #: ../enable-media-replace.php:64 27 | msgid "Upload a new file" 28 | msgstr "Subir un nuevo archivo" 29 | 30 | #: ../enable-media-replace.php:64 31 | msgid "To replace the current file, click the link and upload a replacement." 32 | msgstr "Para remplazar el archivo actual, haz clic y sube uno nuevo." 33 | 34 | #: ../enable-media-replace.php:156 35 | msgid "Revised" 36 | msgstr "Revisado" 37 | 38 | #: ../popup.php:14 ../upload.php:3 39 | msgid "You do not have permission to upload files." 40 | msgstr "No tienes permisos para subir archivos." 41 | 42 | #: ../popup.php:29 43 | msgid "Replace Media Upload" 44 | msgstr "Remplazar medio" 45 | 46 | #: ../popup.php:45 47 | #, php-format 48 | msgid "" 49 | "NOTE: You are about to replace the media file \"%s\". There is no undo. " 50 | "Think about it!" 51 | msgstr "" 52 | "AVISO: Estás a punto de remplazar el archivo \"%s\". No se puede deshacer. " 53 | "¡Piénsatelo!" 54 | 55 | #: ../popup.php:47 56 | msgid "Choose a file to upload from your computer" 57 | msgstr "Selecciona un archivo para subirlo desde tu ordenador" 58 | 59 | #: ../popup.php:54 60 | msgid "Select media replacement type:" 61 | msgstr "Selecciona el tipo de remplazo:" 62 | 63 | #: ../popup.php:56 64 | msgid "Just replace the file" 65 | msgstr "Solo remplazar el archivo" 66 | 67 | #: ../popup.php:57 68 | #, php-format 69 | msgid "" 70 | "Note: This option requires you to upload a file of the same type (%s) as the " 71 | "one you are replacing. The name of the attachment will stay the same (%s) no " 72 | "matter what the file you upload is called." 73 | msgstr "" 74 | "Nota: Esta opción requiere que subas un archivo del mismo tipo (%s) que el " 75 | "que vas a remplazar. El nombre del archivo adjunto será el mismo (%s) " 76 | "independientemente de como se llame el archivo que subas." 77 | 78 | #: ../popup.php:60 79 | msgid "Replace the file, use new file name and update all links" 80 | msgstr "" 81 | "Remplaza el archivo, usa el nuevo nombre del archivo y actualiza todos los " 82 | "enlaces" 83 | 84 | #: ../popup.php:61 85 | #, php-format 86 | msgid "" 87 | "Note: If you check this option, the name and type of the file you are about " 88 | "to upload will replace the old file. All links pointing to the current file " 89 | "(%s) will be updated to point to the new file name." 90 | msgstr "" 91 | "Nota: Si marcas esta opción, el nombre y el tipo del archivo que vas a subir " 92 | "sustituirá el antiguo archivo. Todos los enlaces que apuntan al archivo " 93 | "actual (%s) se actualizarán para apuntar al nuevo archivo." 94 | 95 | #: ../popup.php:62 96 | msgid "" 97 | "Please note that if you upload a new image, only embeds/links of the " 98 | "original size image will be replaced in your posts." 99 | msgstr "" 100 | "Por favor, ten en cuenta que si subes una nueva imagen, solo los enlaces/" 101 | "inserciones del tamaño original serán remplazados en tus entradas." 102 | 103 | #: ../popup.php:67 104 | msgid "Upload" 105 | msgstr "Subir" 106 | 107 | #: ../popup.php:67 108 | msgid "Cancel" 109 | msgstr "Cancelar" 110 | 111 | #: ../upload.php:32 112 | #, php-format 113 | msgid "" 114 | "The file %1$s can not be deleted by the web server, most likely because the " 115 | "permissions on the file are wrong." 116 | msgstr "" 117 | "El archivo %1$s no se puede eliminar del servidor, normalmente porque los " 118 | "permisos del archivo no lo permiten." 119 | 120 | #: ../upload.php:219 121 | msgid "File type does not meet security guidelines. Try another." 122 | msgstr "El tipo de archivo no cumple las reglas de seguridad. Prueba otro." 123 | 124 | #~ msgid "There is no undo. Think about it!" 125 | #~ msgstr "No se puede deshacer. ¡Piénsatelo!" 126 | 127 | #~ msgid "Note: This option requires you to upload a file of the same type (" 128 | #~ msgstr "Nota: Esta opción requiere que subas un archivo del mismo tipo (" 129 | 130 | #~ msgid "" 131 | #~ ") as the one you are replacing. The name of the attachment will stay the " 132 | #~ "same (" 133 | #~ msgstr "" 134 | #~ ") que el que vas a remplazar. El nombre del archivo adjunto será el mismo " 135 | #~ "(" 136 | 137 | #~ msgid ") no matter what the file you upload is called." 138 | #~ msgstr ") no importa como se llame el archivo que subas." 139 | 140 | #~ msgid ") will be updated to point to the new file name." 141 | #~ msgstr ") se actualizarán para apuntar al nuevo archivo." 142 | -------------------------------------------------------------------------------- /languages/enable-media-replace-fr_FR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mansj/enable-media-replace/95a53c32424b31121dbd69ce4e2ad74d77677b03/languages/enable-media-replace-fr_FR.mo -------------------------------------------------------------------------------- /languages/enable-media-replace-fr_FR.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: Enable Media Replace\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2011-03-24 10:57+0100\n" 6 | "PO-Revision-Date: 2011-03-24 11:41+0100\n" 7 | "Last-Translator: François Collette \n" 8 | "Language-Team: \n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Poedit-KeywordsList: _e;__\n" 13 | "X-Poedit-Basepath: .\n" 14 | "X-Poedit-SearchPath-0: .\n" 15 | 16 | #: enable-media-replace.php:39 17 | #: enable-media-replace.php:67 18 | msgid "Replace media" 19 | msgstr "Remplacer le média" 20 | 21 | #: enable-media-replace.php:67 22 | msgid "Upload a new file" 23 | msgstr "Choisir le nouveau fichier" 24 | 25 | #: enable-media-replace.php:67 26 | msgid "To replace the current file, click the link and upload a replacement." 27 | msgstr "Pour remplacer le fichier actuel, cliquez ci-dessus et choisissez le nouveau fichier." 28 | 29 | #: popup.php:14 30 | #: upload.php:3 31 | msgid "You do not have permission to upload files." 32 | msgstr "Vous n'avez pas la permission d'envoyer des fichiers." 33 | 34 | #: popup.php:30 35 | msgid "Replace Media Upload" 36 | msgstr "Remplacement de média" 37 | 38 | #: popup.php:46 39 | msgid "NOTE: You are about to replace the media file" 40 | msgstr "ATTENTION : vous vous apprêtez à remplacer le fichier" 41 | 42 | #: popup.php:46 43 | msgid "There is no undo. Think about it!" 44 | msgstr "Cette opération est irréversible. Soyez sûr(e) de vous !" 45 | 46 | #: popup.php:48 47 | msgid "Choose a file to upload from your computer" 48 | msgstr "Envoyez un fichier depuis votre ordinateur :" 49 | 50 | #: popup.php:52 51 | msgid "Select media replacement type:" 52 | msgstr "Choisissez la méthode de remplacement :" 53 | 54 | #: popup.php:54 55 | msgid "Just replace the file" 56 | msgstr "Remplacer le fichier seulement" 57 | 58 | #: popup.php:55 59 | msgid "Note: This option requires you to upload a file of the same type (" 60 | msgstr "Avec cette option, vous devez choisir un fichier du même type (" 61 | 62 | #: popup.php:55 63 | msgid ") as the one you are replacing. The name of the attachment will stay the same (" 64 | msgstr ") que le précédent. Le nom du fichier actuel (" 65 | 66 | #: popup.php:55 67 | msgid ") no matter what the file you upload is called." 68 | msgstr ") sera conservé, quel que soit le nom de votre nouveau fichier." 69 | 70 | #: popup.php:57 71 | msgid "Replace the file, use new file name and update all links" 72 | msgstr "Remplacer le fichier, utiliser le nouveau nom de fichier et mettre à jour tous les liens" 73 | 74 | #: popup.php:58 75 | msgid "Note: If you check this option, the name and type of the file you are about to upload will replace the old file. All links pointing to the current file (" 76 | msgstr "Avec cette option, le nom et le type de votre nouveau fichier vont remplacer ceux du fichier actuel. Tous les liens vers celui-ci (" 77 | 78 | #: popup.php:58 79 | msgid ") will be updated to point to the new file name." 80 | msgstr ") seront mis à jour selon le nouveau nom du fichier." 81 | 82 | #: popup.php:60 83 | msgid "Upload" 84 | msgstr "Envoyer" 85 | 86 | #: popup.php:60 87 | msgid "Cancel" 88 | msgstr "Annuler" 89 | 90 | #: upload.php:35 91 | msgid "File type does not meet security guidelines. Try another." 92 | msgstr "Ce type de fichier est incompatible avec les règles de sécurité. Essayez-en un autre." 93 | 94 | -------------------------------------------------------------------------------- /languages/enable-media-replace-it_IT.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mansj/enable-media-replace/95a53c32424b31121dbd69ce4e2ad74d77677b03/languages/enable-media-replace-it_IT.mo -------------------------------------------------------------------------------- /languages/enable-media-replace-it_IT.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: Enable Media Replace\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2011-03-24 10:57+0100\n" 6 | "PO-Revision-Date: 2012-11-27 12:03+0100\n" 7 | "Last-Translator: Marco \n" 8 | "Language-Team: Black Studio \n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Poedit-KeywordsList: _e;__\n" 13 | "X-Poedit-Basepath: .\n" 14 | "X-Poedit-Language: Italian\n" 15 | "X-Poedit-Country: ITALY\n" 16 | "X-Poedit-SearchPath-0: .\n" 17 | 18 | #: enable-media-replace.php:39 19 | #: enable-media-replace.php:67 20 | msgid "Replace media" 21 | msgstr "Sostituisci file" 22 | 23 | #: enable-media-replace.php:67 24 | msgid "Upload a new file" 25 | msgstr "Carica un nuovo file" 26 | 27 | #: enable-media-replace.php:67 28 | msgid "To replace the current file, click the link and upload a replacement." 29 | msgstr "Per sostituire il file corrente, clicca il link e carica un file sostitutivo." 30 | 31 | #: popup.php:14 32 | #: upload.php:3 33 | msgid "You do not have permission to upload files." 34 | msgstr "Non hai sufficienti permessi per caricare file." 35 | 36 | #: popup.php:30 37 | msgid "Replace Media Upload" 38 | msgstr "Caricamento file sostitutivo" 39 | 40 | #: popup.php:46 41 | msgid "NOTE: You are about to replace the media file" 42 | msgstr "NOTA: Stai per sostituire il file" 43 | 44 | #: popup.php:46 45 | msgid "There is no undo. Think about it!" 46 | msgstr "Questa operazione non è reversibile. Fai attenzione!" 47 | 48 | #: popup.php:48 49 | msgid "Choose a file to upload from your computer" 50 | msgstr "Seleziona un file da caricare dal tuo computer" 51 | 52 | #: popup.php:52 53 | msgid "Select media replacement type:" 54 | msgstr "Seleziona il tipo di sostituzione:" 55 | 56 | #: popup.php:54 57 | msgid "Just replace the file" 58 | msgstr "Sostituire semplicemente il file" 59 | 60 | #: popup.php:55 61 | msgid "Note: This option requires you to upload a file of the same type (" 62 | msgstr "Nota: Questa opzione richiede il caricamento di un file dello stesso tipo (" 63 | 64 | #: popup.php:55 65 | msgid ") as the one you are replacing. The name of the attachment will stay the same (" 66 | msgstr ") di quello sostituito. Il nome dell'allegato rimarrà invariato (" 67 | 68 | #: popup.php:55 69 | msgid ") no matter what the file you upload is called." 70 | msgstr ") indipendentemente dal nome del file caricato." 71 | 72 | #: popup.php:57 73 | msgid "Replace the file, use new file name and update all links" 74 | msgstr "Sostituire il file, usare il nome del nuovo file ed aggiornare tutti i collegamenti" 75 | 76 | #: popup.php:58 77 | msgid "Note: If you check this option, the name and type of the file you are about to upload will replace the old file. All links pointing to the current file (" 78 | msgstr "Nota: Se selezioni questa opzione, il nome ed il tipo di file che stai per caricare sostituiranno quelli del file precedente. Tutti i collegamenti che puntavano al file precedente (" 79 | 80 | #: popup.php:58 81 | msgid ") will be updated to point to the new file name." 82 | msgstr ") saranno aggiornati per puntare al nuovo file." 83 | 84 | #: popup.php:60 85 | msgid "Upload" 86 | msgstr "Carica" 87 | 88 | #: popup.php:60 89 | msgid "Cancel" 90 | msgstr "Annulla" 91 | 92 | #: upload.php:35 93 | msgid "File type does not meet security guidelines. Try another." 94 | msgstr "Il tipo di file non rispetta le restrizioni di sicurezza. Riprova con un altro tipo." 95 | 96 | -------------------------------------------------------------------------------- /languages/enable-media-replace-ja.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mansj/enable-media-replace/95a53c32424b31121dbd69ce4e2ad74d77677b03/languages/enable-media-replace-ja.mo -------------------------------------------------------------------------------- /languages/enable-media-replace-ja.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: enable-media-replace\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2015-01-19 09:00+0900\n" 6 | "PO-Revision-Date: \n" 7 | "Last-Translator: chacomv\n" 8 | "Language-Team: \n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Poedit-KeywordsList: __;_e\n" 13 | "X-Poedit-Basepath: .\n" 14 | "X-Generator: Poedit 1.5.7\n" 15 | "X-Poedit-SearchPath-0: .\n" 16 | 17 | #: enable-media-replace.php:40 enable-media-replace.php:79 18 | #: enable-media-replace.php:120 19 | msgid "Replace media" 20 | msgstr "メディアを置換" 21 | 22 | #: enable-media-replace.php:79 23 | msgid "Upload a new file" 24 | msgstr "新しいファイルをアップロード" 25 | 26 | #: enable-media-replace.php:79 27 | msgid "To replace the current file, click the link and upload a replacement." 28 | msgstr "" 29 | "現在のファイルを置換するには、このリンクをクリックしてアップロードします。" 30 | 31 | #: enable-media-replace.php:168 32 | msgid "Revised" 33 | msgstr "変更されました" 34 | 35 | #: popup.php:14 upload.php:3 36 | msgid "You do not have permission to upload files." 37 | msgstr "ファイルをアップロードする権限がありません。" 38 | 39 | #: popup.php:30 40 | msgid "Replace Media Upload" 41 | msgstr "新しいメディアファイルをアップロード" 42 | 43 | #: popup.php:46 44 | msgid "NOTE: You are about to replace the media file" 45 | msgstr "※ このメディアを置き換えようとしています。" 46 | 47 | #: popup.php:46 48 | msgid "There is no undo. Think about it!" 49 | msgstr "元に戻せませんのでご注意ください。" 50 | 51 | #: popup.php:48 52 | msgid "Choose a file to upload from your computer" 53 | msgstr "コンピューターからアップロードするファイルを選択" 54 | 55 | #: popup.php:52 56 | msgid "Select media replacement type:" 57 | msgstr "メディアを置換する方式を選択:" 58 | 59 | #: popup.php:54 60 | msgid "Just replace the file" 61 | msgstr "ファイルの置換のみ" 62 | 63 | #: popup.php:55 64 | msgid "Note: This option requires you to upload a file of the same type (" 65 | msgstr "" 66 | "※ このオプションは、元のファイルと同じファイル形式でアップロードする必要があ" 67 | "ります。(" 68 | 69 | #: popup.php:55 70 | msgid "" 71 | ") as the one you are replacing. The name of the attachment will stay the " 72 | "same (" 73 | msgstr ") ファイル名は同じになります。(" 74 | 75 | #: popup.php:55 76 | msgid ") no matter what the file you upload is called." 77 | msgstr ")" 78 | 79 | #: popup.php:57 80 | msgid "Replace the file, use new file name and update all links" 81 | msgstr "ファイルを置換して新しいファイル名で全てのリンクを更新する" 82 | 83 | #: popup.php:58 84 | msgid "" 85 | "Note: If you check this option, the name and type of the file you are about " 86 | "to upload will replace the old file. All links pointing to the current file (" 87 | msgstr "" 88 | "※ このオプションをチェックすると、アップロードしたファイルの名称と形式に置換" 89 | "されます。現在のファイル名(" 90 | 91 | #: popup.php:58 92 | msgid ") will be updated to point to the new file name." 93 | msgstr ")へのリンクが全て新しいファイル名に更新されます。" 94 | 95 | #: popup.php:60 96 | msgid "Upload" 97 | msgstr "アップロード" 98 | 99 | #: popup.php:60 100 | msgid "Cancel" 101 | msgstr "キャンセル" 102 | 103 | #: upload.php:33 104 | msgid "File type does not meet security guidelines. Try another." 105 | msgstr "" 106 | "ファイル形式がセキュリティ的に許可されません。他の形式をお試しください。" 107 | 108 | #: popup.php:63 109 | msgid "" 110 | "Please note that if you upload a new image, only embeds/links of the " 111 | "original size image will be replaced in your posts." 112 | msgstr "" 113 | "新しいファイルをアップロードすると、元のサイズの画像へのリンクや埋め込みのみ" 114 | "が置換されますのでご注意ください。" 115 | -------------------------------------------------------------------------------- /languages/enable-media-replace-nl_NL.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mansj/enable-media-replace/95a53c32424b31121dbd69ce4e2ad74d77677b03/languages/enable-media-replace-nl_NL.mo -------------------------------------------------------------------------------- /languages/enable-media-replace-nl_NL.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: enable-media-replace\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2010-09-10 20:53+0100\n" 6 | "PO-Revision-Date: \n" 7 | "Last-Translator: WarmStal D!sign | Ben ter Stal \n" 8 | "Language-Team: \n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Poedit-KeywordsList: __;_e\n" 13 | "X-Poedit-Basepath: .\n" 14 | "X-Poedit-SearchPath-0: .\n" 15 | 16 | #: enable-media-replace.php:26 17 | #: enable-media-replace.php:45 18 | msgid "Replace media" 19 | msgstr "Vervangen media" 20 | 21 | #: enable-media-replace.php:45 22 | msgid "Upload a new file" 23 | msgstr "Uploaden nieuw bestand" 24 | 25 | #: enable-media-replace.php:45 26 | msgid "To replace the current file, click the link and upload a replacement." 27 | msgstr "Klik om het bestaande bestand te vervangen door een nieuw te uploaden bestand." 28 | 29 | #: popup.php:7 30 | #: upload.php:10 31 | msgid "You do not have permission to upload files." 32 | msgstr "U heeft geen rechten om bestanden te uplaoden" 33 | 34 | #: popup.php:23 35 | msgid "Replace Media Upload" 36 | msgstr "Replace Media Upload" 37 | 38 | #: popup.php:34 39 | msgid "NOTE: You are about to replace the media file" 40 | msgstr "Opmerking: U staat op het punt het media bestand" 41 | 42 | #: popup.php:34 43 | msgid "There is no undo. Think about it!" 44 | msgstr "Deze bewerking kan niet ongedaan worden gemaakt!" 45 | 46 | #: popup.php:36 47 | msgid "Choose a file to upload from your computer" 48 | msgstr "Selecteer een bestand op de PC om te uploaden" 49 | 50 | #: popup.php:40 51 | msgid "Select media replacement type:" 52 | msgstr "Selecteer de wijze van vervanging" 53 | 54 | #: popup.php:42 55 | msgid "Just replace the file" 56 | msgstr "Vervang alleen het bestand" 57 | 58 | #: popup.php:43 59 | msgid "Note: This option requires you to upload a file of the same type (" 60 | msgstr "Opmerking: voor deze optie moet u een bestand van hetzelfde type uploaden (" 61 | 62 | #: popup.php:43 63 | msgid ") as the one you are replacing. The name of the attachment will stay the same (" 64 | msgstr ") De naam in de media bibliotheek blijft hetzelfde (" 65 | 66 | #: popup.php:43 67 | msgid ") no matter what the file you upload is called." 68 | msgstr ") onafhankelijk van de naam van het nieuwe bestand." 69 | 70 | #: popup.php:45 71 | msgid "Replace the file, use new file name and update all links" 72 | msgstr "Vervang het bestand, gebruik de nieuwe naam en werk alle links bij." 73 | 74 | #: popup.php:46 75 | msgid "Note: If you check this option, the name and type of the file you are about to upload will replace the old file. All links pointing to the current file (" 76 | msgstr "Opmerking: bij deze keuze wordt het bestand volledig vervangen. Alle links naar het huidige bestand (" 77 | 78 | #: popup.php:46 79 | msgid ") will be updated to point to the new file name." 80 | msgstr ") worden bijgewerkt naar het nieuwe bestand." 81 | 82 | #: popup.php:48 83 | msgid "Upload" 84 | msgstr "Uploaden" 85 | 86 | #: popup.php:48 87 | msgid "Cancel" 88 | msgstr "Annuleren" 89 | 90 | -------------------------------------------------------------------------------- /languages/enable-media-replace-pt_BR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mansj/enable-media-replace/95a53c32424b31121dbd69ce4e2ad74d77677b03/languages/enable-media-replace-pt_BR.mo -------------------------------------------------------------------------------- /languages/enable-media-replace-pt_BR.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: enable-media-replace\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2010-09-13 14:57+0100\n" 6 | "PO-Revision-Date: \n" 7 | "Last-Translator: Roger \n" 8 | "Language-Team: Roger Nobrega \n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Poedit-KeywordsList: __;_e\n" 13 | "X-Poedit-Basepath: .\n" 14 | "X-Generator: Poedit 1.5.4\n" 15 | "Language: Português - Brasil\n" 16 | "X-Poedit-SourceCharset: UTF-8\n" 17 | "X-Poedit-SearchPath-0: .\n" 18 | 19 | #: enable-media-replace.php:40 enable-media-replace.php:68 20 | msgid "Replace media" 21 | msgstr "Substituir mídia" 22 | 23 | #: enable-media-replace.php:68 24 | msgid "Upload a new file" 25 | msgstr "Enviar novo arquivo" 26 | 27 | #: enable-media-replace.php:68 28 | msgid "To replace the current file, click the link and upload a replacement." 29 | msgstr "" 30 | "Para subtituir o arquivo atual, clique no link e carregue um substituto" 31 | 32 | #: popup.php:14 upload.php:21 33 | msgid "You do not have permission to upload files." 34 | msgstr "Você não tem permissões para enviar arquivos." 35 | 36 | #: popup.php:30 37 | msgid "Replace Media Upload" 38 | msgstr "Enviar Mídia Substituta" 39 | 40 | #: popup.php:41 41 | msgid "NOTE: You are about to replace the media file" 42 | msgstr "NOTA: Você irá substituir o arquivo de mídia" 43 | 44 | #: popup.php:41 45 | msgid "There is no undo. Think about it!" 46 | msgstr "Não é possível cancelar esta ação." 47 | 48 | #: popup.php:43 49 | msgid "Choose a file to upload from your computer" 50 | msgstr "Escolha um arquivo para enviar do seu computador" 51 | 52 | #: popup.php:47 53 | msgid "Select media replacement type:" 54 | msgstr "Selecione o tipo de substituição" 55 | 56 | #: popup.php:49 57 | msgid "Just replace the file" 58 | msgstr "Apenas substituir arquivo" 59 | 60 | #: popup.php:50 61 | msgid "Note: This option requires you to upload a file of the same type (" 62 | msgstr "Nota: Esta opção requer o carregamento de um arquivo do mesmo tipo (" 63 | 64 | #: popup.php:50 65 | msgid "" 66 | ") as the one you are replacing. The name of the attachment will stay the " 67 | "same (" 68 | msgstr "" 69 | ") do que está sendo substituído. O nome do arquivo permanecerá o mesmo(" 70 | 71 | #: popup.php:50 72 | msgid ") no matter what the file you upload is called." 73 | msgstr "), independente do nome do arquivo enviado." 74 | 75 | #: popup.php:52 76 | msgid "Replace the file, use new file name and update all links" 77 | msgstr "" 78 | "Substituir o arquivo, usar o novo nome de arquivo, e atualizar todos os links" 79 | 80 | #: popup.php:53 81 | msgid "" 82 | "Note: If you check this option, the name and type of the file you are about " 83 | "to upload will replace the old file. All links pointing to the current file (" 84 | msgstr "" 85 | "Nota: Se selecionar esta opção, o nome e tipo do arquivo que você enviar irá " 86 | "substituir os do arquivo antigo. Todos os links do arquivo atual (" 87 | 88 | #: popup.php:53 89 | msgid ") will be updated to point to the new file name." 90 | msgstr ") serão atualizados para o novo arquivo." 91 | 92 | #: popup.php:55 93 | msgid "Upload" 94 | msgstr "Enviar" 95 | 96 | #: popup.php:55 97 | msgid "Cancel" 98 | msgstr "Cancelar" 99 | -------------------------------------------------------------------------------- /languages/enable-media-replace-pt_PT.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mansj/enable-media-replace/95a53c32424b31121dbd69ce4e2ad74d77677b03/languages/enable-media-replace-pt_PT.mo -------------------------------------------------------------------------------- /languages/enable-media-replace-pt_PT.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: enable-media-replace\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2017-02-10 08:48+0000\n" 6 | "PO-Revision-Date: \n" 7 | "Last-Translator: Pedro Mendonça \n" 8 | "Language-Team: Pedro Mendonça \n" 9 | "Language: pt_PT\n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-KeywordsList: __;_e\n" 14 | "X-Poedit-Basepath: ..\n" 15 | "X-Generator: Poedit 1.8.11\n" 16 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 17 | "X-Poedit-SourceCharset: UTF-8\n" 18 | "X-Poedit-WPHeader: enable-media-replace.php\n" 19 | "X-Poedit-SearchPath-0: .\n" 20 | 21 | #: enable-media-replace.php:38 enable-media-replace.php:64 22 | #: enable-media-replace.php:105 23 | msgid "Replace media" 24 | msgstr "Substituir multimédia" 25 | 26 | #: enable-media-replace.php:64 27 | msgid "Upload a new file" 28 | msgstr "Carregar novo ficheiro" 29 | 30 | #: enable-media-replace.php:64 31 | msgid "To replace the current file, click the link and upload a replacement." 32 | msgstr "" 33 | "Para subtituir o ficheiro actual, clique na ligação e carregue um substituto." 34 | 35 | #: enable-media-replace.php:156 36 | msgid "Revised" 37 | msgstr "Revisto" 38 | 39 | #: popup.php:14 upload.php:3 40 | msgid "You do not have permission to upload files." 41 | msgstr "Não tem permissão para carregar ficheiros." 42 | 43 | #: popup.php:29 44 | msgid "Replace Media Upload" 45 | msgstr "Carregar multimédia de substituição" 46 | 47 | #: popup.php:45 48 | #, php-format 49 | msgid "" 50 | "NOTE: You are about to replace the media file \"%s\". There is no undo. " 51 | "Think about it!" 52 | msgstr "" 53 | "NOTA: Está prestes a substituir o ficheiro multimédia \"%s\". Não será " 54 | "possível voltar a trás!" 55 | 56 | #: popup.php:47 57 | msgid "Choose a file to upload from your computer" 58 | msgstr "Escolher um ficheiro para carregar a partir do computador" 59 | 60 | #: popup.php:54 61 | msgid "Select media replacement type:" 62 | msgstr "Seleccione o tipo de substituição de multimédia:" 63 | 64 | #: popup.php:56 65 | msgid "Just replace the file" 66 | msgstr "Apenas substituir o ficheiro" 67 | 68 | #: popup.php:57 69 | #, php-format 70 | msgid "" 71 | "Note: This option requires you to upload a file of the same type (%s) as the " 72 | "one you are replacing. The name of the attachment will stay the same (%s) no " 73 | "matter what the file you upload is called." 74 | msgstr "" 75 | "Nota: Esta opção requer o carregamento de um ficheiro do mesmo tipo (%s) " 76 | "daquele a substituir. O nome do ficheiro permanecerá o mesmo (%s), " 77 | "independentemente do nome do ficheiro carregado." 78 | 79 | #: popup.php:60 80 | msgid "Replace the file, use new file name and update all links" 81 | msgstr "" 82 | "Substituir o ficheiro, usar o novo nome de ficheiro e actualizar todas as " 83 | "ligações" 84 | 85 | #: popup.php:61 86 | #, php-format 87 | msgid "" 88 | "Note: If you check this option, the name and type of the file you are about " 89 | "to upload will replace the old file. All links pointing to the current file " 90 | "(%s) will be updated to point to the new file name." 91 | msgstr "" 92 | "Nota: Se seleccionar esta opção, o nome e tipo do ficheiro que está prestes " 93 | "a carregar irá substituir os do ficheiro antigo. Todas as ligações que " 94 | "referenciam o ficheiro actual (%s) serão actualizadas de modo a referenciar " 95 | "o novo nome de ficheiro." 96 | 97 | #: popup.php:62 98 | msgid "" 99 | "Please note that if you upload a new image, only embeds/links of the " 100 | "original size image will be replaced in your posts." 101 | msgstr "" 102 | "Por favor tenha em atenção que se carregar uma nova imagem, apenas as " 103 | "imagens incorporadas e ligações com o tamanho original serão substituídas " 104 | "nos seus artigos." 105 | 106 | #: popup.php:67 107 | msgid "Upload" 108 | msgstr "Carregar" 109 | 110 | #: popup.php:67 111 | msgid "Cancel" 112 | msgstr "Cancelar" 113 | 114 | #: upload.php:26 115 | #, php-format 116 | msgid "" 117 | "The file %1$s can not be deleted by the web server, most likely because the " 118 | "permissions on the file are wrong." 119 | msgstr "" 120 | "O ficheiro %1$s não pode ser apagado pelo servidor web, provavelmente porque " 121 | "as permissões do ficheiro estão incorrectas." 122 | 123 | #: upload.php:84 124 | msgid "File type does not meet security guidelines. Try another." 125 | msgstr "" 126 | "O tipo de ficheiro não está de acordo com os padrões de segurança. Tente " 127 | "outro." 128 | 129 | #. Plugin Name of the plugin/theme 130 | msgid "Enable Media Replace" 131 | msgstr "Enable Media Replace" 132 | 133 | #. Plugin URI of the plugin/theme 134 | msgid "http://www.mansjonasson.se/enable-media-replace" 135 | msgstr "http://www.mansjonasson.se/enable-media-replace" 136 | 137 | #. Description of the plugin/theme 138 | msgid "" 139 | "Enable replacing media files by uploading a new file in the \"Edit Media\" " 140 | "section of the WordPress Media Library." 141 | msgstr "" 142 | "Permite substituir ficheiros multimédia através de carregar um novo ficheiro " 143 | "na secção \"Editar multimédia\" da biblioteca multimédia do WordPress." 144 | 145 | #. Author of the plugin/theme 146 | msgid "Måns Jonasson" 147 | msgstr "Måns Jonasson" 148 | 149 | #. Author URI of the plugin/theme 150 | msgid "http://www.mansjonasson.se" 151 | msgstr "http://www.mansjonasson.se" 152 | -------------------------------------------------------------------------------- /languages/enable-media-replace-ru_RU.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mansj/enable-media-replace/95a53c32424b31121dbd69ce4e2ad74d77677b03/languages/enable-media-replace-ru_RU.mo -------------------------------------------------------------------------------- /languages/enable-media-replace-ru_RU.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: enable-media-replace\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2010-09-13 14:57+0100\n" 6 | "PO-Revision-Date: 2013-01-18 14:58+0400\n" 7 | "Last-Translator: Vladislav (me@dsigh.ru)\n" 8 | "Language-Team: DigitalSigh\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Poedit-KeywordsList: __;_e\n" 13 | "X-Poedit-Basepath: .\n" 14 | "X-Poedit-Language: Russian\n" 15 | "X-Poedit-Country: RUSSIAN FEDERATION\n" 16 | "X-Poedit-SourceCharset: utf-8\n" 17 | "X-Poedit-SearchPath-0: .\n" 18 | "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11) ? 0 : ((n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20)) ? 1 : 2)\n" 19 | 20 | #: enable-media-replace.php:40 21 | #: enable-media-replace.php:68 22 | msgid "Replace media" 23 | msgstr "Заменить" 24 | 25 | #: enable-media-replace.php:68 26 | msgid "Upload a new file" 27 | msgstr "Загрузить новый файл" 28 | 29 | #: enable-media-replace.php:68 30 | msgid "To replace the current file, click the link and upload a replacement." 31 | msgstr "Для того, чтобы заменить текущий файл, нажмите на ссылку и загрузите замену." 32 | 33 | #: popup.php:14 34 | #: upload.php:21 35 | msgid "You do not have permission to upload files." 36 | msgstr "У вас нет прав для загрузки файлов." 37 | 38 | #: popup.php:30 39 | msgid "Replace Media Upload" 40 | msgstr "Загрузка файла для замены" 41 | 42 | #: popup.php:41 43 | msgid "NOTE: You are about to replace the media file" 44 | msgstr "ПРИМЕЧАНИЕ: Вы собираетесь заменить медиафайл" 45 | 46 | #: popup.php:41 47 | msgid "There is no undo. Think about it!" 48 | msgstr "Данную операцию нельзя отменить. Учтите это!" 49 | 50 | #: popup.php:43 51 | msgid "Choose a file to upload from your computer" 52 | msgstr "Выберите файл для загрузки с вашего компьютера:" 53 | 54 | #: popup.php:47 55 | msgid "Select media replacement type:" 56 | msgstr "Выберите тип замены:" 57 | 58 | #: popup.php:49 59 | msgid "Just replace the file" 60 | msgstr "Только заменить файл" 61 | 62 | #: popup.php:50 63 | msgid "Note: This option requires you to upload a file of the same type (" 64 | msgstr "Этот вариант требуется, если нужно загрузить файл того же типа (" 65 | 66 | #: popup.php:50 67 | msgid ") as the one you are replacing. The name of the attachment will stay the same (" 68 | msgstr "), как оригинальный. Имя вложения останется тем же (" 69 | 70 | #: popup.php:50 71 | msgid ") no matter what the file you upload is called." 72 | msgstr ") не зависимо от того, как называется загружаемый файл." 73 | 74 | #: popup.php:52 75 | msgid "Replace the file, use new file name and update all links" 76 | msgstr "Заменить файл, использовать новое имя и обновить все ссылки" 77 | 78 | #: popup.php:53 79 | msgid "Note: If you check this option, the name and type of the file you are about to upload will replace the old file. All links pointing to the current file (" 80 | msgstr "Если выбрать этот вариант, то имя и тип файла, который вы собираетесь загрузить, заменят старые. Все ссылки, указывающие на текущий файл (" 81 | 82 | #: popup.php:53 83 | msgid ") will be updated to point to the new file name." 84 | msgstr ") будут обновлены новыми." 85 | 86 | #: popup.php:55 87 | msgid "Upload" 88 | msgstr "Загрузить" 89 | 90 | #: popup.php:55 91 | msgid "Cancel" 92 | msgstr "Отмена" 93 | 94 | #~ msgid "Replace media upload" 95 | #~ msgstr "Загрузка файла для замены" 96 | -------------------------------------------------------------------------------- /languages/enable-media-replace-sv_SE.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mansj/enable-media-replace/95a53c32424b31121dbd69ce4e2ad74d77677b03/languages/enable-media-replace-sv_SE.mo -------------------------------------------------------------------------------- /languages/enable-media-replace-sv_SE.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: enable-media-replace\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2015-01-16 15:55+0100\n" 6 | "PO-Revision-Date: \n" 7 | "Last-Translator: Måns Jonasson \n" 8 | "Language-Team: \n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Poedit-KeywordsList: __;_e\n" 13 | "X-Poedit-Basepath: .\n" 14 | "X-Generator: Poedit 1.5.5\n" 15 | "X-Poedit-SearchPath-0: ..\n" 16 | 17 | #: ../enable-media-replace.php:40 ../enable-media-replace.php:79 18 | #: ../enable-media-replace.php:120 19 | msgid "Replace media" 20 | msgstr "Ersätt media" 21 | 22 | #: ../enable-media-replace.php:79 23 | msgid "Upload a new file" 24 | msgstr "Ladda upp en ny fil" 25 | 26 | #: ../enable-media-replace.php:79 27 | msgid "To replace the current file, click the link and upload a replacement." 28 | msgstr "" 29 | "För att ersätta den nuvarande filen, klicka på länken och ladda upp en ny " 30 | "fil." 31 | 32 | #: ../enable-media-replace.php:161 33 | msgid "Revised" 34 | msgstr "Uppdaterad" 35 | 36 | #: ../popup.php:14 ../upload.php:3 37 | msgid "You do not have permission to upload files." 38 | msgstr "Du har inte tillåtelse att ladda upp filer." 39 | 40 | #: ../popup.php:30 41 | msgid "Replace Media Upload" 42 | msgstr "Ladda upp ny fil" 43 | 44 | #: ../popup.php:46 45 | msgid "NOTE: You are about to replace the media file" 46 | msgstr "OBS: Du är på väg att ersätta filen" 47 | 48 | #: ../popup.php:46 49 | msgid "There is no undo. Think about it!" 50 | msgstr "Det finns inget sätt att ångra. Tänk efter först!" 51 | 52 | #: ../popup.php:48 53 | msgid "Choose a file to upload from your computer" 54 | msgstr "Välj en fil att ladda upp från din dator" 55 | 56 | #: ../popup.php:55 57 | msgid "Select media replacement type:" 58 | msgstr "Välj ersättningsform:" 59 | 60 | #: ../popup.php:57 61 | msgid "Just replace the file" 62 | msgstr "Ersätt bara filen" 63 | 64 | #: ../popup.php:58 65 | msgid "Note: This option requires you to upload a file of the same type (" 66 | msgstr "Detta val kräver att du laddar upp en fil av exakt samma typ (" 67 | 68 | #: ../popup.php:58 69 | msgid "" 70 | ") as the one you are replacing. The name of the attachment will stay the " 71 | "same (" 72 | msgstr ") som den du ersätter. Namnet på filen kommer att behållas (" 73 | 74 | #: ../popup.php:58 75 | msgid ") no matter what the file you upload is called." 76 | msgstr ") oavsett vad filen du laddar upp heter på din dator." 77 | 78 | #: ../popup.php:61 79 | msgid "Replace the file, use new file name and update all links" 80 | msgstr "Ersätt filen, använd det nya filnamnet och uppdatera alla länkar" 81 | 82 | #: ../popup.php:62 83 | msgid "" 84 | "Note: If you check this option, the name and type of the file you are about " 85 | "to upload will replace the old file. All links pointing to the current file (" 86 | msgstr "" 87 | "Om du klickar i den här rutan kommer den även namnet och typen på den nya " 88 | "filen du laddar upp helt att ersätta den gamla. Alla länkar som pekar på den " 89 | "gamla filen (" 90 | 91 | #: ../popup.php:62 92 | msgid ") will be updated to point to the new file name." 93 | msgstr ") kommer att uppdateras så att de pekar på det nya filnamnet." 94 | 95 | #: ../popup.php:63 96 | msgid "" 97 | "Please note that if you upload a new image, only embeds/links of the " 98 | "original size image will be replaced in your posts." 99 | msgstr "" 100 | "Notera att om du laddar upp en ny bild kommer endast inbäddningar/länkar " 101 | "till originalstorleken att bytas ut i dina poster." 102 | 103 | #: ../popup.php:68 104 | msgid "Upload" 105 | msgstr "Ladda upp" 106 | 107 | #: ../popup.php:68 108 | msgid "Cancel" 109 | msgstr "Avbryt" 110 | 111 | #: ../upload.php:26 112 | #, php-format 113 | msgid "" 114 | "The file %1$s can not be deleted by the web server, most likely because the " 115 | "permissions on the file are wrong." 116 | msgstr "" 117 | "Filen %1$s kan inte raderas av webbservern, troligen på grund av " 118 | "filrättigheterna." 119 | 120 | #: ../upload.php:84 121 | msgid "File type does not meet security guidelines. Try another." 122 | msgstr "" 123 | "Den här filen är inte tillåten enligt WordPress säkerhetsinställningar. " 124 | 125 | #~ msgid "Enable Media Replace" 126 | #~ msgstr "Ladda upp ny fil" 127 | 128 | #~ msgid "" 129 | #~ "This plugin allows you to replace any uploaded media file by uploading a " 130 | #~ "new one." 131 | #~ msgstr "" 132 | #~ "Detta plugin låter dig ersätta en fil i mediebiblioteket genom att ladda " 133 | #~ "upp en ny." 134 | 135 | #~ msgid "First, locate the uploaded file you want to replace, using the" 136 | #~ msgstr "Hitta först den fil du vill ersätta genom att bläddra i " 137 | 138 | #~ msgid "media library browser" 139 | #~ msgstr "mediebiblioteket" 140 | 141 | #~ msgid "Click the \"Edit\" link" 142 | #~ msgstr "Tryck på \"Redigera\"-länken" 143 | 144 | #~ msgid "" 145 | #~ "Second, click the link \"Upload a new file\" and follow the instructions." 146 | #~ msgstr "Tryck sen på länken \"Ladda upp ny fil\" och följ instruktionerna." 147 | 148 | #~ msgid "Replace media upload" 149 | #~ msgstr "Ladda upp ny fil" 150 | -------------------------------------------------------------------------------- /languages/enable-media-replace-zh_CN.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mansj/enable-media-replace/95a53c32424b31121dbd69ce4e2ad74d77677b03/languages/enable-media-replace-zh_CN.mo -------------------------------------------------------------------------------- /languages/enable-media-replace-zh_CN.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: Enable Media Replace v2.6\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: \n" 6 | "PO-Revision-Date: 2012-09-18 07:29:17+0000\n" 7 | "Last-Translator: Tunghsiao Liu \n" 8 | "Language-Team: \n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 13 | "X-Poedit-Language: Chinese\n" 14 | "X-Poedit-Country: PEOPLE'S REPUBLIC OF CHINA\n" 15 | "X-Poedit-SourceCharset: utf-8\n" 16 | "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n" 17 | "X-Poedit-Basepath: \n" 18 | "X-Poedit-Bookmarks: \n" 19 | "X-Poedit-SearchPath-0: .\n" 20 | "X-Textdomain-Support: yes" 21 | 22 | #: enable-media-replace.php:39 23 | #: enable-media-replace.php:67 24 | #@ enable-media-replace 25 | msgid "Replace media" 26 | msgstr "替换媒体" 27 | 28 | #: enable-media-replace.php:67 29 | #@ enable-media-replace 30 | msgid "Upload a new file" 31 | msgstr "上传新文件" 32 | 33 | #: enable-media-replace.php:67 34 | #@ enable-media-replace 35 | msgid "To replace the current file, click the link and upload a replacement." 36 | msgstr "想要替换当前文件,点击上述链接并上传新文件" 37 | 38 | #: popup.php:14 39 | #: upload.php:3 40 | #@ enable-media-replace 41 | #@ default 42 | msgid "You do not have permission to upload files." 43 | msgstr "您没有权限上传文件" 44 | 45 | #: popup.php:30 46 | #@ enable-media-replace 47 | msgid "Replace Media Upload" 48 | msgstr "替换媒体文件" 49 | 50 | #: popup.php:46 51 | #@ enable-media-replace 52 | msgid "NOTE: You are about to replace the media file" 53 | msgstr "注意:您将要替换媒体文件" 54 | 55 | #: popup.php:46 56 | #@ enable-media-replace 57 | msgid "There is no undo. Think about it!" 58 | msgstr "此操作无法撤销。" 59 | 60 | #: popup.php:48 61 | #@ enable-media-replace 62 | msgid "Choose a file to upload from your computer" 63 | msgstr "从计算机中选择文件上传" 64 | 65 | #: popup.php:52 66 | #@ enable-media-replace 67 | msgid "Select media replacement type:" 68 | msgstr "选择媒体替换类型" 69 | 70 | #: popup.php:54 71 | #@ enable-media-replace 72 | msgid "Just replace the file" 73 | msgstr "仅替换文件" 74 | 75 | #: popup.php:55 76 | #@ enable-media-replace 77 | msgid "Note: This option requires you to upload a file of the same type (" 78 | msgstr "说明:此选项要求您上传与之前文件相同的文件类型(" 79 | 80 | #: popup.php:55 81 | #@ enable-media-replace 82 | msgid ") as the one you are replacing. The name of the attachment will stay the same (" 83 | msgstr "),替换后,无论您上传的文件名是什么,上传后的媒体文件名称与地址都会保持不变(" 84 | 85 | #: popup.php:55 86 | #@ enable-media-replace 87 | msgid ") no matter what the file you upload is called." 88 | msgstr ")。" 89 | 90 | #: popup.php:57 91 | #@ enable-media-replace 92 | msgid "Replace the file, use new file name and update all links" 93 | msgstr "替换文件,使用新文件名并更新所有链接" 94 | 95 | #: popup.php:58 96 | #@ enable-media-replace 97 | msgid "Note: If you check this option, the name and type of the file you are about to upload will replace the old file. All links pointing to the current file (" 98 | msgstr "说明:使用此选项,将会使用新文件的文件名及文件类型,所有包含文件名(" 99 | 100 | #: popup.php:58 101 | #@ enable-media-replace 102 | msgid ") will be updated to point to the new file name." 103 | msgstr ")的链接也将会被替换成新文件名。" 104 | 105 | #: popup.php:60 106 | #@ enable-media-replace 107 | msgid "Upload" 108 | msgstr "上传" 109 | 110 | #: popup.php:60 111 | #@ enable-media-replace 112 | msgid "Cancel" 113 | msgstr "取消" 114 | 115 | #: upload.php:33 116 | #@ default 117 | msgid "File type does not meet security guidelines. Try another." 118 | msgstr "文件类型不符合安全规范,请尝试其他文件。" 119 | 120 | -------------------------------------------------------------------------------- /languages/enable-media-replace.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mansj/enable-media-replace/95a53c32424b31121dbd69ce4e2ad74d77677b03/languages/enable-media-replace.mo -------------------------------------------------------------------------------- /languages/enable-media-replace.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: enable-media-replace\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2015-01-16 17:42-0000\n" 6 | "PO-Revision-Date: \n" 7 | "Last-Translator: Pedro Mendonça \n" 8 | "Language-Team: \n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Poedit-KeywordsList: __;_e\n" 13 | "X-Poedit-Basepath: .\n" 14 | "X-Generator: Poedit 1.7.1\n" 15 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 16 | "X-Poedit-SourceCharset: UTF-8\n" 17 | "Language: en\n" 18 | "X-Poedit-SearchPath-0: .\n" 19 | "X-Poedit-SearchPath-1: ..\n" 20 | 21 | #: ../enable-media-replace.php:40 ../enable-media-replace.php:79 22 | #: ../enable-media-replace.php:120 23 | msgid "Replace media" 24 | msgstr "" 25 | 26 | #: ../enable-media-replace.php:79 27 | msgid "Upload a new file" 28 | msgstr "" 29 | 30 | #: ../enable-media-replace.php:79 31 | msgid "To replace the current file, click the link and upload a replacement." 32 | msgstr "" 33 | 34 | #: ../enable-media-replace.php:161 35 | msgid "Revised" 36 | msgstr "" 37 | 38 | #: ../popup.php:14 ../upload.php:3 39 | msgid "You do not have permission to upload files." 40 | msgstr "" 41 | 42 | #: ../popup.php:30 43 | msgid "Replace Media Upload" 44 | msgstr "" 45 | 46 | #: ../popup.php:46 47 | msgid "NOTE: You are about to replace the media file" 48 | msgstr "" 49 | 50 | #: ../popup.php:46 51 | msgid "There is no undo. Think about it!" 52 | msgstr "" 53 | 54 | #: ../popup.php:48 55 | msgid "Choose a file to upload from your computer" 56 | msgstr "" 57 | 58 | #: ../popup.php:55 59 | msgid "Select media replacement type:" 60 | msgstr "" 61 | 62 | #: ../popup.php:57 63 | msgid "Just replace the file" 64 | msgstr "" 65 | 66 | #: ../popup.php:58 67 | msgid "Note: This option requires you to upload a file of the same type (" 68 | msgstr "" 69 | 70 | #: ../popup.php:58 71 | msgid "" 72 | ") as the one you are replacing. The name of the attachment will stay the " 73 | "same (" 74 | msgstr "" 75 | 76 | #: ../popup.php:58 77 | msgid ") no matter what the file you upload is called." 78 | msgstr "" 79 | 80 | #: ../popup.php:61 81 | msgid "Replace the file, use new file name and update all links" 82 | msgstr "" 83 | 84 | #: ../popup.php:62 85 | msgid "" 86 | "Note: If you check this option, the name and type of the file you are about " 87 | "to upload will replace the old file. All links pointing to the current file (" 88 | msgstr "" 89 | 90 | #: ../popup.php:62 91 | msgid ") will be updated to point to the new file name." 92 | msgstr "" 93 | 94 | #: ../popup.php:63 95 | msgid "" 96 | "Please note that if you upload a new image, only embeds/links of the " 97 | "original size image will be replaced in your posts." 98 | msgstr "" 99 | 100 | #: ../popup.php:68 101 | msgid "Upload" 102 | msgstr "" 103 | 104 | #: ../popup.php:68 105 | msgid "Cancel" 106 | msgstr "" 107 | 108 | #: ../upload.php:26 109 | #, php-format 110 | msgid "" 111 | "The file %1$s can not be deleted by the web server, most likely because the " 112 | "permissions on the file are wrong." 113 | msgstr "" 114 | 115 | #: ../upload.php:84 116 | msgid "File type does not meet security guidelines. Try another." 117 | msgstr "" 118 | -------------------------------------------------------------------------------- /popup.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright Måns Jonasson 13 sep 2010 7 | * @version $Revision: 2303 $ | $Date: 2010-09-13 11:12:35 +0200 (ma, 13 sep 2010) $ 8 | * @package wordpress 9 | * @subpackage enable-media-replace 10 | * 11 | */ 12 | 13 | if (!current_user_can('upload_files')) 14 | wp_die(__('You do not have permission to upload files.', 'enable-media-replace')); 15 | 16 | global $wpdb; 17 | 18 | $table_name = $wpdb->prefix . "posts"; 19 | 20 | $sql = "SELECT guid, post_mime_type FROM $table_name WHERE ID = " . (int) $_GET["attachment_id"]; 21 | 22 | list($current_filename, $current_filetype) = $wpdb->get_row($sql, ARRAY_N); 23 | 24 | $current_filename = substr($current_filename, (strrpos($current_filename, "/") + 1)); 25 | 26 | 27 | ?> 28 |
29 |

30 | 31 | 39 | 40 |
41 | 44 | " /> 45 |

46 | 47 |

48 | 49 | 50 | 51 | 52 | 53 | 54 |

55 | 56 | 57 |

58 | 59 | 60 | 61 |

62 |

63 | 64 | 65 | 66 | 67 | " /> 68 |
69 |
70 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | === Enable Media Replace === 2 | Contributors: mungobbq 3 | Tags: admin, attachment, media, files 4 | Requires at least: 4.0 5 | Tested up to: 4.9.4 6 | Stable tag: trunk 7 | 8 | Enables replacing attachment files by simply uploading a new file in the media library edit view. 9 | 10 | == Description == 11 | 12 | This plugin allows you to replace a file in your media library by uploading a new file in its place. No more deleting, renaming and re-uploading files! 13 | 14 | #### A real timesaver 15 | 16 | Don't you find it tedious and complicated to have to first delete a file and then upload one with the exact same name every time you want to update an image or any uploaded file inside the WordPress media library? 17 | 18 | Well, no longer! 19 | 20 | Now you'll be able to replace any uploaded file from the media "edit" view, where it should be. Media replacement can be done in one of two ways: 21 | 22 | #### It's simple to replace a file 23 | 24 | 1. Just replace the file. This option requires you to upload a file of the same type as the one you are replacing. The name of the attachment will stay the same no matter what the file you upload is called. 25 | 1. Replace the file, use new file name and update all links. If you check this option, the name and type of the file you are about to upload will replace the old file. All links pointing to the current file will be updated to point to the new file name. 26 | 27 | This plugin is very powerful and a must-have for any larger sites built with WordPress. 28 | 29 | #### Display file modification time 30 | 31 | There is a shortcode available which picks up the file modification date and displays it in a post or a page. The code is: 32 | `[file_modified id=XX format=XXXX]` where the "id" is required and the "format" is optional and defaults to your current WordPress settings for date and time format. 33 | 34 | So `[file_modified id=870]` would display the last time the file with ID 870 was updated on your site. To get the ID for a file, check the URL when editing a file in the media library (see screenshot #4) 35 | 36 | If you want more control over the format used to display the time, you can use the format option, so `[file_modified id=870 format=Y-m-d]` would display the file modification date but not the time. The format string uses [standard PHP date() formatting tags](http://php.net/manual/en/function.date.php). 37 | 38 | == Changelog == 39 | 40 | = 3.2.1 = 41 | * Bugfix, typo made metadata changes (thanks GitHub user icecandy!) 42 | * Removed Shortpixel links and images 43 | 44 | = 3.2 = 45 | * Tested with WP 4.9.4 46 | * Added Shortpixel link in replace media screen 47 | 48 | = 3.1.1 = 49 | * Fixed bug introduced in an earlier version, preventing the updating of URLs on pages/posts if the link did not contain the domain name 50 | 51 | = 3.1 = 52 | * Got rid of some pesky old code, and added some better filtering options, thanks to GitHub users speerface, aaemnnosttv, and ururk 53 | * Brand new, shiny code to replace other image sizes in embedded media, thanks to GitHub user ianmjones! 54 | * Tested with WP 4.8 55 | 56 | = 3.0.6 = 57 | * Tested with WP 4.7.2 58 | * New PT translations (thanks Pedro Mendonca! https://github.com/mansj/enable-media-replace/commit/b6e63b9a8a3ae46b3a6664bd5bbf19b2beaf9d3f) 59 | 60 | = 3.0.5 = 61 | * Tested with WP 4.6.1 62 | 63 | = 3.0.4 = 64 | * Fixed typo in .pt translations (https://github.com/mansj/enable-media-replace/pull/18) 65 | * Fixed better error handling in modification date functions (https://github.com/mansj/enable-media-replace/pull/16) 66 | * Tested with WP 4.4.1 67 | 68 | = 3.0.3 = 69 | * Scrapped old method of detecting media screen, button to replace media will now show up in more places, yay! 70 | * Made sure the call to get_attached_file() no longer skips filters, in response to several users wishes. 71 | * Suppressed error messages on chmod() 72 | * Added Japanese translation (Thank you, chacomv!) 73 | 74 | = 3.0.2 = 75 | * Cleaned up language files 76 | * Added Portuguese translation (Thanks pedro-mendonca!) 77 | * Tested with WP 4.1 78 | * Added missing Swedish translation strings 79 | 80 | = 3.0.1 = 81 | * Tiny fix to re-insert the EMR link in the media list view. 82 | 83 | = 3.0 = 84 | * Updated for WordPress 4.0 85 | * Now inheriting permissions of the replaced files, [Thank you Fiwad](https://github.com/fiwad) 86 | 87 | = 2.9.7RC1 = 88 | * Moved localization files into their own directory. [Thank you Michael](https://github.com/michael-cannon) 89 | * Moved screenshots into their own directory. [Thank you Michael](https://github.com/michael-cannon) 90 | 91 | = 2.9.6 = 92 | * Added fix by Grant K Norwood to address a possible security problem in SQL statements. Thanks Grant! 93 | * Created GitHub repo for this plugin, please feel free to contribute at github.com/mansj/enable-media-replace 94 | 95 | = 2.9.5 = 96 | * Bug fix for the short code displaying the modification date of a file 97 | * Updated all database queries in preparation for WP 3.9 98 | 99 | = 2.9.4 = 100 | * Bug fix for timezone changes in WordPress 101 | * Minor UI change to inform the user about what actually happens when replacing an image and using a new file name 102 | 103 | = 2.9.3 = 104 | * Added call to update_attached_file() which should purge changed files for various CDN and cache plugs. Thanks Dylan Barlett for the suggestion! (http://wordpress.org/support/topic/compatibility-with-w3-total-cache) 105 | * Suppressed possible error in new hook added in 2.9.2 106 | 107 | = 2.9.2 = 108 | * Small bug fix 109 | * Added hook for developers to enable purging possible CDN when updating files - thanks rubious for the suggestion! 110 | 111 | = 2.9.1 = 112 | * Added Brazilian Portuguese translation, thanks Roger Nobrega! 113 | * Added filter hook for file name creation, thanks to Jonas Lundman for the code! 114 | * Added modification date to the edit attachment screen, thanks to Jonas Lundman for the code! 115 | * Enhanced the deletion method for old file/image thumbnails to never give unnecessary error messages and more accurately delete orphaned thumbs 116 | 117 | = 2.9 = 118 | * Added Portuguese translation, thanks Bruno Miguel Bras Silva! 119 | * New edit link from media library 120 | * After uploading, the plugin now takes you back to edit screen instead of library 121 | 122 | = 2.8.2 = 123 | * Made another change to the discovery of media context which will hopefully fix a bug in certain cases. Thanks to "Joolee" at the WordPress.org forums! 124 | * Added a new, supposedly better Russian translation from "Vlad". 125 | 126 | = 2.8.1 = 127 | * Fixed a small bug which could create error messages on some systems when deleting old image files. 128 | 129 | = 2.8 = 130 | * New and safer method for deleting thumbnails when a new image file is uploaded. 131 | * New translations for simplified Chinese (thanks Tunghsiao Liu) and Italian (grazie Marco Chiesi) 132 | * Added method for detecting upload screen to ensure backward compatibility with versions pre 3.5 133 | 134 | = 2.7 = 135 | * A couple of changes made to ensure compatibility with WordPress 3.5. Thanks to Elizabeth Powell for the fixes! 136 | 137 | = 2.6 = 138 | * New and improved validation of uploaded files, now using WP's own functions for checking file type and extension. Thanks again to my old friend Ulf "Årsta" Härnhammar for keeping us all on our toes! :) This should also hopefully fix the problems people have been having with their installations claiming that perfectly good PDF files are not allowed file types. 139 | 140 | = 2.5.2 = 141 | * The "more reliable way" of determining MIME types turned out to be less reliable. Go figure. There seems to be no perfect way of performing a reliable check for MIME-types on an uploaded file that is also truly portable. I have now made checks for the availability of mime_content_type() before using it, using the old method as a fall-back. It is far from beautiful, so if anybody has a better way of doing it, please contact me! 142 | 143 | = 2.5.1 = 144 | * Bug fix - there is now a more reliable way of determining file type on your upload so you can upload PDF files without seeing that pesky "File type does not meet security guidelines" message. 145 | * New translation to Danish - thanks to Michael Bering Petersen! 146 | 147 | = 2.5 = 148 | * Tested with WordPress 3.2.1 149 | * New translation to German - thanks to Martin Lettner! 150 | * New translation to French - thanks to François Collette! 151 | 152 | = 2.4.1 = 153 | * Bug fix for WordPress 3.1 RC. Now properly tested and should be working with 3.1 whenever it finally comes out. :) 154 | 155 | = 2.4 = 156 | * Bug fixes, security fixes. Thanks to my old pal Ulf "Årsta" Härnhammar for pointing them out! 157 | * New method for uploading avoids going around WP, for greater security. 158 | 159 | = 2.3 = 160 | * Lots of code trimmed and enhanced, thanks to Ben ter Stal! Now working properly with Windows systems, better security, optimized loading, and much more. 161 | * Added Dutch translation by Ben ter Stal. 162 | 163 | = 2.2 = 164 | * Bug fix, fixed typo in popup.php, thanks to Bill Dennen and others for pointing this out! 165 | 166 | = 2.1 = 167 | * New shortcode - display file modification date on your site (see description for more info) 168 | * A couple of bug fixes for final release of 3.0 - Thanks to Jim Isaacs for pointing them out! 169 | 170 | = 2.0.1 = 171 | * Added support for SSL admin 172 | 173 | = 2.0 = 174 | * Replaced popup with inline navigation when replacing media 175 | * Added instructions in admin link under Media 176 | 177 | = 1.4.1 = 178 | * Tested with WordPress 3.0 beta 2 179 | 180 | = 1.4 = 181 | * Removed short tags for better compatibility. 182 | 183 | = 1.3 = 184 | * Added support for wp_config setting "FORCE_SSL_ADMIN" 185 | 186 | = 1.2 = 187 | * Added Russian translation, thanks to Fat Cower. 188 | 189 | = 1.1 = 190 | * Minor bugfix, now working with IE8 too! 191 | 192 | = 1.0 = 193 | * First stable version of plugin. 194 | 195 | == Installation == 196 | 197 | Quick and easy installation: 198 | 199 | 1. Upload the folder `enable-media-replace` to your plugin directory 200 | 1. Activate the plugin through the 'Plugins' menu in WordPress 201 | 1. Done! 202 | 203 | == Frequently Asked Questions == 204 | 205 | = What does this plugin actually do? = 206 | 207 | This plugin makes it easy to update/replace files that have been uploaded to the WordPress Media Library. 208 | 209 | = How does it work? = 210 | 211 | A new option will be available in the Edit Media view, called "Replace Media". This is where you can upload a new file to replace the old one. 212 | 213 | = I replaced a file, but it didn't change! = 214 | 215 | There are two main reasons this would happen. 216 | 217 | First, make sure you are not viewing a cached version of the file, especially if you replaced an image. Press "Refresh" in your browser to make sure. 218 | 219 | Second, if the file really looks unchanged, make sure WordPress has write permissions to the files in your uploads folder. If you have ever moved your WP installation (maybe when you moved it to a new server), the permissions on your uploaded files are commonly reset so that WordPress no longer has permissions to change the files. If you don't know how to do this, contact your web server operator. 220 | 221 | == Screenshots == 222 | 223 | 1. The new link in the media library. 224 | 2. The replace media-button as seen in the "Edit media" view. 225 | 3. The upload options. 226 | 4. Get the file ID in the edit file URL 227 | 228 | == Wishlist / Coming attractons == 229 | 230 | Do you have suggestions? Feel free to contact me at mans@mansjonasson.se 231 | 232 | -------------------------------------------------------------------------------- /upload.php: -------------------------------------------------------------------------------- 1 | prefix . "posts"; 8 | $postmeta_table_name = $wpdb->prefix . "postmeta"; 9 | 10 | /** 11 | * Delete a media file and its thumbnails. 12 | * 13 | * @param string $current_file 14 | * @param array|null $metadta 15 | */ 16 | function emr_delete_current_files( $current_file, $metadata = null ) { 17 | // Delete old file 18 | 19 | // Find path of current file 20 | $current_path = substr($current_file, 0, (strrpos($current_file, "/"))); 21 | 22 | // Check if old file exists first 23 | if (file_exists($current_file)) { 24 | // Now check for correct file permissions for old file 25 | clearstatcache(); 26 | if (is_writable(dirname($current_file))) { 27 | // Everything OK; delete the file 28 | unlink($current_file); 29 | } 30 | else { 31 | // File exists, but has wrong permissions. Let the user know. 32 | printf(__('The file %1$s can not be deleted by the web server, most likely because the permissions on the file are wrong.', "enable-media-replace"), $current_file); 33 | exit; 34 | } 35 | } 36 | 37 | // Delete old resized versions if this was an image 38 | $suffix = substr($current_file, (strlen($current_file)-4)); 39 | $prefix = substr($current_file, 0, (strlen($current_file)-4)); 40 | $imgAr = array(".png", ".gif", ".jpg"); 41 | if (in_array($suffix, $imgAr)) { 42 | // It's a png/gif/jpg based on file name 43 | // Get thumbnail filenames from metadata 44 | if ( empty( $metadata ) ) { 45 | $metadata = wp_get_attachment_metadata( $_POST["ID"] ); 46 | } 47 | 48 | if (is_array($metadata)) { // Added fix for error messages when there is no metadata (but WHY would there not be? I don't know…) 49 | foreach($metadata["sizes"] AS $thissize) { 50 | // Get all filenames and do an unlink() on each one; 51 | $thisfile = $thissize["file"]; 52 | // Create array with all old sizes for replacing in posts later 53 | $oldfilesAr[] = $thisfile; 54 | // Look for files and delete them 55 | if (strlen($thisfile)) { 56 | $thisfile = $current_path . "/" . $thissize["file"]; 57 | if (file_exists($thisfile)) { 58 | unlink($thisfile); 59 | } 60 | } 61 | } 62 | } 63 | // Old (brutal) method, left here for now 64 | //$mask = $prefix . "-*x*" . $suffix; 65 | //array_map( "unlink", glob( $mask ) ); 66 | } 67 | 68 | } 69 | 70 | /** 71 | * Maybe remove query string from URL. 72 | * 73 | * @param string $url 74 | * 75 | * @return string 76 | */ 77 | function emr_maybe_remove_query_string( $url ) { 78 | $parts = explode( '?', $url ); 79 | 80 | return reset( $parts ); 81 | } 82 | 83 | /** 84 | * Remove scheme from URL. 85 | * 86 | * @param string $url 87 | * 88 | * @return string 89 | */ 90 | function emr_remove_scheme( $url ) { 91 | return preg_replace( '/^(?:http|https):/', '', $url ); 92 | } 93 | 94 | /** 95 | * Remove size from filename (image[-100x100].jpeg). 96 | * 97 | * @param string $url 98 | * @param bool $remove_extension 99 | * 100 | * @return string 101 | */ 102 | function emr_remove_size_from_filename( $url, $remove_extension = false ) { 103 | $url = preg_replace( '/^(\S+)-[0-9]{1,4}x[0-9]{1,4}(\.[a-zA-Z0-9\.]{2,})?/', '$1$2', $url ); 104 | 105 | if ( $remove_extension ) { 106 | $ext = pathinfo( $url, PATHINFO_EXTENSION ); 107 | $url = str_replace( ".$ext", '', $url ); 108 | } 109 | 110 | return $url; 111 | } 112 | 113 | /** 114 | * Strip an image URL down to bare minimum for matching. 115 | * 116 | * @param string $url 117 | * 118 | * @return string 119 | */ 120 | function emr_get_match_url($url) { 121 | $url = emr_remove_scheme($url); 122 | $url = emr_maybe_remove_query_string($url); 123 | $url = emr_remove_size_from_filename($url, true); 124 | $url = emr_remove_domain_from_filename($url); 125 | 126 | return $url; 127 | } 128 | 129 | 130 | function emr_remove_domain_from_filename($url) { 131 | // Holding place for possible future function 132 | $url = str_replace(emr_remove_scheme(get_bloginfo('url')), '', $url); 133 | return $url; 134 | } 135 | 136 | /** 137 | * Build an array of search or replace URLs for given attachment GUID and its metadata. 138 | * 139 | * @param string $guid 140 | * @param array $metadata 141 | * 142 | * @return array 143 | */ 144 | function emr_get_file_urls( $guid, $metadata ) { 145 | $urls = array(); 146 | 147 | $guid = emr_remove_scheme( $guid ); 148 | $guid= emr_remove_domain_from_filename($guid); 149 | 150 | $urls['guid'] = $guid; 151 | 152 | if ( empty( $metadata ) ) { 153 | return $urls; 154 | } 155 | 156 | $base_url = dirname( $guid ); 157 | 158 | if ( ! empty( $metadata['file'] ) ) { 159 | $urls['file'] = trailingslashit( $base_url ) . wp_basename( $metadata['file'] ); 160 | } 161 | 162 | if ( ! empty( $metadata['sizes'] ) ) { 163 | foreach ( $metadata['sizes'] as $key => $value ) { 164 | $urls[ $key ] = trailingslashit( $base_url ) . wp_basename( $value['file'] ); 165 | } 166 | } 167 | 168 | return $urls; 169 | } 170 | 171 | /** 172 | * Ensure new search URLs cover known sizes for old attachment. 173 | * Falls back to full URL if size not covered (srcset or width/height attributes should compensate). 174 | * 175 | * @param array $old 176 | * @param array $new 177 | * 178 | * @return array 179 | */ 180 | function emr_normalize_file_urls( $old, $new ) { 181 | $result = array(); 182 | 183 | if ( empty( $new['guid'] ) ) { 184 | return $result; 185 | } 186 | 187 | $guid = $new['guid']; 188 | 189 | foreach ( $old as $key => $value ) { 190 | $result[ $key ] = empty( $new[ $key ] ) ? $guid : $new[ $key ]; 191 | } 192 | 193 | return $result; 194 | } 195 | 196 | // Get old guid and filetype from DB 197 | $sql = "SELECT guid, post_mime_type FROM $table_name WHERE ID = '" . (int) $_POST["ID"] . "'"; 198 | list($current_filename, $current_filetype) = $wpdb->get_row($sql, ARRAY_N); 199 | 200 | // Massage a bunch of vars 201 | $current_guid = $current_filename; 202 | $current_filename = substr($current_filename, (strrpos($current_filename, "/") + 1)); 203 | 204 | $current_file = get_attached_file((int) $_POST["ID"], apply_filters( 'emr_unfiltered_get_attached_file', true )); 205 | $current_path = substr($current_file, 0, (strrpos($current_file, "/"))); 206 | $current_file = str_replace("//", "/", $current_file); 207 | $current_filename = basename($current_file); 208 | $current_metadata = wp_get_attachment_metadata( $_POST["ID"] ); 209 | 210 | $replace_type = $_POST["replace_type"]; 211 | // We have two types: replace / replace_and_search 212 | 213 | if (is_uploaded_file($_FILES["userfile"]["tmp_name"])) { 214 | 215 | // New method for validating that the uploaded file is allowed, using WP:s internal wp_check_filetype_and_ext() function. 216 | $filedata = wp_check_filetype_and_ext($_FILES["userfile"]["tmp_name"], $_FILES["userfile"]["name"]); 217 | 218 | if ($filedata["ext"] == "") { 219 | echo __("File type does not meet security guidelines. Try another.", 'enable-media-replace'); 220 | exit; 221 | } 222 | 223 | $new_filename = $_FILES["userfile"]["name"]; 224 | $new_filesize = $_FILES["userfile"]["size"]; 225 | $new_filetype = $filedata["type"]; 226 | 227 | // save original file permissions 228 | $original_file_perms = fileperms($current_file) & 0777; 229 | 230 | if ($replace_type == "replace") { 231 | // Drop-in replace and we don't even care if you uploaded something that is the wrong file-type. 232 | // That's your own fault, because we warned you! 233 | 234 | emr_delete_current_files( $current_file, $current_metadata ); 235 | 236 | // Move new file to old location/name 237 | move_uploaded_file($_FILES["userfile"]["tmp_name"], $current_file); 238 | 239 | // Chmod new file to original file permissions 240 | @chmod($current_file, $original_file_perms); 241 | 242 | // Make thumb and/or update metadata 243 | wp_update_attachment_metadata( (int) $_POST["ID"], wp_generate_attachment_metadata( (int) $_POST["ID"], $current_file ) ); 244 | 245 | // Trigger possible updates on CDN and other plugins 246 | update_attached_file( (int) $_POST["ID"], $current_file); 247 | } elseif ( 'replace_and_search' == $replace_type && apply_filters( 'emr_enable_replace_and_search', true ) ) { 248 | // Replace file, replace file name, update meta data, replace links pointing to old file name 249 | 250 | emr_delete_current_files( $current_file, $current_metadata ); 251 | 252 | // Massage new filename to adhere to WordPress standards 253 | $new_filename = wp_unique_filename( $current_path, $new_filename ); 254 | $new_filename = apply_filters( 'emr_unique_filename', $new_filename, $current_path, (int) $_POST['ID'] ); 255 | 256 | // Move new file to old location, new name 257 | $new_file = $current_path . "/" . $new_filename; 258 | move_uploaded_file($_FILES["userfile"]["tmp_name"], $new_file); 259 | 260 | // Chmod new file to original file permissions 261 | @chmod($current_file, $original_file_perms); 262 | 263 | $new_filetitle = preg_replace('/\.[^.]+$/', '', basename($new_file)); 264 | $new_filetitle = apply_filters( 'enable_media_replace_title', $new_filetitle ); // Thanks Jonas Lundman (http://wordpress.org/support/topic/add-filter-hook-suggestion-to) 265 | $new_guid = str_replace($current_filename, $new_filename, $current_guid); 266 | 267 | // Update database file name 268 | $sql = $wpdb->prepare( 269 | "UPDATE $table_name SET post_title = '$new_filetitle', post_name = '$new_filetitle', guid = '$new_guid', post_mime_type = '$new_filetype' WHERE ID = %d;", 270 | (int) $_POST["ID"] 271 | ); 272 | $wpdb->query($sql); 273 | 274 | // Update the postmeta file name 275 | 276 | // Get old postmeta _wp_attached_file 277 | $sql = $wpdb->prepare( 278 | "SELECT meta_value FROM $postmeta_table_name WHERE meta_key = '_wp_attached_file' AND post_id = %d;", 279 | (int) $_POST["ID"] 280 | ); 281 | 282 | $old_meta_name = $wpdb->get_row($sql, ARRAY_A); 283 | $old_meta_name = $old_meta_name["meta_value"]; 284 | 285 | // Make new postmeta _wp_attached_file 286 | $new_meta_name = str_replace($current_filename, $new_filename, $old_meta_name); 287 | $sql = $wpdb->prepare( 288 | "UPDATE $postmeta_table_name SET meta_value = '$new_meta_name' WHERE meta_key = '_wp_attached_file' AND post_id = %d;", 289 | (int) $_POST["ID"] 290 | ); 291 | $wpdb->query($sql); 292 | 293 | // Make thumb and/or update metadata 294 | $new_metadata = wp_generate_attachment_metadata( (int) $_POST["ID"], $new_file ); 295 | wp_update_attachment_metadata( (int) $_POST["ID"], $new_metadata ); 296 | 297 | // Search-and-replace filename in post database 298 | $current_base_url = emr_get_match_url( $current_guid ); 299 | 300 | $sql = $wpdb->prepare( 301 | "SELECT ID, post_content FROM $table_name WHERE post_status = 'publish' AND post_content LIKE %s;", 302 | '%' . $current_base_url . '%' 303 | ); 304 | 305 | $content_rs = $wpdb->get_results( $sql, ARRAY_A ); 306 | 307 | $sql = $wpdb->prepare( 308 | "SELECT meta_id, meta_value FROM $postmeta_table_name WHERE meta_value LIKE %s;", 309 | '%' . $current_base_url . '%' 310 | ); 311 | 312 | $meta_rs = $wpdb->get_results( $sql, ARRAY_A ); 313 | 314 | $number_of_updates = 0; 315 | 316 | if ( ! empty( $content_rs ) || ! empty( $meta_rs ) ) { 317 | 318 | $search_urls = emr_get_file_urls( $current_guid, $current_metadata ); 319 | $replace_urls = emr_get_file_urls( $new_guid, $new_metadata ); 320 | $replace_urls = emr_normalize_file_urls( $search_urls, $replace_urls ); 321 | 322 | if ( ! empty( $content_rs ) ) { 323 | foreach ( $content_rs AS $rows ) { 324 | 325 | $number_of_updates = $number_of_updates + 1; 326 | 327 | // replace old URLs with new URLs. 328 | $post_content = $rows["post_content"]; 329 | $post_content = addslashes( str_replace( $search_urls, $replace_urls, $post_content ) ); 330 | 331 | $sql = $wpdb->prepare( 332 | "UPDATE $table_name SET post_content = '$post_content' WHERE ID = %d;", 333 | $rows["ID"] 334 | ); 335 | 336 | $wpdb->query( $sql ); 337 | } 338 | } 339 | 340 | if ( ! empty( $meta_rs ) ) { 341 | 342 | foreach ( $meta_rs AS $rows ) { 343 | $number_of_updates = $number_of_updates + 1; 344 | 345 | // replace old URLs with new URLs. 346 | $meta_value = $rows["meta_value"]; 347 | $meta_value = str_replace( $search_urls, $replace_urls, $meta_value ); 348 | // Fix string counts for serialized data. 349 | if ( is_serialized( $meta_value ) ) { 350 | foreach ( $search_urls as $size => $url ) { 351 | $meta_value = str_replace( 352 | 's:' . strlen( site_url( $url ) ) . ':"' . site_url( $replace_urls[ $size ] ) . '";', 353 | 's:' . strlen( site_url( $replace_urls[ $size ] ) ) . ':"' . site_url( $replace_urls[ $size ] ) . '";', 354 | $meta_value 355 | ); 356 | } 357 | } 358 | $sql = $wpdb->prepare( 359 | "UPDATE $postmeta_table_name SET meta_value = '$meta_value' WHERE meta_id = %d;", 360 | $rows["meta_id"] 361 | ); 362 | $wpdb->query( $sql ); 363 | } 364 | } 365 | } 366 | 367 | // Trigger possible updates on CDN and other plugins 368 | update_attached_file( (int) $_POST["ID"], $new_file ); 369 | } 370 | 371 | #echo "Updated: " . $number_of_updates; 372 | 373 | $returnurl = admin_url("/post.php?post={$_POST["ID"]}&action=edit&message=1"); 374 | 375 | // Execute hook actions - thanks rubious for the suggestion! 376 | if (isset($new_guid)) { do_action("enable-media-replace-upload-done", $new_guid, $current_guid); } 377 | 378 | } else { 379 | //TODO Better error handling when no file is selected. 380 | //For now just go back to media management 381 | $returnurl = admin_url("/wp-admin/upload.php"); 382 | } 383 | 384 | if (FORCE_SSL_ADMIN) { 385 | $returnurl = str_replace("http:", "https:", $returnurl); 386 | } 387 | 388 | // Allow developers to override $returnurl 389 | $returnurl = apply_filters('emr_returnurl', $returnurl); 390 | 391 | //save redirection 392 | wp_redirect($returnurl); 393 | ?> 394 | --------------------------------------------------------------------------------