Skip to content

Commit

Permalink
Merge pull request #813 from siteorigin/block-editor-post-loop-fix
Browse files Browse the repository at this point in the history
SiteOrigin Layout: Allow Post Loop widget to be previewed
  • Loading branch information
Misplon authored Sep 21, 2020
2 parents beb8c30 + 97018c7 commit 5c30121
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions inc/widgets/post-loop.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ function update( $new, $old ){
*/
function widget( $args, $instance ) {
if( empty( $instance['template'] ) ) return;
if( is_admin() ) return;

// The Post Loop widget should only preview in WP Admin if it's Layout Block preview.
if ( is_admin() && ! ( isset( $_POST['action'] ) && $_POST['action'] == 'so_panels_layout_block_preview' ) ) {
return;
}
static $depth = 0;
$depth++;
if( $depth > 1 ) {
Expand Down

0 comments on commit 5c30121

Please sign in to comment.