Skip to content

Commit 24625c9

Browse files
Add Version 2.2
1 parent 6f395bc commit 24625c9

5 files changed

Lines changed: 104 additions & 101 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# WordPress Easy SVG Support Version 2.1
1+
# WordPress Easy SVG Support Version 2.2
22

3-
Du möchtest endlich in WordPress SVG Dateien hochladen und einbinden? Dann lade dir jetzt mein Plugin herunter.
3+
Du möchtest endlich in WordPress SVG Dateien hochladen und einbinden? Dann lade dir jetzt mein Plugin herunter.
44

55
Hier geht es zur WordPress.org Page:(Auto Updates)
6-
https://wordpress.org/plugins/easy-svg/
6+
https://wordpress.org/plugins/easy-svg/

css/style.css

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
11
/*
2-
Plugin Name: Easy SVG Support
2+
Plugin Name: Easy SVG Support
33
Description: Add SVG Support for WordPress.
4-
Version: 2.1
4+
Version: 2.2
55
Author: Benjamin Zekavica
66
7-
Copyright by:
8-
(c) 2017 - 2018 by Benjamin Zekavica. All rights reserved.
7+
Copyright by:
8+
(c) 2017 - 2018 by Benjamin Zekavica. All rights reserved.
99
10-
Imprint:
10+
Imprint:
1111
Benjamin Zekavica
1212
Oranienstraße 12
13-
52066 Aachen
13+
52066 Aachen
1414
1515
E-Mail: info@benjamin-zekavica.de
1616
Web: www.benjamin-zekavica.de
1717
18-
I don't give support by Mail. Please write in the
19-
community forum for questions and problems.
18+
I don't give support by Mail. Please write in the
19+
community forum for questions and problems.
2020
2121
*/
2222

2323

24-
/* Display the SVG on table columns */
24+
/* Display the SVG on table columns */
2525

2626
table.media .column-title .media-icon img[src*='.svg']{
27-
width: 100%;
27+
width: 100%;
2828
height: auto;
2929
}
30-

easy-svg.php

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22
/*
3-
Plugin Name: Easy SVG Support
3+
Plugin Name: Easy SVG Support
44
Plugin URI: https://wordpress.org/plugins/easy-svg/
55
Description: Add SVG Support for WordPress.
6-
Version: 2.1
6+
Version: 2.2
77
Author: Benjamin Zekavica
88
Author URI: http://www.benjamin-zekavica.de
99
Text Domain: easy-svg
@@ -24,34 +24,34 @@
2424
along with Easy SVG. If not, see license.txt .
2525
2626
27-
Copyright by:
28-
(c) 2017 - 2018 by Benjamin Zekavica. All rights reserved.
27+
Copyright by:
28+
(c) 2017 - 2018 by Benjamin Zekavica. All rights reserved.
2929
30-
Imprint:
30+
Imprint:
3131
Benjamin Zekavica
3232
Oranienstrasse 12
33-
52066 Aachen
33+
52066 Aachen
3434
3535
E-Mail: info@benjamin-zekavica.de
3636
Web: www.benjamin-zekavica.de
3737
38-
I don't give support by Mail. Please write in the
39-
community forum for questions and problems.
38+
I don't give support by Mail. Please write in the
39+
community forum for questions and problems.
4040
4141
4242
*/
4343

4444
/* ========================================
45-
Upload SVG Support
45+
Upload SVG Support
4646
======================================== */
4747

4848
add_filter( 'upload_mimes', 'esw_add_support' );
4949

5050

