8000 Issue-314: Query block init needs to run at higher priority to pick up custom post types by mogmarsh · Pull Request #316 · alleyinteractive/wp-curate · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Issue-314: Query block init needs to run at higher priority to pick up custom post types #316

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

Merged
merged 3 commits into from
May 15, 2025

Conversation

mogmarsh
Copy link
Collaborator
@mogmarsh mogmarsh commented May 15, 2025

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 to 2.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 version 2.6.2 of the WP Curate plugin as part of its changelog.

Steps To Reproduce

  1. Add custom post types at init priority 10 (or higher).
  2. Add the post types to the allowed post types list by filtering wp_curate_allowed_post_types.
  3. View a query block. You will not see the custom post types as options.

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 to 2.6.2 to reflect this change, and the changelog has been updated accordingly.

Testing Instructions

  1. Register a custom post type at init priority 10 (or higher).
  2. Add the custom post type to the allowed post types list using the wp_curate_allowed_post_types filter.
  3. Verify that the custom post type appears as an option in the query block after applying this fix.

@mogmarsh mogmarsh added bug Something isn't working php Requires understanding PHP gutenberg Requires understanding Gutenberg labels May 15, 2025
@mogmarsh mogmarsh marked this pull request as ready for review May 15, 2025 15:45
@mogmarsh mogmarsh merged commit 7c0d03f into develop May 15, 2025
4 checks passed
@mogmarsh mogmarsh deleted the fix/issue-314/query-block-init-priority branch May 15, 2025 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gutenberg Requires understanding Gutenberg php Requires understanding PHP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Query block init needs to run at higher priority to pick up custom post types
2 participants
0