Skip to content

Fix WPGraphQL support for extended post types and taxonomies#7511

Open
pdclark wants to merge 1 commit into
pods-framework:mainfrom
pdclark:fix/wpgraphql-extended-types
Open

Fix WPGraphQL support for extended post types and taxonomies#7511
pdclark wants to merge 1 commit into
pods-framework:mainfrom
pdclark:fix/wpgraphql-extended-types

Conversation

@pdclark
Copy link
Copy Markdown
Collaborator

@pdclark pdclark commented Apr 7, 2026

Summary

  • Adds WPGraphQL fallback in setup_content_types() for extended post types and taxonomies, matching the existing REST API pattern.
  • When a third-party plugin registers a CPT before Pods' register_post_type_args filter is in place, show_in_graphql is now set directly on the global post type/taxonomy object.

Fixes #7450

Test plan

  • Extend a third-party CPT registered with public => false as a Pod
  • Enable WPGraphQL in the Pod settings
  • Verify the CPT appears in WPGraphQL without needing a manual filter workaround
  • Verify existing WPGraphQL integration for Pods-created CPTs still works

Set show_in_graphql directly on the global post type/taxonomy objects
for extended types in setup_content_types(), as a fallback for when the
register_post_type_args filter was not yet in place at registration time.

Fixes pods-framework#7450
@what-the-diff
Copy link
Copy Markdown

what-the-diff Bot commented Apr 7, 2026

PR Summary

  • Upgrade in the GraphQL logic for post types
    The update includes a new functionality that enables GraphQL representation for pre-existing post types. This is an adjustment that takes into account the possibility of post types being registered prior to the initiation of the register_post_type_args filter.

  • Added checks for wpgraphql_enabled setting
    Before feeding GraphQL information into the system, the PR has added a check to ascertain if the wpgraphql_enabled setting is active.

  • Error handling enhancements
    Errors and exceptions that may occur during the process are now effectively dealt with. Using a try-catch block, any errors can be logged for further troubleshooting and rectification.

  • Mapping of GraphQL names for post types
    There's a new feature mapping GraphQL single and plural names corresponding to existing post types. This allows more organized and logical presentation in the GraphQL framework.

  • Support for existing taxonomies in GraphQL
    Similar to post types, this update also offers support for GraphQL representation of existing taxonomies which were possibly registered before the initiation of register_taxonomy_args filter. The process follows similar checks and error handling as in the post type enhancements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WPGraphQL for WP Logo Showcase Responsive Slider and Carousel

1 participant