Version Description
- Fixed Shortcoder not working in WordPress 4.4
- Changed the shortcoder syntax from
[sc:the_name]
to[sc name="the_name"]
permanently in effect of WordPress 4.4 changes.
Download this release
Release Info
Developer | vaakash |
Plugin | Shortcoder |
Version | 3.4.1 |
Comparing to | |
See all releases |
Code changes from version 3.4 to 3.4.1
- images/Thumbs.db +0 -0
- js/tinymce/Thumbs.db +0 -0
- readme.txt +16 -10
- sc-admin-css.css +35 -1
- sc-admin-js.js +39 -1
- sc-insert.php +5 -2
- shortcoder.php +19 -5
images/Thumbs.db
DELETED
Binary file
|
js/tinymce/Thumbs.db
DELETED
Binary file
|
readme.txt
CHANGED
@@ -6,8 +6,8 @@ Tags: shortcode, ads, adsense, advertising, bookmark, bookmarking, bookmarks, cu
|
|
6 |
Donate link: http://bit.ly/scDonate
|
7 |
License: GPLv2 or later
|
8 |
Requires at least: 3.3
|
9 |
-
Tested up to:
|
10 |
-
Stable tag: 3.4
|
11 |
|
12 |
Create custom "Shortcodes" with HTML, Javascript snippets stored in it and use that shortcode within posts and pages. Check the demo video.
|
13 |
|
@@ -15,14 +15,12 @@ Create custom "Shortcodes" with HTML, Javascript snippets stored in it and use t
|
|
15 |
|
16 |
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 exceuted in that place.
|
17 |
|
18 |
-
[Check out the **LIVE DEMO** of the plugin](http://www.aakashweb.com/demos/super-rss-reader/)
|
19 |
-
|
20 |
= Features =
|
21 |
|
22 |
* Create **"custom shortcodes"** easily and use them within WordPress posts
|
23 |
-
* Use any name for the created shortcode (ex: `[sc
|
24 |
* Use any kind of **HTML** as Shortcode content.
|
25 |
-
* Parameters can also added to HTML (ex: `<strong>%%mytext%%</strong> [sc
|
26 |
* Visual editor for adding shortcode contents.
|
27 |
* Global tinyMCE button available in the editing toolbar for inserting created shortcodes.
|
28 |
* Globally disable the shortcode when not needed.
|
@@ -34,15 +32,19 @@ Shortcoder is a plugin which allows to create a custom shortcode and store HTML,
|
|
34 |
|
35 |
1. Create a shortcode named "adsenseAd" in the Shortcoder admin page.
|
36 |
1. Paste the adsense code in the box given and save it.
|
37 |
-
1. Use `[sc
|
38 |
1. Tada !!! the ad appears in the post.
|
39 |
|
40 |
* Using this idea, shortcodes can be created for frequently used snippets.
|
41 |
-
* You can also add parameters (like `%%id%%`) inside the snippets, and vary it like `[sc
|
42 |
* This plugin will be hugely useful to all !!!
|
43 |
|
44 |
DONATE: If you like this plugin, you can show your [support by donating some amount](http://bit.ly/scDonate).
|
45 |
|
|
|
|
|
|
|
|
|
46 |
= Resources =
|
47 |
|
48 |
* [Documentation](http://www.aakashweb.com/wordpress-plugins/shortcoder/)
|
@@ -57,7 +59,7 @@ DONATE: If you like this plugin, you can show your [support by donating some amo
|
|
57 |
1. Go to the "Shortcoder" admin page. Admin page is under the "Settings" menu.
|
58 |
1. Enter a shortcode name.
|
59 |
1. Paste some code in it.
|
60 |
-
1. Then use the shortcode `[sc
|
61 |
1. That's all !
|
62 |
|
63 |
You can also insert some parameters within the post. Check this page to [learn more](http://www.aakashweb.com/wordpress-plugins/shortcoder/).
|
@@ -68,7 +70,7 @@ Please visit the [Plugin homepage](http://www.aakashweb.com/wordpress-plugins/sh
|
|
68 |
|
69 |
= I've created a shortcode, how to use it ? =
|
70 |
|
71 |
-
For example, consider you made a shortcode "advertisement". Then you should use the shortcode `[sc
|
72 |
|
73 |
= How to temporarily disable a shortcode ? =
|
74 |
|
@@ -88,6 +90,10 @@ Note: When you disable a shortcode, the shortcode will not be executed in the pa
|
|
88 |
|
89 |
== Changelog ==
|
90 |
|
|
|
|
|
|
|
|
|
91 |
= 3.4 =
|
92 |
* New feature: Embedded/Nested shortcodes is now supported.
|
93 |
* New feature: Full fledged native WordPress editor for adding shortcode content with media buttons.
|
6 |
Donate link: http://bit.ly/scDonate
|
7 |
License: GPLv2 or later
|
8 |
Requires at least: 3.3
|
9 |
+
Tested up to: 4.4
|
10 |
+
Stable tag: 3.4.1
|
11 |
|
12 |
Create custom "Shortcodes" with HTML, Javascript snippets stored in it and use that shortcode within posts and pages. Check the demo video.
|
13 |
|
15 |
|
16 |
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 exceuted in that place.
|
17 |
|
|
|
|
|
18 |
= Features =
|
19 |
|
20 |
* Create **"custom shortcodes"** easily and use them within WordPress posts
|
21 |
+
* Use any name for the created shortcode (ex: `[sc name="youtube"]`)
|
22 |
* Use any kind of **HTML** as Shortcode content.
|
23 |
+
* Parameters can also added to HTML (ex: `<strong>%%mytext%%</strong> [sc name="testing" mytext="hello"]` )
|
24 |
* Visual editor for adding shortcode contents.
|
25 |
* Global tinyMCE button available in the editing toolbar for inserting created shortcodes.
|
26 |
* Globally disable the shortcode when not needed.
|
32 |
|
33 |
1. Create a shortcode named "adsenseAd" in the Shortcoder admin page.
|
34 |
1. Paste the adsense code in the box given and save it.
|
35 |
+
1. Use `[sc name="adsenseAd"]` in your posts and pages.
|
36 |
1. Tada !!! the ad appears in the post.
|
37 |
|
38 |
* Using this idea, shortcodes can be created for frequently used snippets.
|
39 |
+
* You can also add parameters (like `%%id%%`) inside the snippets, and vary it like `[sc name="youtube" id="GrlRADfvjII"]`
|
40 |
* This plugin will be hugely useful to all !!!
|
41 |
|
42 |
DONATE: If you like this plugin, you can show your [support by donating some amount](http://bit.ly/scDonate).
|
43 |
|
44 |
+
= Fix for WordPress 4.4 issue =
|
45 |
+
|
46 |
+
Starting Shortcoder 3.4.1 the syntax for shortcoder is [sc name="your shortcode"]. This is in effect to the shortcode API related changes made in WordPress core which made old the syntax unrecognizable. Version 3.4.1 automatically recognizes the old syntax only in posts where the shortcode is inserted directly and not in widgets or in drag and drop themes modules. Those areas need to be manually replaced from old `[sc:my_shortcode]` to the new `[sc name="my_shortcode"]` syntax. Please use the below resources for any queries.
|
47 |
+
|
48 |
= Resources =
|
49 |
|
50 |
* [Documentation](http://www.aakashweb.com/wordpress-plugins/shortcoder/)
|
59 |
1. Go to the "Shortcoder" admin page. Admin page is under the "Settings" menu.
|
60 |
1. Enter a shortcode name.
|
61 |
1. Paste some code in it.
|
62 |
+
1. Then use the shortcode `[sc name="name of the shortcode"]` in your post. ex: If "youtube" is the shortcode name, then just use `[sc name="youtube"]` in your posts
|
63 |
1. That's all !
|
64 |
|
65 |
You can also insert some parameters within the post. Check this page to [learn more](http://www.aakashweb.com/wordpress-plugins/shortcoder/).
|
70 |
|
71 |
= I've created a shortcode, how to use it ? =
|
72 |
|
73 |
+
For example, consider you made a shortcode "advertisement". Then you should use the shortcode `[sc name="advertisement"]` in your post.
|
74 |
|
75 |
= How to temporarily disable a shortcode ? =
|
76 |
|
90 |
|
91 |
== Changelog ==
|
92 |
|
93 |
+
= 3.4.1 =
|
94 |
+
* Fixed Shortcoder not working in WordPress 4.4
|
95 |
+
* Changed the shortcoder syntax from `[sc:the_name]` to `[sc name="the_name"]` permanently in effect of WordPress 4.4 changes.
|
96 |
+
|
97 |
= 3.4 =
|
98 |
* New feature: Embedded/Nested shortcodes is now supported.
|
99 |
* New feature: Full fledged native WordPress editor for adding shortcode content with media buttons.
|
sc-admin-css.css
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
/*
|
2 |
* Admin Page CSS for Shortcoder plugin
|
3 |
* Author : Aakash Chakravarthy
|
4 |
-
* Version : 3.
|
5 |
*/
|
6 |
.wrap{
|
7 |
margin: 15px auto 15px;
|
@@ -182,6 +182,40 @@
|
|
182 |
margin: 10px 0 20px 0;
|
183 |
font-size: 10px;
|
184 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
.smallText{
|
186 |
font-size: 11px;
|
187 |
color: #333333;
|
1 |
/*
|
2 |
* Admin Page CSS for Shortcoder plugin
|
3 |
* Author : Aakash Chakravarthy
|
4 |
+
* Version : 3.3
|
5 |
*/
|
6 |
.wrap{
|
7 |
margin: 15px auto 15px;
|
182 |
margin: 10px 0 20px 0;
|
183 |
font-size: 10px;
|
184 |
}
|
185 |
+
|
186 |
+
/** Modal **/
|
187 |
+
.sc_modal {
|
188 |
+
position: fixed;
|
189 |
+
z-index: 99999;
|
190 |
+
top: 20%;
|
191 |
+
left: 30%;
|
192 |
+
right: 30%;
|
193 |
+
bottom: 20%;
|
194 |
+
background: #FFF;
|
195 |
+
box-shadow: 0 8px 21px -8px #000;
|
196 |
+
border-radius: 5px;
|
197 |
+
padding: 20px;
|
198 |
+
outline: 1000px solid rgba(255, 255, 255, 0.86);
|
199 |
+
border: 3px solid #D8D8D8;
|
200 |
+
overflow: auto;
|
201 |
+
display: none;
|
202 |
+
}
|
203 |
+
.sc_modal_close {
|
204 |
+
color: #777;
|
205 |
+
font: 14px/100% arial, sans-serif;
|
206 |
+
position: absolute;
|
207 |
+
right: 5px;
|
208 |
+
text-decoration: none;
|
209 |
+
text-shadow: 0 1px 0 #fff;
|
210 |
+
padding: 10px;
|
211 |
+
cursor: pointer;
|
212 |
+
font-weight: bold;
|
213 |
+
top: 0;
|
214 |
+
}
|
215 |
+
.sc_modal_close:after {
|
216 |
+
content: 'X';
|
217 |
+
}
|
218 |
+
|
219 |
.smallText{
|
220 |
font-size: 11px;
|
221 |
color: #333333;
|
sc-admin-js.js
CHANGED
@@ -59,6 +59,11 @@ $j(document).ready(function(){
|
|
59 |
$j(this).remove();
|
60 |
});
|
61 |
|
|
|
|
|
|
|
|
|
|
|
62 |
});
|
63 |
|
64 |
var sc_closeiframe = function(){
|
@@ -67,14 +72,17 @@ var sc_closeiframe = function(){
|
|
67 |
|
68 |
function sc_triggerElements(val){
|
69 |
if(val != ''){
|
|
|
|
|
70 |
if(sc_wsc(val)){
|
71 |
code = '"' + val + '"';
|
72 |
}else{
|
73 |
code = val;
|
74 |
}
|
|
|
75 |
|
76 |
$j('#sc_code').show();
|
77 |
-
$j('#sc_code').html('Your shortcode is <b contenteditable="true" disabled="disabled">[sc
|
78 |
$j('#sc_submit').removeClass('sc_btdisabled').removeAttr('disabled');
|
79 |
}else{
|
80 |
$j('#sc_code').hide();
|
@@ -82,6 +90,36 @@ function sc_triggerElements(val){
|
|
82 |
}
|
83 |
}
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
function sc_wsc(s) {
|
86 |
return s.indexOf(' ') >= 0;
|
87 |
}
|
59 |
$j(this).remove();
|
60 |
});
|
61 |
|
62 |
+
$j( '.sc_modal_close' ).click(function(){
|
63 |
+
sc_modal( 'close' );
|
64 |
+
});
|
65 |
+
|
66 |
+
sc_modal( 'show' );
|
67 |
});
|
68 |
|
69 |
var sc_closeiframe = function(){
|
72 |
|
73 |
function sc_triggerElements(val){
|
74 |
if(val != ''){
|
75 |
+
|
76 |
+
// Not used
|
77 |
if(sc_wsc(val)){
|
78 |
code = '"' + val + '"';
|
79 |
}else{
|
80 |
code = val;
|
81 |
}
|
82 |
+
//
|
83 |
|
84 |
$j('#sc_code').show();
|
85 |
+
$j('#sc_code').html('Your shortcode is <b contenteditable="true" disabled="disabled">[sc name="' + val + '"]</b>');
|
86 |
$j('#sc_submit').removeClass('sc_btdisabled').removeAttr('disabled');
|
87 |
}else{
|
88 |
$j('#sc_code').hide();
|
90 |
}
|
91 |
}
|
92 |
|
93 |
+
function sc_modal( action ){
|
94 |
+
|
95 |
+
if( typeof( localStorage ) !== "undefined" ){
|
96 |
+
if( action == 'show' ){
|
97 |
+
|
98 |
+
if ( localStorage[ 'sc_modal_' + sc_version ] == null ){
|
99 |
+
|
100 |
+
$j.ajax({
|
101 |
+
type: 'GET',
|
102 |
+
dataType: 'html',
|
103 |
+
crossDomain: true,
|
104 |
+
url: 'https://raw.githubusercontent.com/vaakash/aakash-web/master/misc/release_notes/shortcoder_v341.html',
|
105 |
+
success: function ( data ) {
|
106 |
+
$j('.sc_modal > div').html( data );
|
107 |
+
$j('.sc_modal').fadeIn();
|
108 |
+
}
|
109 |
+
});
|
110 |
+
|
111 |
+
}
|
112 |
+
|
113 |
+
} else if( action == 'close' ){
|
114 |
+
|
115 |
+
localStorage[ 'sc_modal_' + sc_version ] = 'closed';
|
116 |
+
$j('.sc_modal').hide();
|
117 |
+
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
}
|
122 |
+
|
123 |
function sc_wsc(s) {
|
124 |
return s.indexOf(' ') >= 0;
|
125 |
}
|
sc-insert.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Shortcoder include for inserting and editing shortcodes in post and pages
|
4 |
-
* v1.
|
5 |
**/
|
6 |
|
7 |
if ( ! isset( $_GET['TB_iframe'] ) )
|
@@ -129,12 +129,15 @@ $(document).ready(function(){
|
|
129 |
}
|
130 |
});
|
131 |
|
|
|
132 |
if(wsc(scname)){
|
133 |
name = '"' + scname + '"';
|
134 |
}else{
|
135 |
name = scname;
|
136 |
}
|
137 |
-
|
|
|
|
|
138 |
|
139 |
if( typeof parent.send_to_editor !== undefined ){
|
140 |
parent.send_to_editor(sc);
|
1 |
<?php
|
2 |
/**
|
3 |
* Shortcoder include for inserting and editing shortcodes in post and pages
|
4 |
+
* v1.3
|
5 |
**/
|
6 |
|
7 |
if ( ! isset( $_GET['TB_iframe'] ) )
|
129 |
}
|
130 |
});
|
131 |
|
132 |
+
// Not used
|
133 |
if(wsc(scname)){
|
134 |
name = '"' + scname + '"';
|
135 |
}else{
|
136 |
name = scname;
|
137 |
}
|
138 |
+
//
|
139 |
+
|
140 |
+
sc = '[sc name="' + scname + '" ' + params + ']';
|
141 |
|
142 |
if( typeof parent.send_to_editor !== undefined ){
|
143 |
parent.send_to_editor(sc);
|
shortcoder.php
CHANGED
@@ -4,11 +4,11 @@ Plugin Name: Shortcoder
|
|
4 |
Plugin URI: http://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 exceuted in that place. You can create a shortcode for Youtube videos, adsense ads, buttons and more.
|
6 |
Author: Aakash Chakravarthy
|
7 |
-
Version: 3.4
|
8 |
Author URI: http://www.aakashweb.com/
|
9 |
*/
|
10 |
|
11 |
-
define('SC_VERSION', '3.4');
|
12 |
define('SC_AUTHOR', 'Aakash Chakravarthy');
|
13 |
define('SC_URL', plugins_url('',__FILE__) );
|
14 |
define('SC_ADMIN', admin_url( 'options-general.php?page=shortcoder' ) );
|
@@ -100,7 +100,7 @@ function shortcoder_all_ok($name){
|
|
100 |
function shortcoder($atts, $content) {
|
101 |
|
102 |
$sc_options = get_option('shortcoder_data');
|
103 |
-
|
104 |
// Get the Shortcode name
|
105 |
if(isset($atts[0])){
|
106 |
$sc_name = str_replace(array('"', "'", ":"), '', $atts[0]);
|
@@ -162,6 +162,12 @@ function shortcoder($atts, $content) {
|
|
162 |
}
|
163 |
|
164 |
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
|
166 |
// Shortcoder admin page
|
167 |
function sc_admin_page(){
|
@@ -229,6 +235,11 @@ function sc_admin_page(){
|
|
229 |
|
230 |
<!-- Shortcoder Admin page -->
|
231 |
|
|
|
|
|
|
|
|
|
|
|
232 |
<div class="wrap">
|
233 |
<?php sc_admin_buttons('fbrec'); ?>
|
234 |
<h2><img width="32" height="32" src="<?php echo SC_URL; ?>/images/shortcoder.png" align="absmiddle"/> Shortcoder<sup class="smallText"> v<?php echo SC_VERSION; ?></sup></h2>
|
@@ -245,13 +256,13 @@ function sc_admin_page(){
|
|
245 |
<form method="post" id="sc_form">
|
246 |
|
247 |
<div class="sc_section">
|
248 |
-
<label for="sc_name" class="sc_fld_title"><?php _e( "Title:", 'shortcoder' );
|
249 |
<span class="sc_name_wrap"><input type="text" name="sc_name" id="sc_name" value="<?php echo isset($sc_name_edit) ? $sc_name_edit : ''; ?>" placeholder="Enter a shortcode name" class="widefat" required="required"/><div id="sc_code"></div></span>
|
250 |
</div>
|
251 |
|
252 |
|
253 |
<div class="sc_section">
|
254 |
-
<label for="sc_content" class="sc_fld_title"><?php _e( "Content:", 'shortcoder' );
|
255 |
<?php wp_editor( $sc_content, 'sc_content', array( 'wpautop'=> false, 'textarea_rows'=> 8 )); ?>
|
256 |
</div>
|
257 |
|
@@ -306,6 +317,9 @@ function sc_admin_page(){
|
|
306 |
<a href="http://www.aakashweb.com/" target="_blank" class="sc_credits">a plugin from Aakash Web</a>
|
307 |
</p>
|
308 |
|
|
|
|
|
|
|
309 |
|
310 |
</div><!-- Wrap -->
|
311 |
|
4 |
Plugin URI: http://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 exceuted in that place. You can create a shortcode for Youtube videos, adsense ads, buttons and more.
|
6 |
Author: Aakash Chakravarthy
|
7 |
+
Version: 3.4.1
|
8 |
Author URI: http://www.aakashweb.com/
|
9 |
*/
|
10 |
|
11 |
+
define('SC_VERSION', '3.4.1');
|
12 |
define('SC_AUTHOR', 'Aakash Chakravarthy');
|
13 |
define('SC_URL', plugins_url('',__FILE__) );
|
14 |
define('SC_ADMIN', admin_url( 'options-general.php?page=shortcoder' ) );
|
100 |
function shortcoder($atts, $content) {
|
101 |
|
102 |
$sc_options = get_option('shortcoder_data');
|
103 |
+
|
104 |
// Get the Shortcode name
|
105 |
if(isset($atts[0])){
|
106 |
$sc_name = str_replace(array('"', "'", ":"), '', $atts[0]);
|
162 |
}
|
163 |
|
164 |
|
165 |
+
// Workaround for shortcoder not working in WordPress 4.4
|
166 |
+
function sc_replace_colon_content( $content ){
|
167 |
+
return str_replace( '[sc:', '[sc name=', $content );
|
168 |
+
}
|
169 |
+
add_filter( 'the_content', 'sc_replace_colon_content', 5 );
|
170 |
+
|
171 |
|
172 |
// Shortcoder admin page
|
173 |
function sc_admin_page(){
|
235 |
|
236 |
<!-- Shortcoder Admin page -->
|
237 |
|
238 |
+
<div class="sc_modal">
|
239 |
+
<span class="sc_modal_close"></span>
|
240 |
+
<div></div>
|
241 |
+
</div>
|
242 |
+
|
243 |
<div class="wrap">
|
244 |
<?php sc_admin_buttons('fbrec'); ?>
|
245 |
<h2><img width="32" height="32" src="<?php echo SC_URL; ?>/images/shortcoder.png" align="absmiddle"/> Shortcoder<sup class="smallText"> v<?php echo SC_VERSION; ?></sup></h2>
|
256 |
<form method="post" id="sc_form">
|
257 |
|
258 |
<div class="sc_section">
|
259 |
+
<label for="sc_name" class="sc_fld_title"><?php _e( "Title:", 'shortcoder' ); ?></label>
|
260 |
<span class="sc_name_wrap"><input type="text" name="sc_name" id="sc_name" value="<?php echo isset($sc_name_edit) ? $sc_name_edit : ''; ?>" placeholder="Enter a shortcode name" class="widefat" required="required"/><div id="sc_code"></div></span>
|
261 |
</div>
|
262 |
|
263 |
|
264 |
<div class="sc_section">
|
265 |
+
<label for="sc_content" class="sc_fld_title"><?php _e( "Content:", 'shortcoder' ); ?></label>
|
266 |
<?php wp_editor( $sc_content, 'sc_content', array( 'wpautop'=> false, 'textarea_rows'=> 8 )); ?>
|
267 |
</div>
|
268 |
|
317 |
<a href="http://www.aakashweb.com/" target="_blank" class="sc_credits">a plugin from Aakash Web</a>
|
318 |
</p>
|
319 |
|
320 |
+
<script>
|
321 |
+
var sc_version = '<?php echo SC_VERSION; ?>';
|
322 |
+
</script>
|
323 |
|
324 |
</div><!-- Wrap -->
|
325 |
|