Not really a complete answer, but since this question’s become a ghost town I thought it was worth adding.
$post_type = get_current_screen()->id; // when on post.php or post-new.php
It’s been around for a while, but with 3.3’s much improved screen API I can see this opening a new world of easier, on-demand loading.
Related Posts:
- How to add multiple images to custom post type?
- WordPress metabox file upload in custom post [duplicate]
- Save or update data when custom post published
- How to: add option to add more checkboxes on custom post type
- How to add multiple featured image in meta box in post editor?
- how to set default value for checkbox in wordpress
- Adding Meta Boxes while Registering a Post Type in a Class
- How to use TinyMCE Editor for one of my custom post meta field?
- Adding a metabox on a CPT’s submenu page
- Save Multiple Metabox values
- How to insert data into meta box from another plugin?
- Custom Meta Box returns no HTML
- How to Use Custom Meta Field Instead of CPT Title in Post URL
- Creating alternate meta box context locations
- Is it possible to sort metabox teaxtarea values?
- Create a select metabox that the user can pupolate?
- Wp Meta Query does not work while simple Query Works
- Show a custom post title in another custom post type in Meta box
- WP_List_Table Inside Metabox Not Working on Clicking Search Button
- Getting data from dynamically allocated metaboxes within a custom post
- Admin metabox with custom post type dropdown option not update choosed input after saving
- How save custom meta type posts multicheck grouped by taxonomy (with CMB2) [closed]
- php output of generated custom metabox
- Custom meta box in editor of custom post type not working
- Not Able to Display Metabox Saved Checkbox and Selected option After Save/ Update
- How to consume external API from WordPress post editor and display the response data in the custom field?
- Do I need a nonce field for every meta box I add to my custom post type admin?
- Help Creating a Slideshow Custom Post Type with Custom Meta Boxes?
- How to force one column layout on custom post type edit page?
- Custom Post Type – Taxonomy Dropdown Menu?
- How to set a fall back template for a custom post type in a plugin?
- How do I remove all the metaboxes for a custom post type?
- How To Set Custom Post Type Title Without Supports
- Creating a Custom Post Types dropdown in a Meta Box
- get_edit_post_link() not working as expected when passed id in plugin
- How do I Make a custom post type get a custom post template in a plugin
- Add pre-existing meta box to new custom post type
- working Custom Post Type and Widget code no longer works when moved from functions.php to plugin
- Display metabox conditionally
- Row actions not showing? Why?
- How do I add a custom button to my “edit” list? ( edit.php?post_type= ) beside “Add New”
- Timepicker-addon doesn’t show – Datepicker works fine?
- How to have the right design for a custom post type without accessing themes
- Dynamic Custom Post Type Plugin
- Get all of user’s custom post types in WP Admin for plugin
- WordPress custom meta field for custom post not storing data
- How to Get Current Custom Post Type Selected Taxonomy Term (Not All Terms)
- How to Duplicate (multiple meta box)?
- Custom Post Type: Upload Multiple Images
- Getting template_include to work when allow_url_include is off?
- How to Upload CSV Data into Custom Post Type Data with Metabox programmatically
- Ordering values entered in Custom Taxonomies
- Permalinks: custom structure for taxonomy – tags?
- Custom Post Type & Meta Box – Displaying meta box information on front end?
- Sizing textarea field in custom metabox
- Suggestion on custom post type/ taxonomy relationship
- Custom Post Meta from custom metaboxes is randomly being deleted
- How to add editable/dynamic values to dropdown of a Custom Post Type Meta Box
- Add form after woocommerce admin order edit
- Get custom term meta problem on single post type
- Validate Custom Post Type fields
- wp_editor for custom post type doesn’t save value
- Modify a plugin function output from another plugin
- CMB select with data from CPT
- Custom rewrite rules for /pastissues/%category%-%postname%.html
- Writing a custom Glossary plugin
- List of all posts in one custom post type in the edit screen of another
- Change Text in Admin Panel
- How to show Custom Post Types under Taxonomy in a new WordPress page template?
- Custom Endpoint For Specific Custom Post Type
- Unable to gather Image URL from Custom Post Type’s; Custom Meta Field
- How to display the post using a shortcode in WordPress?
- How to Grab Anime info using Jikan API and fill the value in Metabox
- Custom post type specific item design
- create a “add icon” field in taxonomies page
- Shortcode and get_template_part
- dynamic vue widget inside custom post
- Get meta values from parent post and save in child post
- WP REST API Custom endpoint don’t work in my plugin
- how to allow subscriber to add/edit/delete custom post type
- check_admin_referer not working in custom meta box for custom post type
- Populate metabox dropdown with post title from another Custom Post Type (issues with wp_reset / global $post)
- Facing some Issues on Two Parts Custom Post Type Taxonomy Names
- Meta box not saving
- Remove Custom Capability
- Can I override the permalink/slug on creation
- call_user_func_array() error after moving to another server
- CPT and metabox: create multi checkbox by using array?
- Default taxonomy ‘post_tag’ added to CPT managing by custom role : nothing in the metabox
- Custom sortable pages on custom post type
- Toggle a metabox based on a selection
- Add multiple custom meta boxes to different custom post types
- Custom post type Featured Image popup not working
- Issue on Adding Taxonomy to Custom Post Type Using Function
- Custom Post Types in plugins?
- How to bring custom meta boxes to custom post types?
- Problems with a custom meta_box
- How to apply order on custom taxonomy and custom meta key on custom post type
- Don’t display post if post has empty body
- How to filter custom post data with AJAX?