Version Description
- 1 April 2017 =
- Compatibility with upcoming Page Builder 2.5 release.
- Fixed compatibility with Elementor 1.4+.
- Fixed incompatibility with Jetpack.
Download this release
Release Info
Developer | gpriday |
Plugin | SiteOrigin Widgets Bundle |
Version | 1.8.2 |
Comparing to | |
See all releases |
Code changes from version 1.8.1 to 1.8.2
- base/base.php +1 -0
- base/inc/shortcode.php +71 -0
- compat/elementor/elementor.php +3 -5
- readme.txt +14 -7
- so-widgets-bundle.php +2 -2
- widgets/editor/editor.php +16 -7
base/base.php
CHANGED
@@ -9,6 +9,7 @@ include plugin_dir_path(__FILE__).'inc/post-selector.php';
|
|
9 |
include plugin_dir_path(__FILE__).'inc/string-utils.php';
|
10 |
include plugin_dir_path(__FILE__).'inc/attachments.php';
|
11 |
include plugin_dir_path(__FILE__).'inc/actions.php';
|
|
|
12 |
|
13 |
/**
|
14 |
* @param $css
|
9 |
include plugin_dir_path(__FILE__).'inc/string-utils.php';
|
10 |
include plugin_dir_path(__FILE__).'inc/attachments.php';
|
11 |
include plugin_dir_path(__FILE__).'inc/actions.php';
|
12 |
+
include plugin_dir_path(__FILE__).'inc/shortcode.php';
|
13 |
|
14 |
/**
|
15 |
* @param $css
|
base/inc/shortcode.php
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* A simple shortcode that just renders a
|
5 |
+
*
|
6 |
+
* @param $attr
|
7 |
+
* @param string $content
|
8 |
+
*
|
9 |
+
* @return string
|
10 |
+
*/
|
11 |
+
function siteorigin_widget_shortcode( $attr, $content = '' ){
|
12 |
+
$attr = shortcode_atts( array(
|
13 |
+
'class' => false,
|
14 |
+
'id' => '',
|
15 |
+
), $attr, 'siteorigin_widget' );
|
16 |
+
|
17 |
+
$attr[ 'class' ] = html_entity_decode( $attr[ 'class' ] );
|
18 |
+
|
19 |
+
global $wp_widget_factory;
|
20 |
+
if( ! empty( $attr[ 'class' ] ) && isset( $wp_widget_factory->widgets[ $attr[ 'class' ] ] ) ) {
|
21 |
+
$the_widget = $wp_widget_factory->widgets[ $attr[ 'class' ] ];
|
22 |
+
|
23 |
+
// Parse the value of the shortcode
|
24 |
+
preg_match( '/value="(.*?)"/', trim( $content ), $matches );
|
25 |
+
if( ! empty( $matches[1] ) ) {
|
26 |
+
$data = json_decode( html_entity_decode( $matches[1] ), true );
|
27 |
+
}
|
28 |
+
|
29 |
+
$widget_args = ! empty( $data[ 'args' ] ) ? $data[ 'args' ] : array();
|
30 |
+
$widget_instance = ! empty( $data[ 'instance' ] ) ? $data[ 'instance' ] : array();
|
31 |
+
|
32 |
+
$widget_args = wp_parse_args( array(
|
33 |
+
'before_widget' => '',
|
34 |
+
'after_widget' => '',
|
35 |
+
'before_title' => '<h3 class="widget-title">',
|
36 |
+
'after_title' => '</h3>',
|
37 |
+
), $widget_args );
|
38 |
+
|
39 |
+
ob_start();
|
40 |
+
$the_widget->widget( $widget_args, $widget_instance );
|
41 |
+
return ob_get_clean();
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
+
function siteorigin_widget_shortcode_register(){
|
46 |
+
global $shortcode_tags;
|
47 |
+
|
48 |
+
// Only load this as a fallback if Page Builder hasn't already registered it.
|
49 |
+
if( empty( $shortcode_tags[ 'siteorigin_widget' ] ) ) {
|
50 |
+
add_shortcode( 'siteorigin_widget', 'siteorigin_widget_shortcode' );
|
51 |
+
}
|
52 |
+
}
|
53 |
+
add_action( 'plugins_loaded', 'siteorigin_widget_shortcode_register', 15 );
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Tell Page Builder we'll be using the custom siteorigin_widget shortcode
|
57 |
+
*
|
58 |
+
* @param $shortcode
|
59 |
+
* @param $widget
|
60 |
+
*
|
61 |
+
* @return string
|
62 |
+
*/
|
63 |
+
function siteorigin_widget_shortcode_panels_cache_shortcode( $shortcode, $widget ){
|
64 |
+
if( is_a( $widget, 'SiteOrigin_Widget' ) ) {
|
65 |
+
$shortcode = 'siteorigin_widget';
|
66 |
+
}
|
67 |
+
|
68 |
+
return $shortcode;
|
69 |
+
}
|
70 |
+
|
71 |
+
add_filter( 'siteorigin_panels_cache_shortcode', 'siteorigin_widget_shortcode_panels_cache_shortcode', 10, 2 );
|
compat/elementor/elementor.php
CHANGED
@@ -28,11 +28,7 @@ class SiteOrigin_Widgets_Bundle_Elementor {
|
|
28 |
add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_frontend_scripts' ] );
|
29 |
}
|
30 |
|
31 |
-
|
32 |
-
if( ! is_admin() && method_exists( $elementor_editor, 'is_edit_mode' ) && $elementor_editor->is_edit_mode() ) {
|
33 |
-
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_active_widgets_scripts' ), 9999999 );
|
34 |
-
add_action( 'wp_print_footer_scripts', array( $this, 'print_footer_templates' ) );
|
35 |
-
}
|
36 |
}
|
37 |
|
38 |
function enqueue_frontend_scripts() {
|
@@ -48,6 +44,8 @@ class SiteOrigin_Widgets_Bundle_Elementor {
|
|
48 |
|
49 |
function enqueue_active_widgets_scripts() {
|
50 |
|
|
|
|
|
51 |
global $wp_widget_factory;
|
52 |
|
53 |
// Elementor does it's editing in it's own front end so enqueue required form scripts for active widgets.
|
28 |
add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_frontend_scripts' ] );
|
29 |
}
|
30 |
|
31 |
+
add_action( 'elementor/editor/before_enqueue_scripts', array( $this, 'enqueue_active_widgets_scripts' ) );
|
|
|
|
|
|
|
|
|
32 |
}
|
33 |
|
34 |
function enqueue_frontend_scripts() {
|
44 |
|
45 |
function enqueue_active_widgets_scripts() {
|
46 |
|
47 |
+
add_action( 'wp_print_footer_scripts', array( $this, 'print_footer_templates' ) );
|
48 |
+
|
49 |
global $wp_widget_factory;
|
50 |
|
51 |
// Elementor does it's editing in it's own front end so enqueue required form scripts for active widgets.
|
readme.txt
CHANGED
@@ -1,20 +1,22 @@
|
|
1 |
=== SiteOrigin Widgets Bundle ===
|
2 |
Tags: bundle, widget, button, slider, image, carousel, price table, google maps, tinymce, social links
|
3 |
-
Requires at least:
|
4 |
-
Tested up to: 4.7.
|
5 |
-
Stable tag: 1.8.
|
6 |
-
Build time: 2017-
|
7 |
License: GPLv3 or later
|
8 |
Contributors: gpriday, braam-genis
|
9 |
Donate link: https://siteorigin.com/downloads/contribution/
|
10 |
|
|
|
|
|
11 |
== Description ==
|
12 |
|
13 |
-
|
14 |
|
15 |
-
Widgets are great. No matter where you’re using them. In a [Page Builder](http://siteorigin.com/page-builder/) page or on your widgetized areas.
|
16 |
|
17 |
-
|
18 |
|
19 |
The collection is growing, but here’s what we have so far.
|
20 |
|
@@ -52,6 +54,11 @@ The SiteOrigin Widgets Bundle is the perfect platform to build widgets for your
|
|
52 |
|
53 |
== Changelog ==
|
54 |
|
|
|
|
|
|
|
|
|
|
|
55 |
= 1.8.1 - 3 February 2017 =
|
56 |
* Fixed empty array warning.
|
57 |
* Contact Form: Prevent empty title markup from being echoed.
|
1 |
=== SiteOrigin Widgets Bundle ===
|
2 |
Tags: bundle, widget, button, slider, image, carousel, price table, google maps, tinymce, social links
|
3 |
+
Requires at least: 4.2
|
4 |
+
Tested up to: 4.7.3
|
5 |
+
Stable tag: 1.8.2
|
6 |
+
Build time: 2017-04-01T17:10:37+02:00
|
7 |
License: GPLv3 or later
|
8 |
Contributors: gpriday, braam-genis
|
9 |
Donate link: https://siteorigin.com/downloads/contribution/
|
10 |
|
11 |
+
The SiteOrigin widget bundle gives you a collection of widgets that you can use and customize. All the widgets are built on our powerful framework, giving you advanced forms, unlimited colours and 1500+ icons.
|
12 |
+
|
13 |
== Description ==
|
14 |
|
15 |
+
The SiteOrigin widget bundle gives you a collection of widgets that you can use and customize. All the widgets are built on our powerful framework, giving you advanced forms, unlimited colours and 1500+ icons.
|
16 |
|
17 |
+
Widgets are great. No matter where you’re using them. In a [Page Builder](http://siteorigin.com/page-builder/) page or on your widgetized areas. It's even compatible with other popular page building plugins.
|
18 |
|
19 |
+
[vimeo https://vimeo.com/102103379]
|
20 |
|
21 |
The collection is growing, but here’s what we have so far.
|
22 |
|
54 |
|
55 |
== Changelog ==
|
56 |
|
57 |
+
= 1.8.2 - 1 April 2017 =
|
58 |
+
* Compatibility with upcoming Page Builder 2.5 release.
|
59 |
+
* Fixed compatibility with Elementor 1.4+.
|
60 |
+
* Fixed incompatibility with Jetpack.
|
61 |
+
|
62 |
= 1.8.1 - 3 February 2017 =
|
63 |
* Fixed empty array warning.
|
64 |
* Contact Form: Prevent empty title markup from being echoed.
|
so-widgets-bundle.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: SiteOrigin Widgets Bundle
|
4 |
Description: A collection of all widgets, neatly bundled into a single plugin. It's also a framework to code your own widgets on top of.
|
5 |
-
Version: 1.8.
|
6 |
Text Domain: so-widgets-bundle
|
7 |
Domain Path: /languages
|
8 |
Author: SiteOrigin
|
@@ -12,7 +12,7 @@ License: GPL3
|
|
12 |
License URI: https://www.gnu.org/licenses/gpl-3.0.txt
|
13 |
*/
|
14 |
|
15 |
-
define('SOW_BUNDLE_VERSION', '1.8.
|
16 |
define('SOW_BUNDLE_BASE_FILE', __FILE__);
|
17 |
|
18 |
// Allow JS suffix to be pre-set
|
2 |
/*
|
3 |
Plugin Name: SiteOrigin Widgets Bundle
|
4 |
Description: A collection of all widgets, neatly bundled into a single plugin. It's also a framework to code your own widgets on top of.
|
5 |
+
Version: 1.8.2
|
6 |
Text Domain: so-widgets-bundle
|
7 |
Domain Path: /languages
|
8 |
Author: SiteOrigin
|
12 |
License URI: https://www.gnu.org/licenses/gpl-3.0.txt
|
13 |
*/
|
14 |
|
15 |
+
define('SOW_BUNDLE_VERSION', '1.8.2');
|
16 |
define('SOW_BUNDLE_BASE_FILE', __FILE__);
|
17 |
|
18 |
// Allow JS suffix to be pre-set
|
widgets/editor/editor.php
CHANGED
@@ -57,20 +57,29 @@ class SiteOrigin_Widget_Editor_Widget extends SiteOrigin_Widget {
|
|
57 |
);
|
58 |
|
59 |
$instance['text'] = $this->unwpautop( $instance['text'] );
|
60 |
-
$instance['text'] = apply_filters( 'widget_text', $instance['text'] );
|
61 |
|
62 |
-
// Run some known stuff
|
63 |
-
if( !empty($GLOBALS['wp_embed']) ) {
|
64 |
-
$instance['text'] = $GLOBALS['wp_embed']->run_shortcode( $instance['text'] );
|
65 |
-
$instance['text'] = $GLOBALS['wp_embed']->autoembed( $instance['text'] );
|
66 |
-
}
|
67 |
if (function_exists('wp_make_content_images_responsive')) {
|
68 |
$instance['text'] = wp_make_content_images_responsive( $instance['text'] );
|
69 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
if( $instance['autop'] ) {
|
71 |
$instance['text'] = wpautop( $instance['text'] );
|
72 |
}
|
73 |
-
$instance['text'] = do_shortcode( shortcode_unautop( $instance['text'] ) );
|
74 |
|
75 |
return array(
|
76 |
'text' => $instance['text'],
|
57 |
);
|
58 |
|
59 |
$instance['text'] = $this->unwpautop( $instance['text'] );
|
|
|
60 |
|
|
|
|
|
|
|
|
|
|
|
61 |
if (function_exists('wp_make_content_images_responsive')) {
|
62 |
$instance['text'] = wp_make_content_images_responsive( $instance['text'] );
|
63 |
}
|
64 |
+
|
65 |
+
if(
|
66 |
+
// Only run these parts if we're rendering for the frontend
|
67 |
+
empty( $GLOBALS[ 'SITEORIGIN_PANELS_CACHE_RENDER' ] ) &&
|
68 |
+
empty( $GLOBALS[ 'SITEORIGIN_PANELS_POST_CONTENT_RENDER' ] )
|
69 |
+
) {
|
70 |
+
// Run some known stuff
|
71 |
+
if( !empty($GLOBALS['wp_embed']) ) {
|
72 |
+
$instance['text'] = $GLOBALS['wp_embed']->run_shortcode( $instance['text'] );
|
73 |
+
$instance['text'] = $GLOBALS['wp_embed']->autoembed( $instance['text'] );
|
74 |
+
}
|
75 |
+
|
76 |
+
$instance['text'] = apply_filters( 'widget_text', $instance['text'] );
|
77 |
+
$instance['text'] = do_shortcode( shortcode_unautop( $instance['text'] ) );
|
78 |
+
}
|
79 |
+
|
80 |
if( $instance['autop'] ) {
|
81 |
$instance['text'] = wpautop( $instance['text'] );
|
82 |
}
|
|
|
83 |
|
84 |
return array(
|
85 |
'text' => $instance['text'],
|