Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: errors and bugs related to WP 5.8 #83

Merged
merged 1 commit into from
Jul 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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