If you remove the line global $post; (and really you should remove it), there is no reason this shouldn’t work, according to the official documentation, unless as @rudtek mentioned, you run a custom query somewhere and the $post has changed
Related Posts:
- 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?
- Multiple Custom Metabox Help
- How to force one column layout on custom post type edit page?
- Custom Post Type – Taxonomy Dropdown Menu?
- wp_dropdown_categories in custom post type with custom taxonomy
- How can I add a column/s to wp_posts table?
- How to add multiple images to custom post type?
- 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
- Find callback function for custom taxonomy metabox
- Remove custom metaboxes from custom post type
- Add pre-existing meta box to new custom post type
- Dynamic page.php template for custom post types
- Add special meta box to custom post type
- Custom field values get deleted
- WordPress metabox file upload in custom post [duplicate]
- Display metabox conditionally
- Adding Custom Metaboxes to Custom Pages
- Save or update data when custom post published
- Custom metabox translation
- How to add multiple featured image in meta box in post editor?
- Timepicker-addon doesn’t show – Datepicker works fine?
- Adding Meta Boxes while Registering a Post Type in a Class
- Metabox Populated with a Custom Post Type – How to Output CPT based on Select?
- Is it possible to create a post using a metabox?
- Custom Post Type Metabox – Not Saving
- WordPress custom meta field for custom post not storing data
- How to Duplicate (multiple meta box)?
- List of Posts in a Custom Field
- Add Standard Page Attributes Metabox for Page Parent
- dynamically add a custom field or metabox to custom post type [duplicate]
- Custom date changer post_date => future – missed schedule error
- How to Upload CSV Data into Custom Post Type Data with Metabox programmatically
- Display correctly using metabox.io
- Translating custom post type metaboxes [closed]
- Adding a metabox on a CPT’s submenu page
- How to Add multiple instance of meta box to custom post type
- Listing custom terms in custom post meta
- Can custom fields be added without a meta box?
- Can’t publish custom post type – “You are not allowed to edit this post.”
- Meta Box on Custom Post Type not saving
- Moving meta boxes in admin
- Meta-Boxes for CustomPostType cause PHP Errors and Notices in “Add New” view
- custom post type metaboxes not saving
- Custom post type, have only my meta boxes
- Display Repeatable Meta Box Content
- Can I restrict category availability?
- Displaying a div from an assigned meta_value when on a page
- Saving Meta Data within Custom Post Type
- Values from meta-box not on $_POST
- Metabox multiple custom post select -> display selected items?
- Custom post type suddenly stoped working after WordPress 5 update
- Get id from metabox dropdown
- Custom posttype content metabox
- Reusable metabox backend and frontend
- How can I output WPAlchemy repeating fields meta values in my page template?
- How can I modify a custom post type and custom page template for a child theme if all content seams to be handled by theme’s ‘native’ plugin?
- Meta box data not saving
- Questions regarding add_meta_box()
- Related posts meta_query CPT
- Meta box with front-end styling
- How to retrive Custom Post Type Meta Fields in Custom WP_Query
- Problem On Retrieving Post Meta Data on Custom Column [closed]
- Custom MetaBox : Food Menu Item Available Dates
- how to compare different timestamps in wp-query for events custom post types?
- Metaboxes inside Tab
- Custom Post Type meta data getting deleted on bulk editing taxonomies
- Create post meta box that links another post
- Show a custom post title in another custom post type in Meta box
- Modify Publish Metabox location on CPT
- PHP Warning with Custom Fields
- Custom taxonomy with custom post type archive page
- Metaboxes in Loop
- How save custom meta type posts multicheck grouped by taxonomy (with CMB2) [closed]
- Metabox messes up permalink
- Custom meta box data not saving
- Collect custom post in a calendar
- Render the metabox input values as HTML
- How to check if meta box value is false for all posts then do something based on that
- Custom metabox fields not saving when limited to a certain CPT
- Custom meta-box for all custom post types
- Repeatable WordPress custom fields in a metabox
- Meta-Box to add multiple items one at a time and on publish save all
- Display a post count from a custom metabox selection
- Displaying wp post categories into my custom metabox
- Make meta box appear if the previous if not empty?
- Filter CPT based on meta box value using Flexible Posts widget?
- Adapting plugin for custom post type?
- Custom meta box includes
- Creating entries with image attachements within posts and managing them in a list
- Post AND page parameter for WP function
- Add text to metabox input text field from Thickbox
- Show search for data extracted from metabox
- Issues on saving data from CPT select metabox
- Multiple posts selection [closed]
- Cannot change meta box position
- My custom meta box with textarea field not saved
- Can’t retrieve custom post type taxonomy term to custom post type editor