Skip to content

Commit

Permalink
Merge branch 'release/2.5.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
gregpriday committed May 12, 2017
2 parents 8bcc252 + 44fd7c3 commit bd4e1bb
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 5 deletions.
3 changes: 2 additions & 1 deletion inc/admin-layouts.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ function action_get_prebuilt_layouts() {
$item['type'] = $type;

if( empty( $item['screenshot'] ) && ! empty( $item['preview'] ) ) {
$item['screenshot'] = 'https://s.wordpress.com/mshots/v1/' . urlencode( $item[ 'preview' ] ) . '?w=700';
$preview_url = add_query_arg( 'screenshot', 'true', $item[ 'preview' ] );
$item['screenshot'] = 'https://s.wordpress.com/mshots/v1/' . urlencode( $preview_url ) . '?w=700';
}

$return['items'][] = $item;
Expand Down
26 changes: 24 additions & 2 deletions inc/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,12 @@ public function admin_init(){
}
}
}

if( self::is_admin() ) {
// Setup everything for Page Builder learning
// Setup everything for Page Builder learning as long as we're viewing a Page Builder page
SiteOrigin_Learn_Dialog::single();
add_filter( 'siteorigin_learn_lessons', array( $this, 'filter_learn_lessons' ) );
add_filter( 'siteorigin_learn_strings', array( $this, 'filter_learn_strings' ), 99 );
}
}

Expand Down Expand Up @@ -1018,5 +1019,26 @@ public function filter_learn_lessons( $lessons ) {

return $lessons;
}

/**
* Filter the translation strings for SiteOrigin learning dialogs
*
* @param $strings
*
* @return array
*/
public function filter_learn_strings( $strings ){
$strings = array(
'watch_video' => __( 'Watch Intro Video', 'siteorigin-panels' ),
'loaded_from_vimeo' => __( 'Loaded from Vimeo Servers', 'siteorigin-panels' ),
'valid_email' => __( 'Please enter a valid email address.', 'siteorigin-panels' ),

'your_name' => __( 'Your Name', 'siteorigin-panels' ),
'your_email' => __( 'Your Email', 'siteorigin-panels' ),
'sign_up' => __( 'Sign Up', 'siteorigin-panels' ),
'close' => __( 'Close', 'siteorigin-panels' ),
);
return $strings;
}

}
11 changes: 11 additions & 0 deletions inc/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ function siteorigin_panels_render( $post_id = false, $enqueue_css = true, $panel
return SiteOrigin_Panels::renderer()->render( $post_id, $enqueue_css, $panels_data );
}

/**
* Generate the CSS for the page layout.
*
* @param $post_id
* @param $panels_data
* @return string
*/
function siteorigin_panels_generate_css($post_id, $panels_data = false){
return SiteOrigin_Panels::renderer()->generate_css( $post_id, $panels_data );
}

/**
* Legacy function to process raw widgets.
*
Expand Down
5 changes: 4 additions & 1 deletion inc/styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,10 @@ static function widget_style_fields( $fields ) {
*/
static function general_style_attributes( $attributes, $style ){
if ( ! empty( $style['class'] ) ) {
$attributes['class'] = array_merge( $attributes['class'], explode( ' ', $style['class'] ) );
if( ! is_array( $style['class'] ) ) {
$style['class'] = explode( ' ', $style[ 'class' ] );
}
$attributes['class'] = array_merge( $attributes['class'], $style['class'] );
}

if ( ! empty( $style['background_display'] ) && ! empty( $style['background_image_attachment'] ) ) {
Expand Down
2 changes: 2 additions & 0 deletions inc/widget-shortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ static function get_shortcode( $widget, $args, $instance ){
*/
static function widget_html( $html, $widget, $args, $instance ){
if(
empty( $GLOBALS[ 'SITEORIGIN_PANELS_CACHE_RENDER' ] ) ||
// Don't try create HTML if there already is some
! empty( $html ) ||
! is_object( $widget ) ||
// Skip for known text based widgets
in_array( get_class( $widget ), self::$text_widgets )
) {
Expand Down
2 changes: 1 addition & 1 deletion learn
Submodule learn updated 2 files
+66 −49 learn.php
+8 −7 tpl/dialog.php
6 changes: 6 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ We've tried to ensure that Page Builder is compatible with most plugin widgets.

== Changelog ==

= 2.5.3 - 9 May 2017 =
* Added legacy function wrapper for siteorigin_panels_generate_css
* Added more cache render checks
* Handle translation of Learn submodule strings
* Added screenshot argument to preview URL

= 2.5.2 - 19 April 2017 =
* Fixed RTL layouts for new flexbox layout.
* Renamed front.css to ensure cache busting.
Expand Down

0 comments on commit bd4e1bb

Please sign in to comment.