Guide

Publication Listing architecture

Bootstrap lives in includes/class-bootstrap.php. Core query logic and the _post_visibility taxonomy live in includes/class-query.php. Editor assets: src/post-visibility/ and src/core-query/.

Concepts

TermMeaning
Publication listingHome, taxonomy archive, or search context that lists publications
isPubListingQueryFlag set on WP_Query (and available as a REST query param) when listing rules apply
prc-publication-listing supportPost types that opt into listings, visibility taxonomy, and editor toggles

Query flow

Flow

Publication listing query

3 relationships
Priorities 1 and 11 on pre_get_posts.
  1. init_pub_listing__wp_query (pre_get_posts, priority 1) detects home / archive / search on the primary site and sets isPubListingQuery.
  2. hook_pub_listing_args_into__wp_query (priority 11) merges Query::get_filtered_query_args() when the flag is set.
  3. include_in_main_feed (priority 11) merges Query::get_enabled_post_types() into the main /feed/ query only (not comment, archive, singular, search, or custom add_feed slugs).

Filtered query args

Query::get_filtered_query_args() typically:

  • Merges supported post types into post_type
  • Sets post_parent to 0 unless showChildPosts is present (non-search)
  • Forces post_status to publish and ignore_sticky_posts to true
  • Adds a _post_visibility tax_query excluding slugs from Query::get_visibility_terms() (default hidden-on-index or hidden-on-search)

Opting in a post type

add_action( 'init', function () {
	add_post_type_support( 'my-post-type', 'prc-publication-listing' );
}, 5 );

Priority 5 runs before taxonomy registration. Support also works inside register_post_type() supports.

Filters

FilterPurpose
prc_platform_pub_listing_default_visibilityMap of post_type => term slug[] applied once on first insert
prc_platform_pub_listing_visibility_termsReplace the default visibility slugs to exclude. An empty list skips the default exclusion.
prc_platform_pub_listing_default_argsAdjust listing query args after support and visibility rules

REST

Core post collection queries accept isPubListingQuery=true so clients can apply the same listing rules. This is not a custom route namespace.

Editor blocks / assets

AssetRole
prc-publication-listing/post-visibilityStatus panel visibility toggles
prc-block/core-queryEnhances core/query with listing context and defaults

Was this helpful?