Skip to content

Commit

Permalink
Merge branch 'master' into site-content-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyLedesma authored Apr 30, 2024
2 parents a0acd54 + 3e76e75 commit 7a29f78
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/blocks/post-carousel/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function coblocks_render_coblocks_post_carousel_block( $attributes ) {
'order' => $attributes['order'],
'orderby' => $attributes['orderBy'],
'suppress_filters' => false,
'post__not_in' => array( $post->ID ),
'post__not_in' => ! is_null( $post ) ? array( $post->ID ) : array(),
);

if ( isset( $attributes['categories'] ) ) {
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/posts/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function coblocks_render_coblocks_posts_block( $attributes ) {
'order' => $attributes['order'],
'orderby' => $attributes['orderBy'],
'suppress_filters' => false,
'post__not_in' => array( $post->ID ),
'post__not_in' => ! is_null( $post ) ? array( $post->ID ) : array(),
);

if ( isset( $attributes['categories'] ) ) {
Expand Down
8 changes: 7 additions & 1 deletion src/extensions/site-design/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,13 @@ export function SiteDesignStyles() {
// Here we move the style element so that we can continue to target and change on user action.
// Only move element if it is not yet under the desktop preview div.
if ( ! stylesElement.closest( 'div.is-desktop-preview' ) ) {
document.querySelectorAll( '.is-desktop-preview style:last-of-type' )?.[ 0 ]?.after?.( stylesElement );
const target =
document.querySelectorAll( '.is-desktop-preview style:last-of-type' )?.[ 0 ] ??
document.querySelectorAll( '.is-desktop-preview div' )?.[ 0 ];

if ( !! target ) {
target?.after?.( stylesElement );
}
}
}, [ isUpdating, designResp ] );

Expand Down

0 comments on commit 7a29f78

Please sign in to comment.