Version Description
- Added a new class parameter to the download button shortcode
Download this release
Release Info
Developer | naa986 |
Plugin | Easy Media Download |
Version | 1.1.1 |
Comparing to | |
See all releases |
Code changes from version 1.1.0 to 1.1.1
- main.php +19 -9
- readme.txt +14 -1
main.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Easy Media Download
|
4 |
-
Version: 1.1.
|
5 |
Plugin URI: http://noorsplugin.com/easy-media-download-plugin-for-wordpress/
|
6 |
Author: naa986
|
7 |
Author URI: http://noorsplugin.com/
|
@@ -15,7 +15,7 @@ if(!class_exists('EASY_MEDIA_DOWNLOAD'))
|
|
15 |
{
|
16 |
class EASY_MEDIA_DOWNLOAD
|
17 |
{
|
18 |
-
var $plugin_version = '1.1.
|
19 |
var $plugin_url;
|
20 |
var $plugin_path;
|
21 |
function __construct()
|
@@ -60,8 +60,9 @@ function easy_media_download_handler($atts)
|
|
60 |
'color' => 'red_darker',
|
61 |
'target' => '_self',
|
62 |
'force_dl' => '',
|
|
|
63 |
), $atts));
|
64 |
-
$
|
65 |
$inset = "f5978e";
|
66 |
$start_color = "f24537";
|
67 |
$end_color = "c62d1f";
|
@@ -150,7 +151,7 @@ function easy_media_download_handler($atts)
|
|
150 |
}
|
151 |
$styles = <<<EOT
|
152 |
<style type="text/css">
|
153 |
-
.$
|
154 |
-moz-box-shadow:inset 0px 1px 0px 0px #$inset;
|
155 |
-webkit-box-shadow:inset 0px 1px 0px 0px #$inset;
|
156 |
box-shadow:inset 0px 1px 0px 0px #$inset;
|
@@ -185,27 +186,36 @@ function easy_media_download_handler($atts)
|
|
185 |
text-align:center;
|
186 |
text-shadow:1px 1px 0px #$text_shadow;
|
187 |
}
|
188 |
-
.$
|
189 |
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #$end_color), color-stop(1, #$start_color) );
|
190 |
background:-moz-linear-gradient( center top, #$end_color 5%, #$start_color 100% );
|
191 |
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#$end_color', endColorstr='#$start_color');
|
192 |
background-color:#$end_color;
|
193 |
-
}.$
|
194 |
position:relative;
|
195 |
top:1px;
|
196 |
}
|
197 |
</style>
|
198 |
EOT;
|
199 |
-
|
|
|
200 |
if(preg_match("/http/", $text)){
|
201 |
-
$class
|
|
|
|
|
202 |
$text = '<img src="'.$text.'">';
|
203 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
204 |
if($force_dl=="1"){
|
205 |
$force_dl = " download";
|
206 |
}
|
207 |
$output = <<<EOT
|
208 |
-
<a href="$url" target="$target"{$
|
209 |
$styles
|
210 |
EOT;
|
211 |
return $output;
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Easy Media Download
|
4 |
+
Version: 1.1.1
|
5 |
Plugin URI: http://noorsplugin.com/easy-media-download-plugin-for-wordpress/
|
6 |
Author: naa986
|
7 |
Author URI: http://noorsplugin.com/
|
15 |
{
|
16 |
class EASY_MEDIA_DOWNLOAD
|
17 |
{
|
18 |
+
var $plugin_version = '1.1.1';
|
19 |
var $plugin_url;
|
20 |
var $plugin_path;
|
21 |
function __construct()
|
60 |
'color' => 'red_darker',
|
61 |
'target' => '_self',
|
62 |
'force_dl' => '',
|
63 |
+
'class' => '',
|
64 |
), $atts));
|
65 |
+
$core_class = "emd_dl_".$color;
|
66 |
$inset = "f5978e";
|
67 |
$start_color = "f24537";
|
68 |
$end_color = "c62d1f";
|
151 |
}
|
152 |
$styles = <<<EOT
|
153 |
<style type="text/css">
|
154 |
+
.$core_class {
|
155 |
-moz-box-shadow:inset 0px 1px 0px 0px #$inset;
|
156 |
-webkit-box-shadow:inset 0px 1px 0px 0px #$inset;
|
157 |
box-shadow:inset 0px 1px 0px 0px #$inset;
|
186 |
text-align:center;
|
187 |
text-shadow:1px 1px 0px #$text_shadow;
|
188 |
}
|
189 |
+
.$core_class:hover {
|
190 |
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #$end_color), color-stop(1, #$start_color) );
|
191 |
background:-moz-linear-gradient( center top, #$end_color 5%, #$start_color 100% );
|
192 |
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#$end_color', endColorstr='#$start_color');
|
193 |
background-color:#$end_color;
|
194 |
+
}.$core_class:active {
|
195 |
position:relative;
|
196 |
top:1px;
|
197 |
}
|
198 |
</style>
|
199 |
EOT;
|
200 |
+
|
201 |
+
$css_class = '';
|
202 |
if(preg_match("/http/", $text)){
|
203 |
+
if(!empty($class)){
|
204 |
+
$css_class = ' class="'.$class.'"';
|
205 |
+
}
|
206 |
$text = '<img src="'.$text.'">';
|
207 |
}
|
208 |
+
else{
|
209 |
+
if(!empty($class)){
|
210 |
+
$class = ' '.$class;
|
211 |
+
}
|
212 |
+
$css_class = ' class="'.$core_class.$class.'"';
|
213 |
+
}
|
214 |
if($force_dl=="1"){
|
215 |
$force_dl = " download";
|
216 |
}
|
217 |
$output = <<<EOT
|
218 |
+
<a href="$url" target="$target"{$css_class}{$force_dl}>$text</a>
|
219 |
$styles
|
220 |
EOT;
|
221 |
return $output;
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://noorsplugin.com/
|
|
4 |
Tags: download, downloads, media, digital downloads, e-commerce, e-downloads, e-store, ecommerce, eshop, wp ecommerce, donation
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.5
|
7 |
-
Stable tag: 1.1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -103,6 +103,16 @@ Easy Media Download comes with 21 different download button templates. All you n
|
|
103 |
|
104 |
If you want to fully customize the download button you can use your own button image instead.
|
105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
= Embedding a Donation Button for Free Download =
|
107 |
|
108 |
You can accept donations from users visiting your site for your free downloads. Simply use the following shortcode with your PayPal email address in it.
|
@@ -183,6 +193,9 @@ none
|
|
183 |
|
184 |
== Changelog ==
|
185 |
|
|
|
|
|
|
|
186 |
= 1.1.0 =
|
187 |
* Easy Media Download is now compatible with WordPress 4.4
|
188 |
|
4 |
Tags: download, downloads, media, digital downloads, e-commerce, e-downloads, e-store, ecommerce, eshop, wp ecommerce, donation
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.5
|
7 |
+
Stable tag: 1.1.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
103 |
|
104 |
If you want to fully customize the download button you can use your own button image instead.
|
105 |
|
106 |
+
= Custom CSS Class =
|
107 |
+
|
108 |
+
In addition to various button templates, If you want to apply custom styling to a button you can do so by using the `class` parameter.
|
109 |
+
|
110 |
+
`[easy_media_download url="http://example.com/wp-content/uploads/myfile.zip" class="myclass"]`
|
111 |
+
|
112 |
+
You can specify multiple CSS classes in the shortcode.
|
113 |
+
|
114 |
+
`[easy_media_download url="http://example.com/wp-content/uploads/myfile.zip" class="myclass1 myclass2 myclass3"]`
|
115 |
+
|
116 |
= Embedding a Donation Button for Free Download =
|
117 |
|
118 |
You can accept donations from users visiting your site for your free downloads. Simply use the following shortcode with your PayPal email address in it.
|
193 |
|
194 |
== Changelog ==
|
195 |
|
196 |
+
= 1.1.1 =
|
197 |
+
* Added a new class parameter to the download button shortcode
|
198 |
+
|
199 |
= 1.1.0 =
|
200 |
* Easy Media Download is now compatible with WordPress 4.4
|
201 |
|