Version Description
Download this release
Release Info
Developer | cbaldelomar |
Plugin | Shortcodes by Angie Makes |
Version | 1.12 |
Comparing to | |
See all releases |
Code changes from version 1.11 to 1.12
- README.md +4 -0
- includes/js/admin.js +4 -4
- includes/mce/js/shortcodes_tinymce.js +1 -1
- includes/scripts.php +12 -13
- includes/settings.php +17 -1
- includes/shortcode-functions.php +11 -11
- includes/widgets.php +1 -1
- readme.txt +4 -0
- wc-shortcodes.php +3 -14
README.md
CHANGED
@@ -44,6 +44,10 @@ Use the shortcode manager in the TinyMCE text editor
|
|
44 |
|
45 |
## Changelog ##
|
46 |
|
|
|
|
|
|
|
|
|
47 |
### Version 1.11
|
48 |
|
49 |
* added countdown shortcode
|
44 |
|
45 |
## Changelog ##
|
46 |
|
47 |
+
### Version 1.12
|
48 |
+
|
49 |
+
* cleaned up some code
|
50 |
+
|
51 |
### Version 1.11
|
52 |
|
53 |
* added countdown shortcode
|
includes/js/admin.js
CHANGED
@@ -56,12 +56,12 @@
|
|
56 |
selection: prefill
|
57 |
});
|
58 |
|
59 |
-
if ( '
|
60 |
// add the single insert state
|
61 |
file_frame[frame_key].states.add([
|
62 |
// Main states.
|
63 |
new media.controller.Library({
|
64 |
-
id: '
|
65 |
title: clicked.data( 'title' ),
|
66 |
priority: 20,
|
67 |
toolbar: 'select',
|
@@ -76,11 +76,11 @@
|
|
76 |
})
|
77 |
]);
|
78 |
}
|
79 |
-
else if ( '
|
80 |
// add the single insert state
|
81 |
file_frame[frame_key].states.add([
|
82 |
new media.controller.Library({
|
83 |
-
id: '
|
84 |
title: clicked.data( 'title' ),
|
85 |
priority: 20,
|
86 |
toolbar: 'select',
|
56 |
selection: prefill
|
57 |
});
|
58 |
|
59 |
+
if ( 'wc_shortcodes_insert_single' === options.state ) {
|
60 |
// add the single insert state
|
61 |
file_frame[frame_key].states.add([
|
62 |
// Main states.
|
63 |
new media.controller.Library({
|
64 |
+
id: 'wc_shortcodes_insert_single',
|
65 |
title: clicked.data( 'title' ),
|
66 |
priority: 20,
|
67 |
toolbar: 'select',
|
76 |
})
|
77 |
]);
|
78 |
}
|
79 |
+
else if ( 'wc_shortcodes_insert_multi' === options.state ) {
|
80 |
// add the single insert state
|
81 |
file_frame[frame_key].states.add([
|
82 |
new media.controller.Library({
|
83 |
+
id: 'wc_shortcodes_insert_multi',
|
84 |
title: clicked.data( 'title' ),
|
85 |
priority: 20,
|
86 |
toolbar: 'select',
|
includes/mce/js/shortcodes_tinymce.js
CHANGED
@@ -329,7 +329,7 @@
|
|
329 |
if(id === "countdown") {
|
330 |
var d = new Date();
|
331 |
var year = d.getFullYear() + 1;
|
332 |
-
tinyMCE.activeEditor.selection.setContent('[wc_countdown date="July 23, '+year+', 6:00:00 PM" format="wdHMs" message="
|
333 |
}
|
334 |
|
335 |
|
329 |
if(id === "countdown") {
|
330 |
var d = new Date();
|
331 |
var year = d.getFullYear() + 1;
|
332 |
+
tinyMCE.activeEditor.selection.setContent('[wc_countdown date="July 23, '+year+', 6:00:00 PM" format="wdHMs" message="Your Message Here!"]');
|
333 |
}
|
334 |
|
335 |
|
includes/scripts.php
CHANGED
@@ -12,26 +12,25 @@
|
|
12 |
if( !function_exists ('wc_shortcodes_scripts') ) :
|
13 |
function wc_shortcodes_scripts() {
|
14 |
$ver = WC_SHORTCODES_VERSION;
|
15 |
-
$fc_ver = '0.3.2'; //flickclock version
|
16 |
|
17 |
if ( get_option( WC_SHORTCODES_PREFIX . 'enable_shortcode_css', true ) ) {
|
18 |
-
wp_enqueue_style( '
|
19 |
}
|
20 |
|
21 |
wp_enqueue_script('jquery');
|
22 |
-
wp_register_script( '
|
23 |
-
wp_register_script( '
|
24 |
-
wp_register_script( '
|
25 |
-
wp_register_script( '
|
26 |
-
wp_register_script( '
|
27 |
-
wp_register_script( '
|
28 |
-
wp_register_script( '
|
29 |
-
wp_register_script( '
|
30 |
-
wp_register_script( '
|
31 |
|
32 |
// countdown
|
33 |
-
wp_register_script( '
|
34 |
-
wp_register_script( '
|
35 |
}
|
36 |
add_action('wp_enqueue_scripts', 'wc_shortcodes_scripts');
|
37 |
endif;
|
12 |
if( !function_exists ('wc_shortcodes_scripts') ) :
|
13 |
function wc_shortcodes_scripts() {
|
14 |
$ver = WC_SHORTCODES_VERSION;
|
|
|
15 |
|
16 |
if ( get_option( WC_SHORTCODES_PREFIX . 'enable_shortcode_css', true ) ) {
|
17 |
+
wp_enqueue_style( 'wc-shortcodes-style', plugin_dir_url( __FILE__ ) . 'css/style.css', array( ), $ver );
|
18 |
}
|
19 |
|
20 |
wp_enqueue_script('jquery');
|
21 |
+
wp_register_script( 'wc-shortcodes-tabs', plugin_dir_url( __FILE__ ) . 'js/tabs.js', array ( 'jquery', 'jquery-ui-tabs'), $ver, true );
|
22 |
+
wp_register_script( 'wc-shortcodes-toggle', plugin_dir_url( __FILE__ ) . 'js/toggle.js', 'jquery', $ver, true );
|
23 |
+
wp_register_script( 'wc-shortcodes-accordion', plugin_dir_url( __FILE__ ) . 'js/accordion.js', array ( 'jquery', 'jquery-ui-accordion'), $ver, true );
|
24 |
+
wp_register_script( 'wc-shortcodes-prettify', plugin_dir_url( __FILE__ ) . 'js/prettify.js', array ( ), $ver, true );
|
25 |
+
wp_register_script( 'wc-shortcodes-pre', plugin_dir_url( __FILE__ ) . 'js/pre.js', array ( 'jquery' ), $ver, true );
|
26 |
+
wp_register_script( 'wc-shortcodes-googlemap', plugin_dir_url( __FILE__ ) . 'js/googlemap.js', array('jquery'), $ver, true);
|
27 |
+
wp_register_script( 'wc-shortcodes-googlemap-api', 'https://maps.googleapis.com/maps/api/js?sensor=false', array('jquery'), $ver, true);
|
28 |
+
wp_register_script( 'wc-shortcodes-skillbar', plugin_dir_url( __FILE__ ) . 'js/skillbar.js', array ( 'jquery' ), $ver, true );
|
29 |
+
wp_register_script( 'wc-shortcodes-fullwidth', plugin_dir_url( __FILE__ ) . 'js/fullwidth.js', array ( 'jquery' ), $ver, true );
|
30 |
|
31 |
// countdown
|
32 |
+
wp_register_script( 'wc-shortcodes-jquery-countdown-js', plugin_dir_url( __FILE__ ) . 'js/jquery.countdown.js', array ( 'jquery' ), $ver, true );
|
33 |
+
wp_register_script( 'wc-shortcodes-countdown', plugin_dir_url( __FILE__ ) . 'js/countdown.js', array ( 'wc-shortcodes-jquery-countdown-js' ), $ver, true );
|
34 |
}
|
35 |
add_action('wp_enqueue_scripts', 'wc_shortcodes_scripts');
|
36 |
endif;
|
includes/settings.php
CHANGED
@@ -147,7 +147,7 @@ function wc_shortcodes_options_display_image_field( $args ) {
|
|
147 |
<div class="wc-shortcodes-image-field">
|
148 |
<input name="<?php echo $option_name; ?>" id="<?php echo $option_name; ?>" class="regular-text ltr upload-input" type="text" value="<?php echo esc_attr($val); ?>" />
|
149 |
<br />
|
150 |
-
<a class="button wc-shortcodes-image-upload" data-target="#<?php echo $option_name; ?>" data-preview=".wc-shortcodes-preview-image" data-frame="select" data-state="
|
151 |
<a class="button wc-shortcodes-restore-image" data-restore="<?php echo $default; ?>" data-target="#<?php echo $option_name; ?>" data-preview=".wc-shortcodes-preview-image">Default</a>
|
152 |
<a class="button wc-shortcodes-delete-image" data-target="#<?php echo $option_name; ?>" data-preview=".wc-shortcodes-preview-image">Delete</a>
|
153 |
<p class="wc-shortcodes-preview-image"<?php echo $style; ?>><img src="<?php echo esc_attr($val); ?>" /></p>
|
@@ -226,3 +226,19 @@ function wc_shortcodes_remember_last_options_tab() {
|
|
226 |
}
|
227 |
}
|
228 |
add_action( 'admin_init', 'wc_shortcodes_remember_last_options_tab' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
<div class="wc-shortcodes-image-field">
|
148 |
<input name="<?php echo $option_name; ?>" id="<?php echo $option_name; ?>" class="regular-text ltr upload-input" type="text" value="<?php echo esc_attr($val); ?>" />
|
149 |
<br />
|
150 |
+
<a class="button wc-shortcodes-image-upload" data-target="#<?php echo $option_name; ?>" data-preview=".wc-shortcodes-preview-image" data-frame="select" data-state="wc_shortcodes_insert_single" data-fetch="url" data-title="Insert Image" data-button="Insert" data-class="media-frame wc-shortcodes-custom-uploader" title="Add Media"><span class="wp-media-buttons-icon"></span> Add Media</a>
|
151 |
<a class="button wc-shortcodes-restore-image" data-restore="<?php echo $default; ?>" data-target="#<?php echo $option_name; ?>" data-preview=".wc-shortcodes-preview-image">Default</a>
|
152 |
<a class="button wc-shortcodes-delete-image" data-target="#<?php echo $option_name; ?>" data-preview=".wc-shortcodes-preview-image">Delete</a>
|
153 |
<p class="wc-shortcodes-preview-image"<?php echo $style; ?>><img src="<?php echo esc_attr($val); ?>" /></p>
|
226 |
}
|
227 |
}
|
228 |
add_action( 'admin_init', 'wc_shortcodes_remember_last_options_tab' );
|
229 |
+
|
230 |
+
/*
|
231 |
+
* On Activation
|
232 |
+
*/
|
233 |
+
function wc_shortcodes_options_activation_hook() {
|
234 |
+
global $wc_shortcodes_options;
|
235 |
+
|
236 |
+
foreach ( $wc_shortcodes_options as $o ) {
|
237 |
+
foreach ( $o['sections'] as $oo ) {
|
238 |
+
foreach ( $oo['options'] as $ooo ) {
|
239 |
+
$option_name = WC_SHORTCODES_PREFIX . $ooo['id'];
|
240 |
+
add_option( $option_name, $ooo['default'] );
|
241 |
+
}
|
242 |
+
}
|
243 |
+
}
|
244 |
+
}
|
includes/shortcode-functions.php
CHANGED
@@ -74,7 +74,7 @@ function wc_shortcodes_fullwidth( $atts, $content = null ) {
|
|
74 |
'selector' => '#main',
|
75 |
), $atts));
|
76 |
|
77 |
-
wp_enqueue_script('
|
78 |
|
79 |
return '<div class="wc-shortcodes-full-width" data-selector="' . esc_attr($selector) . '">' . do_shortcode( $content ) . '</div>';
|
80 |
}
|
@@ -189,8 +189,8 @@ function wc_shortcodes_displaypre( $atts, $content = null ) {
|
|
189 |
return null;
|
190 |
|
191 |
if ( $code = get_post_meta($post->ID, $name, true ) ) {
|
192 |
-
wp_enqueue_script('
|
193 |
-
wp_enqueue_script('
|
194 |
//$code = preg_replace( '/[ ]{4,}|[\t]/', ' ', $code );
|
195 |
$html .= '<pre id="prettycode-'.$instance.'" class="'.$class.'">';
|
196 |
$html .= htmlspecialchars( $code );
|
@@ -268,7 +268,7 @@ if( !function_exists('wc_shortcodes_skillbar') ) {
|
|
268 |
), $atts ) );
|
269 |
|
270 |
// Enque scripts
|
271 |
-
wp_enqueue_script('
|
272 |
|
273 |
// Display the accordion ';
|
274 |
$output = '<div class="wc-shortcodes-skillbar wc-shortcodes-clearfix '. $class .'" data-percent="'. $percentage .'%">';
|
@@ -591,7 +591,7 @@ if( !function_exists('wc_shortcodes_toggle') ) {
|
|
591 |
$style = implode( ';', $style );
|
592 |
|
593 |
// Enque scripts
|
594 |
-
wp_enqueue_script('
|
595 |
|
596 |
// Display the Toggle
|
597 |
return '<div class="wc-shortcodes-toggle '. $class .'"><div class="wc-shortcodes-toggle-trigger"><a href="#">'. $title .'</a></div><div style="'.$style.'" class="wc-shortcodes-toggle-container">' . do_shortcode($content) . '</div></div>';
|
@@ -620,7 +620,7 @@ if( !function_exists('wc_shortcodes_accordion_main') ) {
|
|
620 |
$type = 'wc-shortcodes-accordion-collapse';
|
621 |
|
622 |
// Enque scripts
|
623 |
-
wp_enqueue_script('
|
624 |
|
625 |
// Display the accordion
|
626 |
return '<div class="wc-shortcodes-accordion '.$type.' '. $class .'">' . do_shortcode($content) . '</div>';
|
@@ -662,7 +662,7 @@ if (!function_exists('wc_shortcodes_tabgroup')) {
|
|
662 |
function wc_shortcodes_tabgroup( $atts, $content = null ) {
|
663 |
|
664 |
//Enque scripts
|
665 |
-
wp_enqueue_script('
|
666 |
|
667 |
// Display Tabs
|
668 |
$defaults = array();
|
@@ -818,8 +818,8 @@ if (! function_exists( 'wc_shortcodes_googlemaps' ) ) :
|
|
818 |
), $atts));
|
819 |
|
820 |
// load scripts
|
821 |
-
wp_enqueue_script('
|
822 |
-
wp_enqueue_script('
|
823 |
|
824 |
|
825 |
$output = '<div id="map_canvas_'.rand(1, 100).'" class="googlemap '. $class .'" style="height:'.$height.'px;width:100%">';
|
@@ -875,14 +875,14 @@ if( !function_exists('wc_shortcodes_countdown') ) {
|
|
875 |
extract( shortcode_atts( array(
|
876 |
'date' => '',
|
877 |
'format' => 'wdHMs',
|
878 |
-
'message' => '
|
879 |
), $atts ) );
|
880 |
|
881 |
if ( empty( $date ) ) {
|
882 |
return '<p>*Please enter a date for your countdown*</p>';
|
883 |
}
|
884 |
|
885 |
-
wp_enqueue_script('
|
886 |
|
887 |
$html = '<div class="wc-shortcodes-countdown" data-date="'.esc_attr( $date ).'" data-format="'.esc_attr( $format ).'" data-message="'.esc_attr( $message ).'"></div>';
|
888 |
$html = '<div class="wc-shortcodes-countdown-bg1">'.$html.'</div>';
|
74 |
'selector' => '#main',
|
75 |
), $atts));
|
76 |
|
77 |
+
wp_enqueue_script('wc-shortcodes-fullwidth');
|
78 |
|
79 |
return '<div class="wc-shortcodes-full-width" data-selector="' . esc_attr($selector) . '">' . do_shortcode( $content ) . '</div>';
|
80 |
}
|
189 |
return null;
|
190 |
|
191 |
if ( $code = get_post_meta($post->ID, $name, true ) ) {
|
192 |
+
wp_enqueue_script('wc-shortcodes-prettify');
|
193 |
+
wp_enqueue_script('wc-shortcodes-pre');
|
194 |
//$code = preg_replace( '/[ ]{4,}|[\t]/', ' ', $code );
|
195 |
$html .= '<pre id="prettycode-'.$instance.'" class="'.$class.'">';
|
196 |
$html .= htmlspecialchars( $code );
|
268 |
), $atts ) );
|
269 |
|
270 |
// Enque scripts
|
271 |
+
wp_enqueue_script('wc-shortcodes-skillbar');
|
272 |
|
273 |
// Display the accordion ';
|
274 |
$output = '<div class="wc-shortcodes-skillbar wc-shortcodes-clearfix '. $class .'" data-percent="'. $percentage .'%">';
|
591 |
$style = implode( ';', $style );
|
592 |
|
593 |
// Enque scripts
|
594 |
+
wp_enqueue_script('wc-shortcodes-toggle');
|
595 |
|
596 |
// Display the Toggle
|
597 |
return '<div class="wc-shortcodes-toggle '. $class .'"><div class="wc-shortcodes-toggle-trigger"><a href="#">'. $title .'</a></div><div style="'.$style.'" class="wc-shortcodes-toggle-container">' . do_shortcode($content) . '</div></div>';
|
620 |
$type = 'wc-shortcodes-accordion-collapse';
|
621 |
|
622 |
// Enque scripts
|
623 |
+
wp_enqueue_script('wc-shortcodes-accordion');
|
624 |
|
625 |
// Display the accordion
|
626 |
return '<div class="wc-shortcodes-accordion '.$type.' '. $class .'">' . do_shortcode($content) . '</div>';
|
662 |
function wc_shortcodes_tabgroup( $atts, $content = null ) {
|
663 |
|
664 |
//Enque scripts
|
665 |
+
wp_enqueue_script('wc-shortcodes-tabs');
|
666 |
|
667 |
// Display Tabs
|
668 |
$defaults = array();
|
818 |
), $atts));
|
819 |
|
820 |
// load scripts
|
821 |
+
wp_enqueue_script('wc-shortcodes-googlemap');
|
822 |
+
wp_enqueue_script('wc-shortcodes-googlemap-api');
|
823 |
|
824 |
|
825 |
$output = '<div id="map_canvas_'.rand(1, 100).'" class="googlemap '. $class .'" style="height:'.$height.'px;width:100%">';
|
875 |
extract( shortcode_atts( array(
|
876 |
'date' => '',
|
877 |
'format' => 'wdHMs',
|
878 |
+
'message' => 'Your Message Here!',
|
879 |
), $atts ) );
|
880 |
|
881 |
if ( empty( $date ) ) {
|
882 |
return '<p>*Please enter a date for your countdown*</p>';
|
883 |
}
|
884 |
|
885 |
+
wp_enqueue_script('wc-shortcodes-countdown');
|
886 |
|
887 |
$html = '<div class="wc-shortcodes-countdown" data-date="'.esc_attr( $date ).'" data-format="'.esc_attr( $format ).'" data-message="'.esc_attr( $message ).'"></div>';
|
888 |
$html = '<div class="wc-shortcodes-countdown-bg1">'.$html.'</div>';
|
includes/widgets.php
CHANGED
@@ -23,7 +23,7 @@ add_action('widgets_init', 'wc_shortcodes_register_widgets');
|
|
23 |
class WC_Shortcodes_Social_Icons_Widget extends WP_Widget {
|
24 |
function __construct() {
|
25 |
$widget_ops = array( 'description' => __('Add your social icons to your sidebar.') );
|
26 |
-
parent::__construct( 'wc_shortcodes_social_icons', __('Social Icons'), $widget_ops );
|
27 |
}
|
28 |
|
29 |
function widget($args, $instance) {
|
23 |
class WC_Shortcodes_Social_Icons_Widget extends WP_Widget {
|
24 |
function __construct() {
|
25 |
$widget_ops = array( 'description' => __('Add your social icons to your sidebar.') );
|
26 |
+
parent::__construct( 'wc_shortcodes_social_icons', __('WordPress Canvas - Social Icons'), $widget_ops );
|
27 |
}
|
28 |
|
29 |
function widget($args, $instance) {
|
readme.txt
CHANGED
@@ -44,6 +44,10 @@ Use the shortcode manager in the TinyMCE text editor
|
|
44 |
|
45 |
== Changelog ==
|
46 |
|
|
|
|
|
|
|
|
|
47 |
### Version 1.11
|
48 |
|
49 |
* added countdown shortcode
|
44 |
|
45 |
== Changelog ==
|
46 |
|
47 |
+
### Version 1.12
|
48 |
+
|
49 |
+
* cleaned up some code
|
50 |
+
|
51 |
### Version 1.11
|
52 |
|
53 |
* added countdown shortcode
|
wc-shortcodes.php
CHANGED
@@ -5,12 +5,13 @@ Plugin URI: http://wordpresscanvas.com/features/shortcodes/
|
|
5 |
Description: A family of shortcodes to enhance site functionality.
|
6 |
Author: Chris Baldelomar
|
7 |
Author URI: http://webplantmedia.com/
|
8 |
-
Version: 1.
|
9 |
License: GPLv2 or later
|
10 |
*/
|
11 |
|
12 |
-
define( 'WC_SHORTCODES_VERSION', '1.
|
13 |
define( 'WC_SHORTCODES_PREFIX', 'wc_shortcodes_' );
|
|
|
14 |
define( 'WC_SHORTCODES_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
15 |
|
16 |
global $wc_shortcodes_options;
|
@@ -23,16 +24,4 @@ require_once( dirname(__FILE__) . '/includes/shortcode-functions.php'); // Main
|
|
23 |
require_once( dirname(__FILE__) . '/includes/mce/shortcodes_tinymce.php'); // Add mce buttons to post editor
|
24 |
require_once( dirname(__FILE__) . '/includes/widgets.php' ); // include any widgets
|
25 |
|
26 |
-
function wc_shortcodes_options_activation_hook() {
|
27 |
-
global $wc_shortcodes_options;
|
28 |
-
|
29 |
-
foreach ( $wc_shortcodes_options as $o ) {
|
30 |
-
foreach ( $o['sections'] as $oo ) {
|
31 |
-
foreach ( $oo['options'] as $ooo ) {
|
32 |
-
$option_name = WC_SHORTCODES_PREFIX . $ooo['id'];
|
33 |
-
add_option( $option_name, $ooo['default'] );
|
34 |
-
}
|
35 |
-
}
|
36 |
-
}
|
37 |
-
}
|
38 |
register_activation_hook( __FILE__, 'wc_shortcodes_options_activation_hook' );
|
5 |
Description: A family of shortcodes to enhance site functionality.
|
6 |
Author: Chris Baldelomar
|
7 |
Author URI: http://webplantmedia.com/
|
8 |
+
Version: 1.12
|
9 |
License: GPLv2 or later
|
10 |
*/
|
11 |
|
12 |
+
define( 'WC_SHORTCODES_VERSION', '1.12' );
|
13 |
define( 'WC_SHORTCODES_PREFIX', 'wc_shortcodes_' );
|
14 |
+
define( '_WC_SHORTCODES_PREFIX', '_wc_shortcodes_' );
|
15 |
define( 'WC_SHORTCODES_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
16 |
|
17 |
global $wc_shortcodes_options;
|
24 |
require_once( dirname(__FILE__) . '/includes/mce/shortcodes_tinymce.php'); // Add mce buttons to post editor
|
25 |
require_once( dirname(__FILE__) . '/includes/widgets.php' ); // include any widgets
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
register_activation_hook( __FILE__, 'wc_shortcodes_options_activation_hook' );
|