Version Description
Download this release
Release Info
| Developer | cbaldelomar |
| Plugin | |
| Version | 1.43 |
| Comparing to | |
| See all releases | |
Code changes from version 1.42 to 1.43
- README.md +5 -0
- includes/functions.php +46 -2
- includes/mce/js/shortcodes-tinymce-4.js +1 -1
- includes/mce/shortcodes_tinymce.php +10 -0
- includes/options.php +13 -8
- includes/settings.php +46 -0
- includes/shortcode-functions.php +14 -27
- includes/widgets.php +6 -30
- readme.txt +5 -0
- wc-shortcodes.php +38 -2
README.md
CHANGED
|
@@ -66,6 +66,11 @@ Use the shortcode manager in the TinyMCE text editor
|
|
| 66 |
|
| 67 |
## Changelog ##
|
| 68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
### Version 1.42
|
| 70 |
|
| 71 |
* Improved social icons widget
|
| 66 |
|
| 67 |
## Changelog ##
|
| 68 |
|
| 69 |
+
### Version 1.43
|
| 70 |
+
|
| 71 |
+
* Added theme support for developers
|
| 72 |
+
* Updated settings for social media icons
|
| 73 |
+
|
| 74 |
### Version 1.42
|
| 75 |
|
| 76 |
* Improved social icons widget
|
includes/functions.php
CHANGED
|
@@ -1,4 +1,19 @@
|
|
| 1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
/**
|
| 3 |
* filter social url. For example, we want to add
|
| 4 |
* mailto: to an email address.
|
|
@@ -45,14 +60,43 @@ function wc_shortcodes_options_activation() {
|
|
| 45 |
foreach ( $o['sections'] as $oo ) {
|
| 46 |
foreach ( $oo['options'] as $ooo ) {
|
| 47 |
$option_name = WC_SHORTCODES_PREFIX . $ooo['id'];
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
}
|
| 50 |
}
|
| 51 |
}
|
| 52 |
}
|
| 53 |
}
|
| 54 |
-
add_action( '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
/**
|
| 58 |
* webpm_send_email
|
| 1 |
<?php
|
| 2 |
+
function wc_shortcodes_check_supports() {
|
| 3 |
+
global $wc_shortcodes_theme_support;
|
| 4 |
+
|
| 5 |
+
if ( current_theme_supports( 'wpc-shortcodes' ) ) {
|
| 6 |
+
$supports = get_theme_support( 'wpc-shortcodes' );
|
| 7 |
+
|
| 8 |
+
if ( isset( $supports[0] ) && is_array( $supports[0] ) ) {
|
| 9 |
+
foreach ( $supports[0] as $key => $value ) {
|
| 10 |
+
$wc_shortcodes_theme_support[ $key ] = $value;
|
| 11 |
+
}
|
| 12 |
+
}
|
| 13 |
+
}
|
| 14 |
+
}
|
| 15 |
+
add_action( 'init', 'wc_shortcodes_check_supports' );
|
| 16 |
+
|
| 17 |
/**
|
| 18 |
* filter social url. For example, we want to add
|
| 19 |
* mailto: to an email address.
|
| 60 |
foreach ( $o['sections'] as $oo ) {
|
| 61 |
foreach ( $oo['options'] as $ooo ) {
|
| 62 |
$option_name = WC_SHORTCODES_PREFIX . $ooo['id'];
|
| 63 |
+
if ( WC_SHORTCODES_PREFIX . 'social_icons_display' == $option_name ) {
|
| 64 |
+
$default = wc_shortcodes_default_social_icons();
|
| 65 |
+
add_option( $option_name, $default );
|
| 66 |
+
}
|
| 67 |
+
else {
|
| 68 |
+
add_option( $option_name, $ooo['default'] );
|
| 69 |
+
}
|
| 70 |
}
|
| 71 |
}
|
| 72 |
}
|
| 73 |
}
|
| 74 |
}
|
| 75 |
+
add_action( 'init', 'wc_shortcodes_options_activation' );
|
| 76 |
+
|
| 77 |
+
function wc_shortcodes_default_social_icons() {
|
| 78 |
+
global $wc_shortcodes_social_icons;
|
| 79 |
+
|
| 80 |
+
$default = $wc_shortcodes_social_icons;
|
| 81 |
|
| 82 |
+
foreach ( $wc_shortcodes_social_icons as $key => $value ) {
|
| 83 |
+
$link_option_name = WC_SHORTCODES_PREFIX . $key . '_link';
|
| 84 |
+
$icon_option_name = WC_SHORTCODES_PREFIX . $key . '_icon';
|
| 85 |
+
|
| 86 |
+
if ( $icon_url = get_option( $icon_option_name ) ) {
|
| 87 |
+
$social_link = get_option( $link_option_name );
|
| 88 |
+
|
| 89 |
+
if ( empty( $social_link ) )
|
| 90 |
+
unset( $default[ $key ] );
|
| 91 |
+
}
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
if ( empty( $default ) ) {
|
| 95 |
+
$default = $wc_shortcodes_social_icons;
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
return $default;
|
| 99 |
+
}
|
| 100 |
|
| 101 |
/**
|
| 102 |
* webpm_send_email
|
includes/mce/js/shortcodes-tinymce-4.js
CHANGED
|
@@ -334,7 +334,7 @@
|
|
| 334 |
{
|
| 335 |
text: "Full Width",
|
| 336 |
onclick: function(){
|
| 337 |
-
editor.insertContent('[wc_fullwidth selector="
|
| 338 |
}
|
| 339 |
},
|
| 340 |
{
|
| 334 |
{
|
| 335 |
text: "Full Width",
|
| 336 |
onclick: function(){
|
| 337 |
+
editor.insertContent('[wc_fullwidth selector=""]' + wcDummyContent + '[/wc_fullwidth]');
|
| 338 |
}
|
| 339 |
},
|
| 340 |
{
|
includes/mce/shortcodes_tinymce.php
CHANGED
|
@@ -2,6 +2,7 @@
|
|
| 2 |
class WC_Shortcodes_TinyMCE_Buttons {
|
| 3 |
function __construct() {
|
| 4 |
add_action( 'admin_head', array(&$this,'init') );
|
|
|
|
| 5 |
}
|
| 6 |
function init() {
|
| 7 |
if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') )
|
|
@@ -14,6 +15,15 @@ class WC_Shortcodes_TinyMCE_Buttons {
|
|
| 14 |
add_filter( 'mce_buttons', array(&$this,'register_button') );
|
| 15 |
}
|
| 16 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
function add_plugin($plugin_array) {
|
| 18 |
global $wp_version;
|
| 19 |
$ver = WC_SHORTCODES_VERSION;
|
| 2 |
class WC_Shortcodes_TinyMCE_Buttons {
|
| 3 |
function __construct() {
|
| 4 |
add_action( 'admin_head', array(&$this,'init') );
|
| 5 |
+
// add_action( 'admin_head', array( &$this, 'localize_script' ) );
|
| 6 |
}
|
| 7 |
function init() {
|
| 8 |
if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') )
|
| 15 |
add_filter( 'mce_buttons', array(&$this,'register_button') );
|
| 16 |
}
|
| 17 |
}
|
| 18 |
+
function localize_script() {
|
| 19 |
+
global $wc_shortcodes_theme_support;
|
| 20 |
+
|
| 21 |
+
?>
|
| 22 |
+
<script type="text/javascript">
|
| 23 |
+
var wpc_shortcodes = <?php echo json_encode( $wc_shortcodes_theme_support ); ?>;
|
| 24 |
+
</script>
|
| 25 |
+
<?php
|
| 26 |
+
}
|
| 27 |
function add_plugin($plugin_array) {
|
| 28 |
global $wp_version;
|
| 29 |
$ver = WC_SHORTCODES_VERSION;
|
includes/options.php
CHANGED
|
@@ -1,8 +1,20 @@
|
|
| 1 |
<?php
|
| 2 |
-
$wc_shortcodes_options = array();
|
| 3 |
$wc_shortcodes_options['social-media'] = array(
|
| 4 |
'title' => 'Social Media',
|
| 5 |
'sections' => array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
array(
|
| 7 |
'section' => 'wc-shortcodes-options-facebook-section',
|
| 8 |
'title' => 'Facebook',
|
|
@@ -285,13 +297,6 @@ $wc_shortcodes_options['social-media'] = array(
|
|
| 285 |
),
|
| 286 |
),
|
| 287 |
);
|
| 288 |
-
$wc_shortcodes_share_buttons = array(
|
| 289 |
-
'pinterest' => 'Pinterest',
|
| 290 |
-
'facebook' => 'Facebook',
|
| 291 |
-
'twitter' => 'Twitter',
|
| 292 |
-
'google' => 'Google',
|
| 293 |
-
'email' => 'Email',
|
| 294 |
-
);
|
| 295 |
$wc_shortcodes_options['share-buttons'] = array(
|
| 296 |
'title' => 'Share Buttons',
|
| 297 |
'sections' => array(
|
| 1 |
<?php
|
|
|
|
| 2 |
$wc_shortcodes_options['social-media'] = array(
|
| 3 |
'title' => 'Social Media',
|
| 4 |
'sections' => array(
|
| 5 |
+
array(
|
| 6 |
+
'section' => 'wc-shortcodes-options-social-display-section',
|
| 7 |
+
'title' => 'Display',
|
| 8 |
+
'options' => array(
|
| 9 |
+
array(
|
| 10 |
+
'id' => 'social_icons_display',
|
| 11 |
+
'title' => 'Order / Show / Hide',
|
| 12 |
+
'default' => $wc_shortcodes_social_icons,
|
| 13 |
+
'description' => '',
|
| 14 |
+
'type' => 'social_icons',
|
| 15 |
+
),
|
| 16 |
+
),
|
| 17 |
+
),
|
| 18 |
array(
|
| 19 |
'section' => 'wc-shortcodes-options-facebook-section',
|
| 20 |
'title' => 'Facebook',
|
| 297 |
),
|
| 298 |
),
|
| 299 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 300 |
$wc_shortcodes_options['share-buttons'] = array(
|
| 301 |
'title' => 'Share Buttons',
|
| 302 |
'sections' => array(
|
includes/settings.php
CHANGED
|
@@ -139,6 +139,9 @@ function wc_shortcodes_options_display_setting( $args ) {
|
|
| 139 |
case 'share_buttons' :
|
| 140 |
wc_shortcodes_options_display_share_buttons_field( $args );
|
| 141 |
break;
|
|
|
|
|
|
|
|
|
|
| 142 |
case 'emails' :
|
| 143 |
default :
|
| 144 |
wc_shortcodes_options_input_field( $args );
|
|
@@ -205,6 +208,49 @@ function wc_shortcodes_options_display_share_buttons_field( $args ) {
|
|
| 205 |
<?php endif; ?>
|
| 206 |
<?php
|
| 207 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 208 |
function wc_shortcodes_options_display_positive_pixel_input_field( $args ) {
|
| 209 |
extract( $args );
|
| 210 |
|
| 139 |
case 'share_buttons' :
|
| 140 |
wc_shortcodes_options_display_share_buttons_field( $args );
|
| 141 |
break;
|
| 142 |
+
case 'social_icons' :
|
| 143 |
+
wc_shortcodes_options_display_social_icons_field( $args );
|
| 144 |
+
break;
|
| 145 |
case 'emails' :
|
| 146 |
default :
|
| 147 |
wc_shortcodes_options_input_field( $args );
|
| 208 |
<?php endif; ?>
|
| 209 |
<?php
|
| 210 |
}
|
| 211 |
+
function wc_shortcodes_options_display_social_icons_field( $args ) {
|
| 212 |
+
global $wc_shortcodes_social_icons;
|
| 213 |
+
|
| 214 |
+
extract( $args );
|
| 215 |
+
|
| 216 |
+
$val = get_option( $option_name, $default );
|
| 217 |
+
$not_selected = $wc_shortcodes_social_icons;
|
| 218 |
+
|
| 219 |
+
?>
|
| 220 |
+
|
| 221 |
+
<?php if ( isset( $label ) ) : ?>
|
| 222 |
+
<label for="<?php echo esc_attr($option_name); ?>"><?php echo $label; ?></label>
|
| 223 |
+
<?php endif; ?>
|
| 224 |
+
|
| 225 |
+
<ul class="wc-shortcodes-clearfix wc-shortcodes-share-buttons">
|
| 226 |
+
<?php if ( is_array( $val ) && ! empty( $val ) ) : ?>
|
| 227 |
+
<?php foreach ( $val as $key => $name ) : ?>
|
| 228 |
+
<li>
|
| 229 |
+
<p style="width:300px;background-color:#f7f7f7;border:1px solid #dfdfdf;padding:5px 5px;line-height:1;margin:0;text-align:left;cursor:move;">
|
| 230 |
+
<input type="checkbox" name="<?php echo $option_name; ?>[<?php echo $key; ?>]" value="<?php echo $name; ?>" <?php checked( true, true ); ?> />
|
| 231 |
+
<?php echo $name; ?>
|
| 232 |
+
</p>
|
| 233 |
+
</li>
|
| 234 |
+
<?php unset( $not_selected[ $key ] ); ?>
|
| 235 |
+
<?php endforeach; ?>
|
| 236 |
+
<?php endif; ?>
|
| 237 |
+
|
| 238 |
+
<?php foreach ( $not_selected as $key => $name ) : ?>
|
| 239 |
+
<li>
|
| 240 |
+
<p style="width:300px;background-color:#f7f7f7;border:1px solid #dfdfdf;padding:5px 5px;line-height:1;margin:0;text-align:left;cursor:move;">
|
| 241 |
+
<input type="checkbox" name="<?php echo $option_name; ?>[<?php echo $key; ?>]" value="<?php echo $name; ?>" <?php checked( true, false ); ?> />
|
| 242 |
+
<?php echo $name; ?>
|
| 243 |
+
</p>
|
| 244 |
+
</li>
|
| 245 |
+
<?php unset( $not_selected[ $key ] ); ?>
|
| 246 |
+
<?php endforeach; ?>
|
| 247 |
+
</ul>
|
| 248 |
+
|
| 249 |
+
<?php if ( isset( $description ) && !empty( $description ) ) : ?>
|
| 250 |
+
<p class="description"><?php echo $description; ?></p>
|
| 251 |
+
<?php endif; ?>
|
| 252 |
+
<?php
|
| 253 |
+
}
|
| 254 |
function wc_shortcodes_options_display_positive_pixel_input_field( $args ) {
|
| 255 |
extract( $args );
|
| 256 |
|
includes/shortcode-functions.php
CHANGED
|
@@ -70,10 +70,16 @@ add_filter('widget_text', 'do_shortcode');
|
|
| 70 |
* @return void
|
| 71 |
*/
|
| 72 |
function wc_shortcodes_fullwidth( $atts, $content = null ) {
|
|
|
|
|
|
|
| 73 |
extract(shortcode_atts(array(
|
| 74 |
-
'selector' => '
|
| 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>';
|
|
@@ -308,41 +314,25 @@ if( !function_exists('wc_shortcodes_spacing') ) {
|
|
| 308 |
*/
|
| 309 |
if( !function_exists('wc_shortcodes_social_icons') ) {
|
| 310 |
function wc_shortcodes_social_icons( $atts ){
|
| 311 |
-
$social = array(
|
| 312 |
-
'facebook' => 'Facebook',
|
| 313 |
-
'google' => 'Google',
|
| 314 |
-
'twitter' => 'Twitter',
|
| 315 |
-
'pinterest' => 'Pinterest',
|
| 316 |
-
'instagram' => 'Instagram',
|
| 317 |
-
'bloglovin' => 'BlogLovin',
|
| 318 |
-
'flickr' => 'Flickr',
|
| 319 |
-
'rss' => 'RSS',
|
| 320 |
-
'email' => 'Email',
|
| 321 |
-
'custom1' => 'Custom 1',
|
| 322 |
-
'custom2' => 'Custom 2',
|
| 323 |
-
'custom3' => 'Custom 3',
|
| 324 |
-
'custom4' => 'Custom 4',
|
| 325 |
-
'custom5' => 'Custom 5',
|
| 326 |
-
);
|
| 327 |
-
|
| 328 |
extract(shortcode_atts(array(
|
| 329 |
'class' => '',
|
| 330 |
'size' => 'large',
|
| 331 |
'align' => 'left',
|
| 332 |
-
'display' => 'facebook,google,twitter,pinterest,instagram,bloglovin,flickr,rss,email,custom1,custom2,custom3,custom4,custom5',
|
| 333 |
), $atts));
|
| 334 |
|
| 335 |
$class = trim( 'wc-shortcodes-social-icons-wrapper ' . $class );
|
| 336 |
|
| 337 |
-
$order =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 338 |
$first = true;
|
| 339 |
|
| 340 |
$html = '<div class="' . $class . '">';
|
| 341 |
$html .= '<ul class="wc-shortcodes-social-icons wc-shortcodes-clearfix wc-shortcodes-social-icons-align-'.$align.' wc-shortcodes-social-icons-size-'.$size.'">';
|
| 342 |
-
foreach ( $order as $key ) {
|
| 343 |
-
if ( ! array_key_exists( $key, $social ) )
|
| 344 |
-
continue;
|
| 345 |
-
|
| 346 |
$link_option_name = WC_SHORTCODES_PREFIX . $key . '_link';
|
| 347 |
$icon_option_name = WC_SHORTCODES_PREFIX . $key . '_icon';
|
| 348 |
|
|
@@ -350,9 +340,6 @@ if( !function_exists('wc_shortcodes_social_icons') ) {
|
|
| 350 |
$social_link = get_option( $link_option_name );
|
| 351 |
$social_link = apply_filters( 'wc_shortcodes_social_link', $social_link, $key );
|
| 352 |
|
| 353 |
-
if ( empty( $social_link ) )
|
| 354 |
-
continue;
|
| 355 |
-
|
| 356 |
$first_class = $first ? ' first-icon' : '';
|
| 357 |
$first = false;
|
| 358 |
|
| 70 |
* @return void
|
| 71 |
*/
|
| 72 |
function wc_shortcodes_fullwidth( $atts, $content = null ) {
|
| 73 |
+
global $wc_shortcodes_theme_support;
|
| 74 |
+
|
| 75 |
extract(shortcode_atts(array(
|
| 76 |
+
'selector' => $wc_shortcodes_theme_support[ 'fullwidth_container' ],
|
| 77 |
), $atts));
|
| 78 |
|
| 79 |
+
if ( empty( $selector ) ) {
|
| 80 |
+
$selector = $wc_shortcodes_theme_support[ 'fullwidth_container' ];
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
wp_enqueue_script('wc-shortcodes-fullwidth');
|
| 84 |
|
| 85 |
return '<div class="wc-shortcodes-full-width" data-selector="' . esc_attr($selector) . '">' . do_shortcode( $content ) . '</div>';
|
| 314 |
*/
|
| 315 |
if( !function_exists('wc_shortcodes_social_icons') ) {
|
| 316 |
function wc_shortcodes_social_icons( $atts ){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 317 |
extract(shortcode_atts(array(
|
| 318 |
'class' => '',
|
| 319 |
'size' => 'large',
|
| 320 |
'align' => 'left',
|
|
|
|
| 321 |
), $atts));
|
| 322 |
|
| 323 |
$class = trim( 'wc-shortcodes-social-icons-wrapper ' . $class );
|
| 324 |
|
| 325 |
+
$order = get_option( WC_SHORTCODES_PREFIX . 'social_icons_display' );
|
| 326 |
+
|
| 327 |
+
if ( ! is_array( $order ) || empty( $order ) ) {
|
| 328 |
+
return;
|
| 329 |
+
}
|
| 330 |
+
|
| 331 |
$first = true;
|
| 332 |
|
| 333 |
$html = '<div class="' . $class . '">';
|
| 334 |
$html .= '<ul class="wc-shortcodes-social-icons wc-shortcodes-clearfix wc-shortcodes-social-icons-align-'.$align.' wc-shortcodes-social-icons-size-'.$size.'">';
|
| 335 |
+
foreach ( $order as $key => $value ) {
|
|
|
|
|
|
|
|
|
|
| 336 |
$link_option_name = WC_SHORTCODES_PREFIX . $key . '_link';
|
| 337 |
$icon_option_name = WC_SHORTCODES_PREFIX . $key . '_icon';
|
| 338 |
|
| 340 |
$social_link = get_option( $link_option_name );
|
| 341 |
$social_link = apply_filters( 'wc_shortcodes_social_link', $social_link, $key );
|
| 342 |
|
|
|
|
|
|
|
|
|
|
| 343 |
$first_class = $first ? ' first-icon' : '';
|
| 344 |
$first = false;
|
| 345 |
|
includes/widgets.php
CHANGED
|
@@ -45,7 +45,12 @@ class WC_Shortcodes_Social_Icons_Widget extends WP_Widget {
|
|
| 45 |
$maxheight = $instance['maxheight'];
|
| 46 |
}
|
| 47 |
|
| 48 |
-
$order =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
$first = true;
|
| 50 |
|
| 51 |
$column_display = false;
|
|
@@ -77,9 +82,6 @@ class WC_Shortcodes_Social_Icons_Widget extends WP_Widget {
|
|
| 77 |
$social_link = get_option( $link_option_name );
|
| 78 |
$social_link = apply_filters( 'wc_shortcodes_social_link', $social_link, $key );
|
| 79 |
|
| 80 |
-
if ( empty( $social_link ) )
|
| 81 |
-
continue;
|
| 82 |
-
|
| 83 |
if ( $first )
|
| 84 |
$li_class[] = 'first-icon';
|
| 85 |
|
|
@@ -103,27 +105,10 @@ class WC_Shortcodes_Social_Icons_Widget extends WP_Widget {
|
|
| 103 |
$instance['title'] = strip_tags( stripslashes($new_instance['title']) );
|
| 104 |
$instance['columns'] = $new_instance['columns'];
|
| 105 |
$instance['maxheight'] = $new_instance['maxheight'];
|
| 106 |
-
$instance['order'] = $new_instance['order'];
|
| 107 |
return $instance;
|
| 108 |
}
|
| 109 |
|
| 110 |
function form( $instance ) {
|
| 111 |
-
$default_order = array(
|
| 112 |
-
'facebook' => 'Facebook',
|
| 113 |
-
'google' => 'Google',
|
| 114 |
-
'twitter' => 'Twitter',
|
| 115 |
-
'pinterest' => 'Pinterest',
|
| 116 |
-
'instagram' => 'Instagram',
|
| 117 |
-
'bloglovin' => 'BlogLovin',
|
| 118 |
-
'flickr' => 'Flickr',
|
| 119 |
-
'rss' => 'RSS',
|
| 120 |
-
'email' => 'Email',
|
| 121 |
-
'custom1' => 'Custom 1',
|
| 122 |
-
'custom2' => 'Custom 2',
|
| 123 |
-
'custom3' => 'Custom 3',
|
| 124 |
-
'custom4' => 'Custom 4',
|
| 125 |
-
'custom5' => 'Custom 5',
|
| 126 |
-
);
|
| 127 |
$order = isset( $instance['order'] ) ? $instance['order'] : $default_order;
|
| 128 |
$title = isset( $instance['title'] ) ? $instance['title'] : 'Follow Me!';
|
| 129 |
$columns = isset( $instance['columns'] ) ? $instance['columns'] : 6;
|
|
@@ -133,15 +118,6 @@ class WC_Shortcodes_Social_Icons_Widget extends WP_Widget {
|
|
| 133 |
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:') ?></label>
|
| 134 |
<input type="text" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $title; ?>" />
|
| 135 |
</p>
|
| 136 |
-
<label><?php _e('Order:'); ?></label>
|
| 137 |
-
<ul class="wc-shortcodes-clearfix wc-shortcodes-social-icons">
|
| 138 |
-
<?php foreach ( $order as $key => $name ) : ?>
|
| 139 |
-
<li>
|
| 140 |
-
<p style="background-color:#f7f7f7;border:1px solid #dfdfdf;padding:2px;margin:0;text-align:center;cursor:move;"><?php echo $name; ?></p>
|
| 141 |
-
<input type="hidden" name="<?php echo $this->get_field_name('order'); ?>[<?php echo $key; ?>]" value="<?php echo $name; ?>" />
|
| 142 |
-
</li>
|
| 143 |
-
<?php endforeach; ?>
|
| 144 |
-
</ul>
|
| 145 |
<p>
|
| 146 |
<label for="<?php echo $this->get_field_id('columns'); ?>"><?php _e('Display:'); ?></label>
|
| 147 |
<select id="<?php echo $this->get_field_id('columns'); ?>" name="<?php echo $this->get_field_name('columns'); ?>">
|
| 45 |
$maxheight = $instance['maxheight'];
|
| 46 |
}
|
| 47 |
|
| 48 |
+
$order = get_option( WC_SHORTCODES_PREFIX . 'social_icons_display' );
|
| 49 |
+
|
| 50 |
+
if ( ! is_array( $order ) || empty( $order ) ) {
|
| 51 |
+
return;
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
$first = true;
|
| 55 |
|
| 56 |
$column_display = false;
|
| 82 |
$social_link = get_option( $link_option_name );
|
| 83 |
$social_link = apply_filters( 'wc_shortcodes_social_link', $social_link, $key );
|
| 84 |
|
|
|
|
|
|
|
|
|
|
| 85 |
if ( $first )
|
| 86 |
$li_class[] = 'first-icon';
|
| 87 |
|
| 105 |
$instance['title'] = strip_tags( stripslashes($new_instance['title']) );
|
| 106 |
$instance['columns'] = $new_instance['columns'];
|
| 107 |
$instance['maxheight'] = $new_instance['maxheight'];
|
|
|
|
| 108 |
return $instance;
|
| 109 |
}
|
| 110 |
|
| 111 |
function form( $instance ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
$order = isset( $instance['order'] ) ? $instance['order'] : $default_order;
|
| 113 |
$title = isset( $instance['title'] ) ? $instance['title'] : 'Follow Me!';
|
| 114 |
$columns = isset( $instance['columns'] ) ? $instance['columns'] : 6;
|
| 118 |
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:') ?></label>
|
| 119 |
<input type="text" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $title; ?>" />
|
| 120 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
<p>
|
| 122 |
<label for="<?php echo $this->get_field_id('columns'); ?>"><?php _e('Display:'); ?></label>
|
| 123 |
<select id="<?php echo $this->get_field_id('columns'); ?>" name="<?php echo $this->get_field_name('columns'); ?>">
|
readme.txt
CHANGED
|
@@ -88,6 +88,11 @@ Use the shortcode manager in the TinyMCE text editor
|
|
| 88 |
|
| 89 |
== Changelog ==
|
| 90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
### Version 1.42
|
| 92 |
|
| 93 |
* Improved social icons widget
|
| 88 |
|
| 89 |
== Changelog ==
|
| 90 |
|
| 91 |
+
### Version 1.43
|
| 92 |
+
|
| 93 |
+
* Added theme support for developers
|
| 94 |
+
* Updated settings for social media icons
|
| 95 |
+
|
| 96 |
### Version 1.42
|
| 97 |
|
| 98 |
* Improved social icons widget
|
wc-shortcodes.php
CHANGED
|
@@ -5,11 +5,11 @@ Plugin URI: http://webplantmedia.com/starter-themes/wordpresscanvas/features/sho
|
|
| 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_PREFIX', '_wc_shortcodes_' );
|
| 15 |
define( 'WC_SHORTCODES_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
|
@@ -17,8 +17,44 @@ define( 'WC_SHORTCODES_CURRENT_VERSION', get_option( WC_SHORTCODES_PREFIX . 'cur
|
|
| 17 |
define( 'WC_SHORTCODES_FONT_AWESOME_ENABLED', get_option( WC_SHORTCODES_PREFIX . 'enable_font_awesome', true ) );
|
| 18 |
|
| 19 |
global $wc_shortcodes_options;
|
|
|
|
|
|
|
|
|
|
| 20 |
global $wc_shortcodes_plugin_screen_hook_suffix;
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
require_once( dirname(__FILE__) . '/includes/options.php' ); // define options array
|
| 23 |
require_once( dirname(__FILE__) . '/includes/functions.php' ); // Adds basic filters and actions
|
| 24 |
require_once( dirname(__FILE__) . '/includes/settings.php' ); // Adds settings
|
| 5 |
Description: A family of shortcodes to enhance site functionality.
|
| 6 |
Author: Chris Baldelomar
|
| 7 |
Author URI: http://webplantmedia.com/
|
| 8 |
+
Version: 1.43
|
| 9 |
License: GPLv2 or later
|
| 10 |
*/
|
| 11 |
|
| 12 |
+
define( 'WC_SHORTCODES_VERSION', '1.43' );
|
| 13 |
define( 'WC_SHORTCODES_PREFIX', 'wc_shortcodes_' );
|
| 14 |
define( '_WC_SHORTCODES_PREFIX', '_wc_shortcodes_' );
|
| 15 |
define( 'WC_SHORTCODES_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
| 17 |
define( 'WC_SHORTCODES_FONT_AWESOME_ENABLED', get_option( WC_SHORTCODES_PREFIX . 'enable_font_awesome', true ) );
|
| 18 |
|
| 19 |
global $wc_shortcodes_options;
|
| 20 |
+
global $wc_shortcodes_social_icons;
|
| 21 |
+
global $wc_shortcodes_share_buttons;
|
| 22 |
+
global $wc_shortcodes_theme_support;
|
| 23 |
global $wc_shortcodes_plugin_screen_hook_suffix;
|
| 24 |
|
| 25 |
+
$wc_shortcodes_options = array();
|
| 26 |
+
$wc_shortcodes_social_icons = array(
|
| 27 |
+
'facebook' => 'Facebook',
|
| 28 |
+
'google' => 'Google',
|
| 29 |
+
'twitter' => 'Twitter',
|
| 30 |
+
'pinterest' => 'Pinterest',
|
| 31 |
+
'instagram' => 'Instagram',
|
| 32 |
+
'bloglovin' => 'BlogLovin',
|
| 33 |
+
'flickr' => 'Flickr',
|
| 34 |
+
'rss' => 'RSS',
|
| 35 |
+
'email' => 'Email',
|
| 36 |
+
'custom1' => 'Custom 1',
|
| 37 |
+
'custom2' => 'Custom 2',
|
| 38 |
+
'custom3' => 'Custom 3',
|
| 39 |
+
'custom4' => 'Custom 4',
|
| 40 |
+
'custom5' => 'Custom 5',
|
| 41 |
+
'pinterest' => 'Pinterest',
|
| 42 |
+
'facebook' => 'Facebook',
|
| 43 |
+
'twitter' => 'Twitter',
|
| 44 |
+
'google' => 'Google',
|
| 45 |
+
'email' => 'Email',
|
| 46 |
+
);
|
| 47 |
+
$wc_shortcodes_share_buttons = array(
|
| 48 |
+
'pinterest' => 'Pinterest',
|
| 49 |
+
'facebook' => 'Facebook',
|
| 50 |
+
'twitter' => 'Twitter',
|
| 51 |
+
'google' => 'Google',
|
| 52 |
+
'email' => 'Email',
|
| 53 |
+
);
|
| 54 |
+
$wc_shortcodes_theme_support = array(
|
| 55 |
+
'fullwidth_container' => '#main',
|
| 56 |
+
);
|
| 57 |
+
|
| 58 |
require_once( dirname(__FILE__) . '/includes/options.php' ); // define options array
|
| 59 |
require_once( dirname(__FILE__) . '/includes/functions.php' ); // Adds basic filters and actions
|
| 60 |
require_once( dirname(__FILE__) . '/includes/settings.php' ); // Adds settings
|
