Version Description
Download this release
Release Info
Developer | MungoBBQ |
Plugin | Enable Media Replace |
Version | 1.3 |
Comparing to | |
See all releases |
Code changes from version 1.2 to 1.3
- enable-media-replace.php +8 -2
- readme.txt +3 -1
enable-media-replace.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Enable Media Replace
|
4 |
Plugin URI: http://www.mansjonasson.se/enable-media-replace
|
5 |
Description: Enable replacing media files by uploading a new file in the "Edit Media" section of the WordPress Media Library.
|
6 |
-
Version: 1.
|
7 |
Author: Måns Jonasson
|
8 |
Author URI: http://www.mansjonasson.se
|
9 |
|
@@ -24,7 +24,13 @@ function enable_media_replace_init() {
|
|
24 |
|
25 |
function enable_media_replace( $form_fields, $post ) {
|
26 |
if ($_GET["attachment_id"]) {
|
27 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
$form_fields["enable-media-replace"] = array("label" => __("Replace media", "enable-media-replace"), "input" => "html", "html" => "<p><a $link>" . __("Upload a new file", "enable-media-replace") . "</a></p>", "helps" => __("To replace the current file, click the link and upload a replacement.", "enable-media-replace"));
|
29 |
}
|
30 |
return $form_fields;
|
3 |
Plugin Name: Enable Media Replace
|
4 |
Plugin URI: http://www.mansjonasson.se/enable-media-replace
|
5 |
Description: Enable replacing media files by uploading a new file in the "Edit Media" section of the WordPress Media Library.
|
6 |
+
Version: 1.3
|
7 |
Author: Måns Jonasson
|
8 |
Author URI: http://www.mansjonasson.se
|
9 |
|
24 |
|
25 |
function enable_media_replace( $form_fields, $post ) {
|
26 |
if ($_GET["attachment_id"]) {
|
27 |
+
$popupurl = get_bloginfo("wpurl") . "/wp-content/plugins/enable-media-replace/popup.php?attachment_id={$_GET["attachment_id"]}";
|
28 |
+
|
29 |
+
if (FORCE_SSL_ADMIN) {
|
30 |
+
$popupurl = str_replace("http:", "https:", $popupurl);
|
31 |
+
}
|
32 |
+
|
33 |
+
$link = "href=\"#\" onclick=\"window.open('$popupurl', 'enable_media_replace_popup', 'width=500,height=500');\"";
|
34 |
$form_fields["enable-media-replace"] = array("label" => __("Replace media", "enable-media-replace"), "input" => "html", "html" => "<p><a $link>" . __("Upload a new file", "enable-media-replace") . "</a></p>", "helps" => __("To replace the current file, click the link and upload a replacement.", "enable-media-replace"));
|
35 |
}
|
36 |
return $form_fields;
|
readme.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
Contributors: mungobbq
|
3 |
Tags: admin, attachment, media, files
|
4 |
Requires at least: 2.7
|
5 |
-
Tested up to: 2.8.
|
6 |
Stable tag: trunk
|
7 |
|
8 |
Enables replacing attachment files by simply uploading a new file in the media library edit view.
|
@@ -22,6 +22,8 @@ This plugin is very powerful and a must-have for any larger sites built with Wor
|
|
22 |
|
23 |
Changes:
|
24 |
|
|
|
|
|
25 |
1.2 Added Russian translation, thanks to [Fat Cower](http://www.fatcow.com)
|
26 |
|
27 |
1.1 Minor bugfix, now working with IE8 too!
|
2 |
Contributors: mungobbq
|
3 |
Tags: admin, attachment, media, files
|
4 |
Requires at least: 2.7
|
5 |
+
Tested up to: 2.8.6
|
6 |
Stable tag: trunk
|
7 |
|
8 |
Enables replacing attachment files by simply uploading a new file in the media library edit view.
|
22 |
|
23 |
Changes:
|
24 |
|
25 |
+
1.3 Added support for wp_config setting "FORCE_SSL_ADMIN"
|
26 |
+
|
27 |
1.2 Added Russian translation, thanks to [Fat Cower](http://www.fatcow.com)
|
28 |
|
29 |
1.1 Minor bugfix, now working with IE8 too!
|