5151
function esw_add_support ( $svg_editing ){
52-
52+
5353
$svg_editing['svg'] = 'image/svg+xml';
54-
54+
5555
// Echo the svg file
5656
return $svg_editing;
5757
}
@@ -70,14 +70,14 @@ function esw_upload_check($checked, $file, $filename, $mimes){
7070
$type = $esw_upload_check['type'];
7171
$proper_filename = $filename;
7272

73-
/* ========================================
74-
Upload checking filename
75-
======================================== */
73+
/* ========================================
74+
Upload checking filename
75+
======================================== */
7676

7777
if($type && 0 === strpos($type, 'image/') && $ext !== 'svg'){
7878
$ext = $type = false;
7979
}
80-
80+
8181
// Check the filename
8282
$checked = compact('ext','type','proper_filename');
8383

@@ -91,50 +91,50 @@ function esw_upload_check($checked, $file, $filename, $mimes){
9191

9292

9393

94-
/* ========================================
95-
Register activation hook.
94+
/* ========================================
95+
Register activation hook.
9696
======================================== */
9797

9898
register_activation_hook( __FILE__, 'esw_admin_notice_example_activation_hook' );
99-
99+
100100

101101
/* ========================================
102102
Runs only when the plugin is activated.
103103
======================================== */
104104

105105
function esw_admin_notice_example_activation_hook() {
106-
107-
/* ========================================
108-
Create transient data
106+
107+
/* ========================================
108+
Create transient data
109109
======================================== */
110110

111111
set_transient( 'esw-admin-notice-example', true, 5 );
112112
}
113-
114-
113+
114+
115115
/* Add admin notice */
116116

117117
add_action( 'admin_notices', 'esw_admin_notice_example_notice' );
118-
119-
118+
119+
120120
/* ========================================
121-
Admin Notice on Activation.
121+
Admin Notice on Activation.
122122
======================================= */
123123

124124
function esw_admin_notice_example_notice(){
125-
125+
126126
/* ==============================================
127-
Check transient, if available display notice
127+
Check transient, if available display notice
128128
============================================== */
129129

130130
if( get_transient( 'esw-admin-notice-example' ) ){ ?>
131131

132132
<div class="updated notice is-dismissible">
133133
<p>
134134
<strong>
135-
<?php _e( 'Thank you for using this plugin!' , 'easy-svg' ) ; ?>
135+
<?php _e( 'Thank you for using this plugin!' , 'easy-svg' ) ; ?>
136136
</strong><br />
137-
<?php _e( 'Go now to the Media Libary and upload your SVG Files.' , 'easy-svg' ); ?>
137+
<?php _e( 'Go now to the Media Libary and upload your SVG Files.' , 'easy-svg' ); ?>
138138
<br /><br />
139139
<?php _e( 'Kind Regards', 'easy-svg' ); ?>
140140
<br />
@@ -158,11 +158,11 @@ function esw_admin_notice_example_notice(){
158158

159159
// Add Hook for Actived Plugin
160160

161-
add_action('esw_welcome_message_active_plugin', 'esw_admin_notice_example_notice');
162-
163-
/* ========================================
164-
Load Text Domain for languages files
165-
======================================= */
161+
add_action('esw_welcome_message_active_plugin', 'esw_admin_notice_example_notice');
162+
163+
/* ========================================
164+
Load Text Domain for languages files
165+
======================================= */
166166

167167

168168
if ( ! function_exists( 'esw_multiligual_textdomain' ) ) :
@@ -173,50 +173,50 @@ function esw_multiligual_textdomain() {
173173

174174
}
175175

176-
// Add action for the translation file
176+
// Add action for the translation file
177177

178178
add_action( 'plugins_loaded', 'esw_multiligual_textdomain' );
179179

180-
// Finishing the if loop
180+
// Finishing the if loop
181181

182182
endif;
183183

184184

185185

186-
/* ========================================
187-
Add WordPress Widget
188-
======================================= */
186+
/* ========================================
187+
Add WordPress Widget
188+
======================================= */
189189

190190

191191
add_action('wp_dashboard_setup', 'esw_dashboard_widget');
192-
192+
193193
function esw_dashboard_widget() {
194194
global $wp_meta_boxes;
195-
195+
196196
wp_add_dashboard_widget('custom_help_widget', 'Easy SVG Support', 'esw_support_dashbord_widget_text');
197197
}
198-
198+
199199

200200
function esw_support_dashbord_widget_text() {
201201

202202
_e( '<h2>Welcome to EASY SVG!</h2><br /> Thank you for your installtion of my custom plugin! Do you want to Upload SVG Files? Than go to the Media Libary and Upload it! <br /><br /> Best Regards <br /> <strong>Benjamin Zekavica<strong>', 'easy-svg' );
203203
echo "<br /><br />";
204204

205-
_e( 'Version Number', 'easy-svg' );
206-
echo "&nbsp;2.0.3";
207-
205+
_e( 'Version Number', 'easy-svg' );
206+
echo "&nbsp;2.2";
207+
208208
}
209209

210-
// Add Hook for Messages
210+
// Add Hook for Messages
211211

212212
add_action('esw_support_welcome_widget_text', 'esw_support_dashbord_widget_text');
213213

214-
/* ========================================
215-
Display SVG Files in Backend
216-
======================================= */
214+
/* ========================================
215+
Display SVG Files in Backend
216+
======================================= */
217217

218218

219-
// Add JavaScipt to Backend
219+
// Add JavaScipt to Backend
220220

221221

222222
function esw_add_javascript_for_backend() {
@@ -227,7 +227,7 @@ function esw_add_javascript_for_backend() {
227227
add_action( 'admin_enqueue_scripts', 'esw_add_javascript_for_backend' );
228228

229229

230-
// Echo
230+
// Echo
231231

232232

233233
add_action('wp_AJAX_svg_get_attachment_url', 'esw_display_svg_files_backend');
@@ -239,12 +239,12 @@ function esw_display_svg_files_backend(){
239239
$url = '';
240240

241241
$attachmentID = isset($_REQUEST['attachmentID']) ? $_REQUEST['attachmentID'] : '';
242-
242+
243243
if($attachmentID){
244244
$url = wp_get_attachment_url($attachmentID);
245245
}
246246

247247
echo $url;
248248

249249
die();
250-
}
250+
}

js/scripts.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
/*
2-
Plugin Name: Easy SVG Support
2+
Plugin Name: Easy SVG Support
33
Description: Add SVG Support for WordPress.
4-
Version: 2.1
4+
Version: 2.2
55
Author: Benjamin Zekavica
66
7-
Copyright by:
8-
(c) 2017 - 2018 by Benjamin Zekavica. All rights reserved.
7+
Copyright by:
8+
(c) 2017 - 2018 by Benjamin Zekavica. All rights reserved.
99
10-
Imprint:
10+
Imprint:
1111
Benjamin Zekavica
1212
Oranienstraße 12
13-
52066 Aachen
13+
52066 Aachen
1414
1515
E-Mail: info@benjamin-zekavica.de
1616
Web: www.benjamin-zekavica.de
1717
18-
I don't give support by Mail. Please write in the
19-
community forum for questions and problems.
18+
I don't give support by Mail. Please write in the
19+
community forum for questions and problems.
2020
2121
*/
2222

2323

24-
/* Add Function with AJAX to display the thumbnail */
24+
/* Add Function with AJAX to display the thumbnail */
2525

2626
var observer = new MutationObserver(function(mutations){
2727

2828
for (var i=0; i < mutations.length; i++){
2929
for (var j=0; j < mutations[i].addedNodes.length; j++){
30-
element = $(mutations[i].addedNodes[j]);
30+
element = $(mutations[i].addedNodes[j]);
3131
if(element.attr('class')){
3232

3333
elementClass = element.attr('class');
@@ -37,10 +37,10 @@ var observer = new MutationObserver(function(mutations){
3737
if(attachmentPreview.length != 0){
3838

3939
if(attachmentPreview.attr('class').indexOf('subtype-svg+xml') != -1){
40-
40+
4141
var handler = function(element){
4242

43-
//do a WP AJAX call to get the URL
43+
//do a WP AJAX call to get the URL
4444
jQuery.AJAX({
4545

4646
url: AJAXurl,
@@ -57,7 +57,7 @@ var observer = new MutationObserver(function(mutations){
5757
}
5858
});
5959

60-
}(element);
60+
}(element);
6161

6262
}
6363
}

0 commit comments

Comments
 (0)