If you’re talking about on post pages in admin, couldn’t you just grab id from url?
$post_id = $_REQUEST['post'];
Related Posts:
- Use remove_meta_box conditionally on custom post type
- do action inside a class is not working
- How to enqueue scripts on custom post add/edit pages?
- Action hook on Edit custom post type?
- Unregister post type from child theme
- flush_rewrite_rules on save_post Does Not Work on First Post Save
- With what hook can I address all posts from all custom post types when they are published?
- What hook should be used to programmatically create a post only when master post is updated?
- How to register custom post types in a plugin?
- Remove “Get Shortlink” button in admin of custom post type
- Can’t unregister parent theme’s CPT from my child theme
- How to: Display ACF [fields] on Custom Post Types Utilising WordPress ‘Hooks’? [closed]
- Filter Posts from the Main Query
- wp_trash_post action hook with custom post type
- How do I amend form data before it is saved for a custom post type
- What do the numbers mean at the end of add_action(‘save_post’)…?
- Creating alternate meta box context locations
- Using `set_transient()` when saving a custom post type
- Using publish_{custom-post-type} hook for custom post type to update meta doesn’t work
- How to store additional data that is related to core data
- Create action running on trashed_post hook to modify post_meta value
- How to correctly get post type in a the_title filter
- How to add a button to custom post type’s posts-page
- How can I add a column/s to wp_posts table?
- How to intercept publish post for a custom post type “event”
- Admin Post Update Redirection to Posts Screen
- Remove tabs from media uploader for a CPT
- Add special meta box to custom post type
- Custom field values get deleted
- specify meta_key / meta_value condition for prev_post_link and next_post_link
- Priority of Meta Box for Custom Post Type
- 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?
- add_meta_box: Datepicker like the one for postdate?
- Save or update data when custom post published
- Custom Post Type Meta Boxes
- Formatting custom meta box date from YYYY/MM/DD to a more readable alternative
- Using WPAlchemy metabox values in another metabox
- Set a default category – if the user didn’t select one- before creating a post
- Dynamically add / duplicate custom meta in custom post types
- Custom Post Type Metabox – Not Saving
- How can I create a custom meta box to add an mp4 video to a page?
- Add custom column in custom post type edit page
- Pull a post based on a meta value in a custom post type
- Change meta box when the page’s template is changed
- Insert Multiple Post with Same Publish Button
- Cannot save Checkbox meta box value from a Custom Post Type
- Undefined Variable – Custom Post Type Meta
- Found 2 elements with non-unique id (#_ajax_nonce) and (#_wpnonce)
- Limit number of custom posts per taxonomy
- 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?
- pre_get_posts for custom page builder meta box
- How to make custom taxonomy into drop down select in a custom metabox
- Using POST method in meta box, no results
- Add additional field to custom post_type
- Save Multiple Metabox values
- Get rid of “trash can” for custom post type
- Create metaboxes based on custom post type
- How to Echo Metadata Value in Currency Format
- Problem with $post_id object’s property
- How To Display A List Of CPT Posts In A Meta Box On Menus Page?
- populate array with posts
- Forms and WordPress Nonce
- Why do I have to press the “Update” button twice to save my meta box values?
- CMB2 metabox create select with list of post from CPT
- Meta box data is saved but NOT displayed in the meta box text field. Why?
- Types plugin custom post add_action hooks
- Custom meta box in custom post type not working
- WP_Meta_Query object with conditionals
- Loading plugin text domain before registering post type
- comments hooks on custom post type
- Query Custom Posts – Add To Selection
- I can’t connect my custom jquery to wp admin
- Saving meta box data?
- How to sum values from all custom posts metabox
- Include a metabox in the ‘home’ screen of a custom post type? If not, then the dashboard page?
- Plugin Development using classes – Public & Private Callbacks
- How to get custom post type with dynamic ID
- Post Click Redirect to Custom URL instead of Single Post Page
- Custom metabox with image gallery upload that won’t attach images to post
- Hook create / update post
- Problem with multi checkboxes value in metabox?
- Wp Query sort order from custom MetaBox
- call a function when insert and update a custom post type
- How to retrieve custom post type permalink in another cpt?
- 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
- Custom metabox value not saving
- Yearly Archive from a custom date metabox (Event Start Date)
- Customized featured image doesn’t refresh in post admin metabox after upload/insert
- 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
- How to consume external API from WordPress post editor and display the response data in the custom field?