Issue-314: Query block init needs to run at higher priority to pick up custom post types #316
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #314
This pull request addresses an issue where custom post types registered at
init
priority 10 (or higher) are not being picked up by the query block. The initialization priority for the query block has been adjusted to ensure all post types and taxonomies are registered before being referenced. Additionally, the plugin version has been updated to2.6.2
to reflect this enhancement.Description
The issue arises because the query block's initialization currently runs at a priority that may precede the registration of custom post types, particularly when those post types are registered at a higher priority (e.g., 10 or above). This results in custom post types not appearing as options in the query block.
The fix involves increasing the initialization priority of the query block to
900
, ensuring that all post types and taxonomies are registered before being referenced by the block. This update will also be included in version2.6.2
of theWP Curate
plugin as part of its changelog.Steps To Reproduce
init
priority 10 (or higher).wp_curate_allowed_post_types
.Additional Information
This issue is particularly relevant for post types generated by Mantle models. The fix ensures compatibility with such models and other cases where post types are registered at later priorities.
The plugin's version has been updated from
2.6.1
to2.6.2
to reflect this change, and the changelog has been updated accordingly.Testing Instructions
init
priority 10 (or higher).wp_curate_allowed_post_types
filter.