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

Issue-237: updateValidPosts check does not pass post types and only checks for valid posts, other post types fail #238

Merged
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
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.4.2 - 2024-09-27

- Bug Fix: Posts not of type 'post' are flagged as being deleted.

## 2.4.1 - 2024-09-19

- Enhancement: Enable support for hiding post type selection from block settings UI.
Expand Down
5 changes: 3 additions & 2 deletions blocks/query/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,10 @@ export default function Edit({
offset: 0,
orderby: 'include',
per_page: postsToInclude.length,
type: 'post',
type: postTypeString,
include: postsToInclude,
_locale: 'user',
context: 'edit',
},
),
}).then((response) => (response as any as WpRestApiPosts).map((post) => post.id));
Expand All @@ -197,7 +198,7 @@ export default function Edit({
mainDedupe();
};
updateValidPosts();
}, [manualPosts, setAttributes]);
}, [manualPosts, setAttributes, postTypeString]);

for (let i = 0; i < numberOfPosts; i += 1) {
if (!manualPosts[i]) {
Expand Down
5 changes: 3 additions & 2 deletions blocks/subquery/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,10 @@ export default function Edit({
offset: 0,
orderby: 'include',
per_page: postsToInclude.length,
type: 'post',
type: postTypeString,
include: postsToInclude,
_locale: 'user',
context: 'edit',
},
),
}).then((response) => (response as any as WpRestApiPosts).map((post) => post.id));
Expand All @@ -212,7 +213,7 @@ export default function Edit({
mainDedupe();
};
updateValidPosts();
}, [manualPosts, setAttributes]);
}, [manualPosts, setAttributes, postTypeString]);

for (let i = 0; i < numberOfPosts; i += 1) {
if (!manualPosts[i]) {
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.4.1
* Version: 2.4.2
* Author: Alley Interactive
* Author URI: https://github.com/alleyinteractive/wp-curate
* Requires at least: 6.4
Expand Down