diff --git a/includes/class-newspack-listings-blocks.php b/includes/class-newspack-listings-blocks.php index b54de409..124dc004 100644 --- a/includes/class-newspack-listings-blocks.php +++ b/includes/class-newspack-listings-blocks.php @@ -60,9 +60,10 @@ public static function manage_editor_assets() { true ); - $total_count = 0; - $post_type = get_post_type(); - $post_types = []; + $total_count = 0; + $post_type = get_post_type(); + $post_types = []; + $post_type_label = ! empty( $post_type ) ? get_post_type_object( $post_type )->labels->singular_name : 'Post'; foreach ( Core::NEWSPACK_LISTINGS_POST_TYPES as $label => $name ) { $post_count = wp_count_posts( $name )->publish; @@ -77,7 +78,7 @@ public static function manage_editor_assets() { 'newspack-listings-editor', 'newspack_listings_data', [ - 'post_type_label' => get_post_type_object( $post_type )->labels->singular_name, + 'post_type_label' => $post_type_label, 'post_type' => $post_type, 'post_types' => $post_types, 'taxonomies' => [ diff --git a/src/assets/shared/listing.scss b/src/assets/shared/listing.scss index 085e4fe8..57ec9944 100644 --- a/src/assets/shared/listing.scss +++ b/src/assets/shared/listing.scss @@ -83,6 +83,7 @@ img { display: inline-block; vertical-align: top; + max-width: 100%; } .media-position-left & { diff --git a/src/blocks/curated-list/editor.scss b/src/blocks/curated-list/editor.scss index f077c91d..170fc2f8 100644 --- a/src/blocks/curated-list/editor.scss +++ b/src/blocks/curated-list/editor.scss @@ -32,6 +32,10 @@ border-top-color: var( --newspack-listings--border-light ); } } + + .query-mode .newspack-listings__list-container { + display: none; + } } &__placeholder { diff --git a/src/editor/utils.js b/src/editor/utils.js index 75e281b4..a96634a5 100644 --- a/src/editor/utils.js +++ b/src/editor/utils.js @@ -90,6 +90,7 @@ export const getCuratedListClasses = ( className, attributes ) => { const { backgroundColor, hasDarkBackground, + queryMode, showNumbers, showMap, showSortUi, @@ -115,6 +116,9 @@ export const getCuratedListClasses = ( className, attributes ) => { } classes.push( 'has-background-color' ); } + if ( queryMode ) { + classes.push( 'query-mode' ); + } classes.push( `type-scale-${ typeScale }` );