Skip to content

Commit

Permalink
Merge pull request #234 from alleyinteractive/hotfix/unpublished-post…
Browse files Browse the repository at this point in the history
…s-filter

Hotfix/unpublished posts filter
  • Loading branch information
mogmarsh authored Sep 16, 2024
2 parents ce3d00d + bed1cfd commit dcf9298
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to `WP Curate` will be documented in this file.

## 2.3.3 - 2024-09-16

- Bug Fix: Hold space on the front end for curated posts that were deleted.

## 2.3.2 - 2024-09-09

- Bug Fix: Prevent block transforms from crashing the Query block.
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions src/class-plugin-curated-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,10 @@ public function with_query_context( array $context, array $attributes, WP_Block_
}

$pinned_posts = $attributes['posts'] ?? $block_type->attributes['posts']['default'];
$pinned_posts = array_filter( $pinned_posts, function ( $id ) {
return 'publish' === get_post_status( $id );
} );
$pinned_posts = array_map( fn ( $id ) => $id && 'publish' === get_post_status( $id ) ? $id : null, $pinned_posts );

$queries = new Positioned_Post_Queries(
positioned: is_array( $pinned_posts ) ? $pinned_posts : [],
positioned: $pinned_posts,
default_per_page: $args['posts_per_page'],
origin: $this->queries,
);
Expand Down
2 changes: 1 addition & 1 deletion wp-curate.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: WP Curate
* Plugin URI: https://github.com/alleyinteractive/wp-curate
* Description: Plugin to curate homepages and other landing pages
* Version: 2.3.2
* Version: 2.3.3
* Author: Alley Interactive
* Author URI: https://github.com/alleyinteractive/wp-curate
* Requires at least: 6.4
Expand Down

0 comments on commit dcf9298

Please sign in to comment.