-
Notifications
You must be signed in to change notification settings - Fork 2
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
Ensure the current post does not appear in auto generated lists of backfilled posts #162
Conversation
This update changes the handling of the backfillPosts response in the wp-curate plugin. It introduces a check to filter out the currentPostId from the response array or return null if the response is an individual post matching the current post. This ensures that the current post is not included in the backfillPosts attribute.
The version in wp-curate.php has been updated to 1.8.3. In this update, logic is also added to the backfillPosts query in the wp-curate plugin. This change is to ensure that the current post is not included in the array of backfilled posts, providing a more accurate and desired output.
I don't think this addresses the front end |
I think to handle the front end, we should add a query class that will exclude the current post, then add that query class in https://github.com/alleyinteractive/wp-curate/blob/develop/src/features/class-query-block-context.php |
The |
Thanks! I will check it out, I was just trying to roll my own |
This commit includes an update to various npm package versions including 'body-parser', 'express', 'ip', 'follow-redirects', 'cookie', 'raw-body' and 'webpack-dev-middleware'. These updates are aimed at improving the overall functionality and security of the dependencies. Each library has been updated to a newer version, ensuring that we're using the latest available code.
This commit overhauls the filter_query_context method in the WP-Curate WordPress plugin. It reorganizes code for improved readability and clarity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good. As far as I can tell the logic should be the same on the front end. Did you get the same results in the editor and the front end with this change? And did you get the same results on the front end with the current production and this PR (with the exception of removing the current post)?
I'm going to create an issue to add some tests so we can make changes like this with more confidence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updates on the queries side look good to me!
The class Query_Block_Context is no longer readonly to support PHP 8.1. Its properties have also been updated to readonly to prevent unintentional changes. An inline comment has been added for code clarification.
The version of the WP Curate plugin has been updated in the changelog, from 1.8.3 to 1.9.0. The change reflects the latest enhancements including the exclusion of the current post in backfilled post queries.
This commit updates the WP Curate plugin to version 1.9.0 and makes minor changes to the code for better readability. It also shifts the add_action function and InstalledVersions class to the global namespace to eliminate the need for backslashes.
This commit introduces a fallback case in the object destructuring assignment in query block edit.tsx to improve error handling. Additionally, it refines the parameter type in the useSelect hook for better type safety, making the logic clearer and securing the implementation.
The commit includes a minor type assertion alteration and makes a slight adjustment in a function argument within 'edit.tsx'. The "(window as any as Window)" is modified to ensure that it correctly uses TypeScript type assertion. Also, "(select: any)" is updated in the 'useSelect' function, removing the unnecessary type info from the argument.
Addresses #93
Ensure the current post is not included in the any auto generated lists of backfilled posts (but the user can still choose it.) Also includes
npm audit fix
and a minor refactor for readability (hopefully)