<?php
$args = array(
'public' => true,
'_builtin' => false
);
$output="names"; // names or objects, note names is the default
$operator="and"; // 'and' or 'or'
$post_types = get_post_types( $args, $output, $operator );
foreach ( $post_types as $post_type ) {
echo '<p>' . $post_type . '</p>';
}
?>
It will list of all public custom post types and you can read documentation on get_post_types here .
Related Posts:
- Meta Boxes: ‘admin_init’ or ‘add_meta_boxes’ hook?
- Action hook on Edit custom post type?
- Remove tabs from media uploader for a CPT
- Priority of Meta Box for Custom Post Type
- How can i add a metabox to pull list of custom posts (any two) on edit or add post screen?
- How to add a select menu to this metabox code?
- Using ‘strtotime’ function to convert a custom-meta-box to a date-stamp
- How to Change the Title of a Meta Box on a Specified Custom Post Type? [duplicate]
- How to save the checked boxes?
- Metabox saving values
- Having trouble with custom post type / meta box
- add_meta_box: Datepicker like the one for postdate?
- update custom post type meta from a shortcode
- Calculate Repeater Meta Box Input Field Values and Display Total
- Change Post Title Edit Box
- Custom Post Type Meta Boxes
- Multiple information using custom post type
- How to keep a check box in custom meta box for custom post type checked by default for add new post?
- Show metabox in custom-post-template depending on taxonomy term?
- get_terms won’t display product_cat or any other custom taxonomies when specified
- Formatting custom meta box date from YYYY/MM/DD to a more readable alternative
- Using WPAlchemy metabox values in another metabox
- Display custom post on home page based on a metabox selection
- How to add a “custom” date field to a custom post type?
- adding checkbox to meta
- Meta Box Only in CPT Edit Page, Not in Add New
- Why do I lose the content of meta boxes when I leave the page?
- Dynamically add / duplicate custom meta in custom post types
- How can I create a custom meta box to add an mp4 video to a page?
- List of Posts in a Custom Field
- Pull a post based on a meta value in a custom post type
- Change meta box when the page’s template is changed
- Cannot save Checkbox meta box value from a Custom Post Type
- Undefined Variable – Custom Post Type Meta
- Add Standard Page Attributes Metabox for Page Parent
- Custom date changer post_date => future – missed schedule error
- Found 2 elements with non-unique id (#_ajax_nonce) and (#_wpnonce)
- Metabox not show in categories custom post type cmb2
- Repeatable Fields Metabox with Textarea (or wp_editor)
- How to use TinyMCE Editor for one of my custom post meta field?
- Display correctly using metabox.io
- pre_get_posts for custom page builder meta box
- How to make custom taxonomy into drop down select in a custom metabox
- Translating custom post type metaboxes [closed]
- How to Add multiple instance of meta box to custom post type
- Using POST method in meta box, no results
- Ordering values entered in Custom Taxonomies
- Permalinks: custom structure for taxonomy – tags?
- Custom Post Type & Meta Box – Displaying meta box information on front end?
- Global custom meta box
- Add a custom meta box for client to order CPT posts how they want
- Use remove_meta_box conditionally on custom post type
- create custom meta box with default value
- Issue on Working with Metabox – Checkbox to enable Sale Items
- wysiwyg editor don´t export paragraph
- How to make a meta box?
- Forms and WordPress Nonce
- Why do I have to press the “Update” button twice to save my meta box values?
- Inefficient Query Confusion
- Prevent custom post type from showing up in custom menus
- link featured image to external link
- Odd behaviour for the update button when displaying a WP_List_Table
- Creating alternate meta box context locations
- Showing a meta box in a custom post type on a page
- Having Issue on Getting Metabox Checkbox Value
- Custom meta box in custom post type not working
- WP_Meta_Query object with conditionals
- I can’t connect my custom jquery to wp admin
- Saving meta box data?
- Updating post content and custom fields in edit post screen
- Add a class to post_class if more than one post shares same meta_value_num
- Function to return values from metabox
- Invalid file type when using wp_upload_bits to upload PDF to a custom post type
- Add a meta field to the list of results for a custom post type
- Metabox does not show in custom post type
- One Custom Post Type two different Templates
- Create a custom post type based on ‘Post’
- Include a metabox in the ‘home’ screen of a custom post type? If not, then the dashboard page?
- Placing Admin Post Metaboxes in Tabs
- Wp Meta Query does not work while simple Query Works
- How to get custom post type with dynamic ID
- Custom metabox with image gallery upload that won’t attach images to post
- Wp Query sort order from custom MetaBox
- How to retrieve custom post type permalink in another cpt?
- do action inside a class is not working
- How to add a custom meta box below publish box in CPT that is like publish meta box and can contains html?
- Search form to find custom meta box generated data
- Edit post meta direct from post.php?
- How to Arrange Support => Thumbnail
- Add different meta box based on taxonomy
- Custom metabox value not saving
- Yearly Archive from a custom date metabox (Event Start Date)
- Need to build custom metabox select prev posts by category
- Saving custom metabox data with a twist
- loop through custom post-type with two meta_keys
- Custom Post Type + Custom Meta Query Not Showing 2012 Posts
- CPT Template Option to Top
- Use a Variable in update_post_meta as the $meta_key
- Canot save post if any meta box was empty
- custom post type with metabox custom fields