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
- Add a post when another post type is inserting
- Hook create / update post
- PHP Warning with Custom Fields
- Problem with multi checkboxes value in metabox?
- publish_post action callback not executed, why?
- Sort custom post archives by a meta value from a different custom post type?
- Getting data from dynamically allocated metaboxes within a custom post
- Multiple useres editing specified content
- $_POST from a Meta Box
- Get meta values from parent post and save in child post
- Wp Query sort order from custom MetaBox
- Using meta boxes as the title of a custom post type
- Admin metabox with custom post type dropdown option not update choosed input after saving
- Correct way to register custom post type from external php file?
- Custom taxonomy with custom post type archive page
- Add other all taxonomies as meta boxes to custom post type
- Simple Data picker meta box
- Dropdown of existing posts in a metabox
- Wrong post ID in meta box callback
- Metaboxes in Loop
- How save custom meta type posts multicheck grouped by taxonomy (with CMB2) [closed]
- Keep br tags from stripping
- php output of generated custom metabox
- call a function when insert and update a custom post type
- check_admin_referer not working in custom meta box for custom post type
- Metabox messes up permalink
- Custom meta box data not saving
- Populate metabox dropdown with post title from another Custom Post Type (issues with wp_reset / global $post)
- Convert Custom Post Data to Javascript Array for Autocomplete
- Generating Custom Post Type list, within admin of another custom post type
- Collect custom post in a calendar
- How to retrieve custom post type permalink in another cpt?
- Custom meta box in editor of custom post type not working
- How to shows CPT which has specific meta key?
- Render the metabox input values as HTML
- Avoid another meta box in my custom post type
- Meta box not saving
- wp_dropdown_pages doesn’t allow me to select more than one custom post type
- Execute code only after user clicks ‘update’ button for CPT being edited
- Delete custom post type metadata without deleting the post in admin area
- Metabox is not saving
- Meta Box not being added in plugin
- Custom Fields as Post Type Options
- How to check if meta box value is false for all posts then do something based on that
- Adding Information To All Posts Screen
- Filter Content on all Post Types
- How to add a custom meta box below publish box in CPT that is like publish meta box and can contains html?
- Custom metabox fields not saving when limited to a certain CPT
- CPT and metabox: create multi checkbox by using array?
- Unable to get the values for metaboxes for custom post type
- Filter wp_dropdown_categories Per Post Type
- Search form to find custom meta box generated data
- Problem with ‘save_post’ hook not running
- Customizing a plugin function using a hook
- How to make post page unique and show it on home page?
- Custom meta-box for all custom post types
- Edit post meta direct from post.php?
- How can i embbed two different galleries in custom post type
- How to Arrange Support => Thumbnail
- Default taxonomy ‘post_tag’ added to CPT managing by custom role : nothing in the metabox
- Add different meta box based on taxonomy
- Not Able to Display Metabox Saved Checkbox and Selected option After Save/ Update
- Howto: use existing post_meta as options for a different metabox (checkboxes or list)
- Custom sortable pages on custom post type
- Repeatable WordPress custom fields in a metabox
- Meta-Box to add multiple items one at a time and on publish save all
- Toggle a metabox based on a selection
- Display a post count from a custom metabox selection
- WPAlchemy Metabox rewriting slug
- Custom metabox value not saving
- Add multiple custom meta boxes to different custom post types
- Hook only specific post type
- Custom post type Featured Image popup not working
- Displaying wp post categories into my custom metabox
- Yearly Archive from a custom date metabox (Event Start Date)
- Need to build custom metabox select prev posts by category
- How to bring custom meta boxes to custom post types?
- Select custom post by meta value
- Make meta box appear if the previous if not empty?