Skip to content

Commit

Permalink
Merge branch 'release/2.12.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
Misplon committed Jun 17, 2021
2 parents d3e4f88 + 3dbbea3 commit c943527
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 39 deletions.
24 changes: 13 additions & 11 deletions compat/acf-widgets.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,21 @@ public function enqueue_assets() {
* @param $instance The Panels widget instance.
*/
public function store_acf_widget_fields_instance( $the_widget, $instance ) {
$field_groups = acf_get_field_groups( array(
'widget' => $the_widget->id_base,
) );
if ( ! empty( $instance['acf'] ) ) {
$field_groups = acf_get_field_groups( array(
'widget' => $the_widget->id_base,
) );

if ( ! empty( $field_groups ) ) {
// Get all fields, and merge them into a single array.
foreach( $field_groups as $field_group ) {
$fields[] = acf_get_fields( $field_group );
}
$fields = call_user_func_array('array_merge', $fields );
if ( ! empty( $field_groups ) ) {
// Get all fields, and merge them into a single array.
foreach( $field_groups as $field_group ) {
$fields[] = acf_get_fields( $field_group );
}
$fields = call_user_func_array('array_merge', $fields );

acf_register_store( 'so_fields', $fields );
acf_register_store( 'so_widget_instance', $instance['acf'] );
acf_register_store( 'so_fields', $fields );
acf_register_store( 'so_widget_instance', $instance['acf'] );
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion compat/js/acf-widgets.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
( function( $ ) {
$( document ).on( 'open_dialog', function( e, view ) {
$( document ).on( 'panelsopen', function() {
setTimeout( function() {
acf.doAction( 'append', $( '.so-content' ) );
}, 1250 )
Expand Down
4 changes: 4 additions & 0 deletions css/admin.less
Original file line number Diff line number Diff line change
Expand Up @@ -2259,6 +2259,10 @@

// Style the builder differently in the live editor sidebar to make better use of space
.siteorigin-panels-builder {
.so-builder-toolbar .so-tool-button {
padding: 2px 9px 2px 9px;
}

.so-rows-container {
padding: 10px 10px 0 10px !important;
}
Expand Down
4 changes: 4 additions & 0 deletions css/front-flex.less
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
z-index: 1;
}

.simpleParallax {
overflow: hidden;
}

.simpleParallax,
img[data-siteorigin-parallax] {
bottom: 0;
Expand Down
4 changes: 4 additions & 0 deletions css/front-legacy.less
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
z-index: 1;
}

.simpleParallax {
overflow: hidden;
}

.simpleParallax,
img[data-siteorigin-parallax] {
bottom: 0;
Expand Down
26 changes: 13 additions & 13 deletions inc/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ function settings_fields( $fields ) {
$fields['general']['fields']['live-editor-quick-link'] = array(
'type' => 'checkbox',
'label' => __( 'Live Editor Quick Link', 'siteorigin-panels' ),
'description' => __( 'Display a Live Editor button in the admin bar.', 'siteorigin-panels' ),
'description' => __( 'Display a Live Editor button in the WordPress admin bar.', 'siteorigin-panels' ),
);

$fields['general']['fields']['admin-post-state'] = array(
Expand Down Expand Up @@ -309,7 +309,7 @@ function settings_fields( $fields ) {
$fields['general']['fields']['parallax-motion'] = array(
'type' => 'float',
'label' => __( 'Limit Parallax Motion', 'siteorigin-panels' ),
'description' => __( 'How many pixels of scrolling result in a single pixel of parallax motion. 0 means automatic. Lower values give more noticeable effect.', 'siteorigin-panels' ),
'description' => __( 'How many pixels of scrolling results in a single pixel of parallax motion. 0 means automatic. Lower values give more noticeable effect.', 'siteorigin-panels' ),
);

// New Parallax settings.
Expand Down Expand Up @@ -343,9 +343,9 @@ function settings_fields( $fields ) {

$fields['general']['fields']['load-on-attach'] = array(
'type' => 'checkbox',
'label' => __( 'Default To Page Builder Interface', 'siteorigin-panels' ),
'label' => __( 'Default to Page Builder Interface', 'siteorigin-panels' ),
'description' => sprintf(
__( 'New Classic Editor posts/pages that you create will start with the Page Builder loaded. The %s"Use Classic Editor for new posts"%s setting must be enabled.', 'siteorigin-panels' ),
__( 'New Classic Editor posts/pages that you create will start with the Page Builder loaded. The %s"Use Classic Editor for New Posts"%s setting must be enabled.', 'siteorigin-panels' ),
'<strong>',
'</strong>'
)
Expand All @@ -358,7 +358,7 @@ function settings_fields( $fields ) {
'edit' => __( 'Edit', 'siteorigin-panels' ),
'preview' => __( 'Preview', 'siteorigin-panels' ),
),
'description' => __( 'Whether to display layout blocks in edit mode or preview mode in the block editor.', 'siteorigin-panels' ),
'description' => __( 'Whether to display SiteOrigin Layout Blocks in edit mode or preview mode in the Block Editor.', 'siteorigin-panels' ),
);

// The widgets fields
Expand All @@ -377,7 +377,7 @@ function settings_fields( $fields ) {
$fields['widgets']['fields']['add-widget-class'] = array(
'type' => 'checkbox',
'label' => __( 'Add Widget Class', 'siteorigin-panels' ),
'description' => __( "Add the widget class to Page Builder widgets. Disable this if you're experiencing conflicts.", 'siteorigin-panels' ),
'description' => __( "Add the widget class to Page Builder widgets. Disable if theme widget styles are negatively impacting widgets in Page Builder.", 'siteorigin-panels' ),
);

$fields['widgets']['fields']['bundled-widgets'] = array(
Expand All @@ -389,13 +389,13 @@ function settings_fields( $fields ) {
$fields['widgets']['fields']['recommended-widgets'] = array(
'type' => 'checkbox',
'label' => __( 'Recommended Widgets', 'siteorigin-panels' ),
'description' => __( 'Display recommend widgets in Page Builder add widget dialog.', 'siteorigin-panels' ),
'description' => __( 'Display recommend widgets in the Page Builder Add Widget dialog.', 'siteorigin-panels' ),
);

$fields['widgets']['fields']['instant-open-widgets'] = array(
'type' => 'checkbox',
'label' => __( 'Instant Open Widgets', 'siteorigin-panels' ),
'description' => __( 'Open a widget form as soon as its added to a page.', 'siteorigin-panels' ),
'description' => __( 'Open a widget form as soon as it\'s added to a page.', 'siteorigin-panels' ),
);

// The layout fields
Expand All @@ -410,7 +410,7 @@ function settings_fields( $fields ) {
$fields['layout']['fields']['responsive'] = array(
'type' => 'checkbox',
'label' => __( 'Responsive Layout', 'siteorigin-panels' ),
'description' => __( 'Collapse widgets, rows and columns on mobile devices.', 'siteorigin-panels' ),
'description' => __( 'Collapse widgets, rows, and columns on mobile devices.', 'siteorigin-panels' ),
);

$fields['layout']['fields']['tablet-layout'] = array(
Expand All @@ -427,21 +427,21 @@ function settings_fields( $fields ) {
'always' => __( 'Always', 'siteorigin-panels' ),
),
'label' => __( 'Use Legacy Layout Engine', 'siteorigin-panels' ),
'description' => __( 'The CSS and HTML uses floats instead of flexbox for compatibility with very old browsers.', 'siteorigin-panels' ),
'description' => __( 'For compatibility, the Legacy Layout Engine switches from Flexbox to float when older browsers are detected.', 'siteorigin-panels' ),
);

$fields['layout']['fields']['tablet-width'] = array(
'type' => 'number',
'unit' => 'px',
'label' => __( 'Tablet Width', 'siteorigin-panels' ),
'description' => __( 'Device width, in pixels, to collapse into a tablet view .', 'siteorigin-panels' ),
'description' => __( 'Device width, in pixels, to collapse into a tablet view.', 'siteorigin-panels' ),
);

$fields['layout']['fields']['mobile-width'] = array(
'type' => 'number',
'unit' => 'px',
'label' => __( 'Mobile Width', 'siteorigin-panels' ),
'description' => __( 'Device width, in pixels, to collapse into a mobile view .', 'siteorigin-panels' ),
'description' => __( 'Device width, in pixels, to collapse into a mobile view.', 'siteorigin-panels' ),
);

$fields['layout']['fields']['margin-bottom'] = array(
Expand All @@ -461,7 +461,7 @@ function settings_fields( $fields ) {
$fields['layout']['fields']['margin-bottom-last-row'] = array(
'type' => 'checkbox',
'label' => __( 'Last Row With Margin', 'siteorigin-panels' ),
'description' => __( 'Allow margin in last row.', 'siteorigin-panels' ),
'description' => __( 'Allow margin below the last row.', 'siteorigin-panels' ),
);

$fields['layout']['fields']['margin-sides'] = array(
Expand Down
24 changes: 19 additions & 5 deletions inc/styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -472,17 +472,31 @@ function add_parallax( $output, $context ) {
! empty( $context['style']['background_display'] ) &&
self::is_background_parallax( $context['style']['background_display'] )
) {
$parallax = false;
if ( ! empty( $context['style']['background_image_attachment'] ) ) {
$url = self::get_attachment_image_src( $context['style']['background_image_attachment'], 'full' )[0];
$image_html = wp_get_attachment_image(
$context['style']['background_image_attachment'],
'full',
false,
array(
'data-siteorigin-parallax' => 'true',
'loading' => 'eager',
)
);

if ( ! empty( $image_html ) ) {
$parallax = true;
$output .= $image_html;
}
}

if ( empty( $url ) && ! empty( $context['style']['background_image_attachment_fallback'] ) ) {
$url = $context['style']['background_image_attachment_fallback'];
if ( ! $parallax && ! empty( $context['style']['background_image_attachment_fallback'] ) ) {
$parallax = true;
$output .= '<img src=' . esc_url( $context['style']['background_image_attachment_fallback'] ) . ' data-siteorigin-parallax="true">';
}

if ( ! empty( $url ) ) {
if ( $parallax ) {
wp_enqueue_script( 'simpleParallax' );
$output .= '<img src=' . esc_url( $url ) . ' data-siteorigin-parallax="true">';
}
}

Expand Down
16 changes: 9 additions & 7 deletions js/siteorigin-panels/dialog/row.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ module.exports = panels.view.dialog.extend({
this.$('.so-buttons .so-delete').remove();
}

if (!_.isUndefined(this.model)) {
if ( ! _.isUndefined( this.model ) && this.dialogType == 'edit' ) {
// Set the initial value of the
this.$( 'input[name="cells"].so-row-field' ).val( this.model.get( 'cells' ).length );
if ( this.model.has( 'ratio' ) ) {
Expand Down Expand Up @@ -203,12 +203,14 @@ module.exports = panels.view.dialog.extend({
};

// Set the initial value of the cell field.
this.$( 'input[name="cells"].so-row-field' ).val( this.model.get( 'cells' ).length );
if ( this.model.has( 'ratio' ) ) {
this.$( 'select[name="ratio"].so-row-field' ).val( this.model.get( 'ratio' ) );
}
if ( this.model.has( 'ratio_direction' ) ) {
this.$( 'select[name="ratio_direction"].so-row-field' ).val( this.model.get( 'ratio_direction' ) );
if ( this.dialogType == 'edit' ) {
this.$( 'input[name="cells"].so-row-field' ).val( this.model.get( 'cells' ).length );
if ( this.model.has( 'ratio' ) ) {
this.$( 'select[name="ratio"].so-row-field' ).val( this.model.get( 'ratio' ) );
}
if ( this.model.has( 'ratio_direction' ) ) {
this.$( 'select[name="ratio_direction"].so-row-field' ).val( this.model.get( 'ratio_direction' ) );
}
}

this.clearCellStylesCache();
Expand Down
12 changes: 10 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,20 @@ We've tried to ensure that Page Builder is compatible with most plugin widgets.

== SiteOrigin Premium ==

[SiteOrigin Premium](https://siteorigin.com/downloads/premium/) enhances Page Builder with a vast array of additional features and settings. Take your layouts to the next level.
[SiteOrigin Premium](https://siteorigin.com/downloads/premium/) enhances Page Builder with a vast array of additional features and settings. Take your layouts to the next level with SiteOrigin Premium addons.

SiteOrigin Premium also includes access to our next-level email support service, perfect for those times when you need fast and effective technical support.
SiteOrigin Premium includes access to our professional email support service, perfect for those times when you need fast and effective technical support. We're standing by to assist you in any way we can.

== Changelog ==

= 2.12.5 - 17 June 2021 =
* Modern Parallax: Use the image attachment if available.
* Modern Parallax: Prevent possible container overflow using CSS.
* Live Editor: Minor button alignment improvements.
* Developer: ACF compatibility - use `panelsopen` for more consistent loading.
* Developer: ACF compatibility - added a check to ensure instance ACF data exists.
* Developer: Fixed `siteorigin_panels_row_column_count_input` filter.

= 2.12.4 - 04 June 2021 =
* Restored Tablet Layout row collapse.

Expand Down

0 comments on commit c943527

Please sign in to comment.