Skip to content

Commit

Permalink
fix: errors and bugs related to WP 5.8 (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkoo authored Jul 5, 2021
1 parent 2c49896 commit 90da6c5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
9 changes: 5 additions & 4 deletions includes/class-newspack-listings-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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' => [
Expand Down
1 change: 1 addition & 0 deletions src/assets/shared/listing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
img {
display: inline-block;
vertical-align: top;
max-width: 100%;
}

.media-position-left & {
Expand Down
4 changes: 4 additions & 0 deletions src/blocks/curated-list/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
border-top-color: var( --newspack-listings--border-light );
}
}

.query-mode .newspack-listings__list-container {
display: none;
}
}

&__placeholder {
Expand Down
4 changes: 4 additions & 0 deletions src/editor/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export const getCuratedListClasses = ( className, attributes ) => {
const {
backgroundColor,
hasDarkBackground,
queryMode,
showNumbers,
showMap,
showSortUi,
Expand All @@ -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 }` );

Expand Down

0 comments on commit 90da6c5

Please sign in to comment.