bricks_get_post_types
Overview
Lists all registered WordPress post types including built-in types (posts, pages, attachments) and any custom post types (CPTs). Returns the slug, label, description, archive status, and REST API base for each type.
This tool is essential during Phase 1 to discover what content types exist on the site, and after registering new CPTs with bricks_register_post_type to verify they are active.
Key Features
When to Use
After registering a new CPT to verify it is active and has the correct settings
Before setting up query loops to confirm the correct post_type slug
When planning dynamic content templates for custom post types
To check REST API bases needed for external integrations
When NOT to Use
When you need taxonomy information specifically — the site context includes taxonomies too
Parameters
(none)noneoptionalCode Examples
Warning: Undefined array key "example_output" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 12
Discover Available Post Types
Lists all registered post types. Use the returned slugs in query loops, bricks_create_post, and template conditions.
bricks_get_post_types()Common Mistakes
Warning: Undefined array key "fix_description" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 47
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-includes/kses.php on line 2018
Warning: Undefined array key "wrong_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 48
Warning: Undefined array key "right_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 49
Warning: Undefined array key "fix_description" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 47
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-includes/kses.php on line 2018
Warning: Undefined array key "wrong_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 48
Warning: Undefined array key "right_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 49
Tips & Warnings
REST base matters: When using wp_list_posts, you need the REST base (usually the slug), not the post type name. Check the rest_base field in the response.
Archive pages: Post types with has_archive=true automatically get an archive page at /slug/. Types without it require manual archive template creation.