Version Description
- New: Search box for shortcodes in admin page.
Download this release
Release Info
Developer | vaakash |
Plugin | Shortcoder |
Version | 4.1.2 |
Comparing to | |
See all releases |
Code changes from version 4.1.1 to 4.1.2
- admin/css/style-insert.css +5 -0
- admin/css/style.css +22 -0
- admin/js/script-insert.js +22 -0
- admin/js/script.js +38 -1
- admin/sc-admin.php +3 -1
- admin/sc-insert.php +1 -0
- readme.txt +6 -3
- shortcoder.php +3 -3
admin/css/style-insert.css
CHANGED
@@ -139,6 +139,11 @@ hr{
|
|
139 |
opacity: 1;
|
140 |
}
|
141 |
|
|
|
|
|
|
|
|
|
|
|
142 |
.coffee_box{
|
143 |
padding: 10px;
|
144 |
border: 1px solid #4CAF50;
|
139 |
opacity: 1;
|
140 |
}
|
141 |
|
142 |
+
.search_box{
|
143 |
+
width: 150px;
|
144 |
+
cursor: auto;
|
145 |
+
}
|
146 |
+
|
147 |
.coffee_box{
|
148 |
padding: 10px;
|
149 |
border: 1px solid #4CAF50;
|
admin/css/style.css
CHANGED
@@ -321,6 +321,28 @@ h1.sc_title .title-count {
|
|
321 |
#import_form{
|
322 |
display: none;
|
323 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
|
325 |
.sc_note{
|
326 |
background: #f5f9f9;
|
321 |
#import_form{
|
322 |
display: none;
|
323 |
}
|
324 |
+
.search_btn .search_box{
|
325 |
+
display: none;
|
326 |
+
}
|
327 |
+
.search_btn.active .search_box{
|
328 |
+
display: inline;
|
329 |
+
}
|
330 |
+
.search_box{
|
331 |
+
height: 26px;
|
332 |
+
border: 0;
|
333 |
+
margin: 0 -10px 0 10px;
|
334 |
+
border-left: 1px solid #ccc;
|
335 |
+
border-radius: 0 3px 3px 0;
|
336 |
+
}
|
337 |
+
.search_btn .dashicons-search{
|
338 |
+
position: relative;
|
339 |
+
}
|
340 |
+
.search_btn.filtered .dashicons-search{
|
341 |
+
color: #f44336;
|
342 |
+
}
|
343 |
+
.search_empty_msg{
|
344 |
+
margin: 40px 0 20px 0;
|
345 |
+
}
|
346 |
|
347 |
.sc_note{
|
348 |
background: #f5f9f9;
|
admin/js/script-insert.js
CHANGED
@@ -87,6 +87,28 @@ $(document).ready(function(){
|
|
87 |
sort( $( '.sc_shortcode' ), last_sort );
|
88 |
});
|
89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
});
|
91 |
|
92 |
})( jQuery );
|
87 |
sort( $( '.sc_shortcode' ), last_sort );
|
88 |
});
|
89 |
|
90 |
+
$( document ).on( 'keyup', '.search_box', function(){
|
91 |
+
var re = new RegExp($(this).val(), 'g');
|
92 |
+
$('.sc_wrap .sc_shortcode').each(function(){
|
93 |
+
var name = $(this).attr('data-name');
|
94 |
+
if( name.match(re) === null ){
|
95 |
+
$(this).hide();
|
96 |
+
}else{
|
97 |
+
$(this).show();
|
98 |
+
}
|
99 |
+
});
|
100 |
+
|
101 |
+
var visible = $('.sc_wrap .sc_shortcode:visible').length;
|
102 |
+
var $no_scs_msg = $('.sc_wrap').find('p');
|
103 |
+
if( visible == 0 ){
|
104 |
+
if( $no_scs_msg.length == 0 ){
|
105 |
+
$('.sc_wrap').append( '<p align="center"><i>No shortcodes match search term !</i></p>' );
|
106 |
+
}
|
107 |
+
}else{
|
108 |
+
$no_scs_msg.remove();
|
109 |
+
}
|
110 |
+
});
|
111 |
+
|
112 |
});
|
113 |
|
114 |
})( jQuery );
|
admin/js/script.js
CHANGED
@@ -158,10 +158,47 @@ $(document).ready(function(){
|
|
158 |
});
|
159 |
|
160 |
$( document ).on( 'change', '#import', function(){
|
161 |
-
|
162 |
if( confirm( $( '.import_desc' ).text() ) ){
|
163 |
$( '#import_form' ).submit();
|
164 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
|
166 |
});
|
167 |
|
158 |
});
|
159 |
|
160 |
$( document ).on( 'change', '#import', function(){
|
|
|
161 |
if( confirm( $( '.import_desc' ).text() ) ){
|
162 |
$( '#import_form' ).submit();
|
163 |
}
|
164 |
+
});
|
165 |
+
|
166 |
+
$( document ).on( 'click', '.search_btn', function(e){
|
167 |
+
var $search_box = $(this).find('.search_box');
|
168 |
+
if(e.target === $search_box[0]){
|
169 |
+
return false;
|
170 |
+
}
|
171 |
+
$(this).toggleClass('active');
|
172 |
+
$search_box.focus();
|
173 |
+
});
|
174 |
+
|
175 |
+
$( document ).on( 'keyup', '.search_box', function(){
|
176 |
+
var search_term = $(this).val();
|
177 |
+
var re = new RegExp(search_term, 'g');
|
178 |
+
$('.sc_list li').each(function(){
|
179 |
+
var name = $(this).attr('data-name');
|
180 |
+
if(name.match(re) === null){
|
181 |
+
$(this).hide();
|
182 |
+
}else{
|
183 |
+
$(this).show();
|
184 |
+
}
|
185 |
+
});
|
186 |
+
|
187 |
+
if(search_term){
|
188 |
+
$(this).parent().addClass('filtered');
|
189 |
+
}else{
|
190 |
+
$(this).parent().removeClass('filtered');
|
191 |
+
}
|
192 |
+
|
193 |
+
var visible = $('.sc_list li:visible').length;
|
194 |
+
var $no_scs_msg = $('.sc_list').find('p');
|
195 |
+
if( visible == 0 ){
|
196 |
+
if( $no_scs_msg.length == 0 ){
|
197 |
+
$('.sc_list').append( '<p align="center" class="search_empty_msg"><i>No shortcodes match search term !</i></p>' );
|
198 |
+
}
|
199 |
+
}else{
|
200 |
+
$no_scs_msg.remove();
|
201 |
+
}
|
202 |
|
203 |
});
|
204 |
|
admin/sc-admin.php
CHANGED
@@ -91,6 +91,8 @@ class Shortcoder_Admin{
|
|
91 |
echo '<h3 class="page_title">' . __( 'List of shortcodes created', 'shortcoder' );
|
92 |
echo '<span class="sc_menu">';
|
93 |
|
|
|
|
|
94 |
echo '<label for="import" class="button"><span class="dashicons dashicons-upload"></span><em>' . __( 'Import shortcodes', 'shortcoder' ) . '</em></label>';
|
95 |
|
96 |
echo '<a href="' . self::get_link(array(
|
@@ -436,7 +438,7 @@ class Shortcoder_Admin{
|
|
436 |
<a href="https://goo.gl/URfxp2" class="help_link" target="_blank" title="Report issue"><span class="dashicons dashicons-flag"></span></a>
|
437 |
|
438 |
<a class="share_btn googleplus" href="https://plus.google.com/share?url=https%3A%2F%2Fwww.aakashweb.com%2Fwordpress-plugins%2Fshortcoder%2F" target="_blank"><span class="dashicons dashicons-googleplus"></span> Share</a>
|
439 |
-
<a class="share_btn twitter" href="https://twitter.com/intent/tweet?ref_src=twsrc%5Etfw&related=vaakash&text=Check%20out%20Shortcoder,%20a%20%23wordpress%20plugin%20to%20create%20shortcodes%20for%20HTML,%20JavaScript%20snippets%20easily&tw_p=tweetbutton&url=https%3A%2F%2Fwww.aakashweb.com%2Fwordpress-plugins%
|
440 |
|
441 |
</div>';
|
442 |
}
|
91 |
echo '<h3 class="page_title">' . __( 'List of shortcodes created', 'shortcoder' );
|
92 |
echo '<span class="sc_menu">';
|
93 |
|
94 |
+
echo '<span class="button search_btn" title="' . __( 'Search shortcodes', 'shortcoder' ) . '"><span class="dashicons dashicons-search"></span><input type="search" class="search_box" placeholder="Search ..."/></span>';
|
95 |
+
|
96 |
echo '<label for="import" class="button"><span class="dashicons dashicons-upload"></span><em>' . __( 'Import shortcodes', 'shortcoder' ) . '</em></label>';
|
97 |
|
98 |
echo '<a href="' . self::get_link(array(
|
438 |
<a href="https://goo.gl/URfxp2" class="help_link" target="_blank" title="Report issue"><span class="dashicons dashicons-flag"></span></a>
|
439 |
|
440 |
<a class="share_btn googleplus" href="https://plus.google.com/share?url=https%3A%2F%2Fwww.aakashweb.com%2Fwordpress-plugins%2Fshortcoder%2F" target="_blank"><span class="dashicons dashicons-googleplus"></span> Share</a>
|
441 |
+
<a class="share_btn twitter" href="https://twitter.com/intent/tweet?ref_src=twsrc%5Etfw&related=vaakash&text=Check%20out%20Shortcoder,%20a%20%23wordpress%20plugin%20to%20create%20shortcodes%20for%20HTML,%20JavaScript%20snippets%20easily&tw_p=tweetbutton&url=https%3A%2F%2Fwww.aakashweb.com%2Fwordpress-plugins%2Fshortcoder%2F&via=vaakash" target="_blank"><span class="dashicons dashicons-twitter"></span> Tweet about Shortcoder</a>
|
442 |
|
443 |
</div>';
|
444 |
}
|
admin/sc-insert.php
CHANGED
@@ -9,6 +9,7 @@
|
|
9 |
|
10 |
<h2 class="sc_head">Insert shortcode to editor
|
11 |
<span class="sc_menu">
|
|
|
12 |
<a href="#" class="button sort_btn">Sort list</a>
|
13 |
<a href="<?php echo admin_url( 'options-general.php?page=shortcoder&action=new' ); ?>" target="_blank" class="button new_btn">Create new shortcode</a>
|
14 |
</span>
|
9 |
|
10 |
<h2 class="sc_head">Insert shortcode to editor
|
11 |
<span class="sc_menu">
|
12 |
+
<input type="search" class="button search_box" placeholder="Search ..." />
|
13 |
<a href="#" class="button sort_btn">Sort list</a>
|
14 |
<a href="<?php echo admin_url( 'options-general.php?page=shortcoder&action=new' ); ?>" target="_blank" class="button new_btn">Create new shortcode</a>
|
15 |
</span>
|
readme.txt
CHANGED
@@ -6,8 +6,8 @@ Tags: shortcode, html, javascript, shortcodes, short code, posts, pages, widgets
|
|
6 |
Donate link: https://goo.gl/qMF3iE
|
7 |
License: GPLv2 or later
|
8 |
Requires at least: 3.3
|
9 |
-
Tested up to: 4.
|
10 |
-
Stable tag: 4.1.
|
11 |
|
12 |
Create custom "Shortcodes" easily for HTML, JavaScript snippets and use the shortcodes within posts, pages & widgets.
|
13 |
|
@@ -30,7 +30,7 @@ Shortcoder is a plugin which allows to create a custom shortcode and store HTML,
|
|
30 |
* Insert: WordPress parameters in shortcode
|
31 |
* Visual editor for adding shortcode contents.
|
32 |
* Globally disable the shortcode when not needed.
|
33 |
-
* Can disable the shortcode
|
34 |
|
35 |
[youtube="https://www.youtube.com/watch?v=GrlRADfvjII"]
|
36 |
|
@@ -91,6 +91,9 @@ Note: When you disable a shortcode, the shortcode will not be executed in the pa
|
|
91 |
|
92 |
== Changelog ==
|
93 |
|
|
|
|
|
|
|
94 |
= 4.1.1 =
|
95 |
* Fix: HTTP 500 error because of syntax error in import module.
|
96 |
|
6 |
Donate link: https://goo.gl/qMF3iE
|
7 |
License: GPLv2 or later
|
8 |
Requires at least: 3.3
|
9 |
+
Tested up to: 4.9
|
10 |
+
Stable tag: 4.1.2
|
11 |
|
12 |
Create custom "Shortcodes" easily for HTML, JavaScript snippets and use the shortcodes within posts, pages & widgets.
|
13 |
|
30 |
* Insert: WordPress parameters in shortcode
|
31 |
* Visual editor for adding shortcode contents.
|
32 |
* Globally disable the shortcode when not needed.
|
33 |
+
* Can disable the shortcode to admins.
|
34 |
|
35 |
[youtube="https://www.youtube.com/watch?v=GrlRADfvjII"]
|
36 |
|
91 |
|
92 |
== Changelog ==
|
93 |
|
94 |
+
= 4.1.2 =
|
95 |
+
* New: Search box for shortcodes in admin page.
|
96 |
+
|
97 |
= 4.1.1 =
|
98 |
* Fix: HTTP 500 error because of syntax error in import module.
|
99 |
|
shortcoder.php
CHANGED
@@ -2,13 +2,13 @@
|
|
2 |
/*
|
3 |
Plugin Name: Shortcoder
|
4 |
Plugin URI: https://www.aakashweb.com/
|
5 |
-
Description: Shortcoder is a plugin which allows to create a custom shortcode and store HTML,
|
6 |
Author: Aakash Chakravarthy
|
7 |
-
Version: 4.1.
|
8 |
Author URI: https://www.aakashweb.com/
|
9 |
*/
|
10 |
|
11 |
-
define( 'SC_VERSION', '4.1.
|
12 |
define( 'SC_PATH', plugin_dir_path( __FILE__ ) ); // All have trailing slash
|
13 |
define( 'SC_URL', plugin_dir_url( __FILE__ ) );
|
14 |
define( 'SC_ADMIN_URL', trailingslashit( plugin_dir_url( __FILE__ ) . 'admin' ) );
|
2 |
/*
|
3 |
Plugin Name: Shortcoder
|
4 |
Plugin URI: https://www.aakashweb.com/
|
5 |
+
Description: Shortcoder is a plugin which allows to create a custom shortcode and store HTML, JavaScript and other snippets in it. So if that shortcode is used in any post or pages, then the code stored in the shortcode get executed in that place. You can create a shortcode for Youtube videos, adsense ads, buttons and more.
|
6 |
Author: Aakash Chakravarthy
|
7 |
+
Version: 4.1.2
|
8 |
Author URI: https://www.aakashweb.com/
|
9 |
*/
|
10 |
|
11 |
+
define( 'SC_VERSION', '4.1.2' );
|
12 |
define( 'SC_PATH', plugin_dir_path( __FILE__ ) ); // All have trailing slash
|
13 |
define( 'SC_URL', plugin_dir_url( __FILE__ ) );
|
14 |
define( 'SC_ADMIN_URL', trailingslashit( plugin_dir_url( __FILE__ ) . 'admin' ) );
|