These are your problem lines:
if ( $_POST && !wp_verify_nonce($_POST['at_nonce'], __FILE__) ) {
return;
}
You check to see that $_POST
is set, but you don’t check $_POST['at_nonce']
. If $_POST
is set but that key is not then you will get a Notice
. It is a simple fix:
if ( isset($_POST['at_nonce']) && !wp_verify_nonce($_POST['at_nonce'], __FILE__) ) {
return;
}
When that Notice
prints, content is sent to the browser. Since that content is being sent before the proper headers are sent, when those proper headers are sent you get the “Cannot modify header information” warning.
Related Posts:
- Do I need a nonce field for every meta box I add to my custom post type admin?
- Custom Meta Boxes – Nonce Issue – Move to trash issue
- Found 2 elements with non-unique id (#_ajax_nonce) and (#_wpnonce)
- Forms and WordPress Nonce
- check_admin_referer not working in custom meta box for custom post type
- Remove Custom Taxonomy Metabox from Custom Post Type Screen
- Can you make a custom metabox field be required to save a new post?
- Action hook on Edit custom post type?
- Display content from custom meta boxes in revisions
- Changing the priority of a custom taxonomy’s metabox
- How to get custom metabox image field?
- Detect meta value changes when post is updated (post_updated)
- Custom field being erased after autosave
- How to select one major category (or custom taxonomy) for a 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?
- Cleanest way to code “Custom Write Panels/Meta 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
- 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 custom post types in metabox
- Pull a post based on a meta value in a custom post type
- Populate Custom Fields in a Custom Post Type?
- Change meta box when the page’s template is changed
- Duplicate Custom Header Functionality into the post edit screen
- Custom meta box data array: foreach not working correctly?
- Undefined Variable – Custom Post Type Meta
- Troubles with saving metabox
- How to check if user meta field is empty in conditional else statement
- Post Quote with image on header for news site
- How to Create an Image Upload Box for Custom Posts?
- How to store multiple values in 1 meta_key with radio input?
- Why are taxonomy terms not saving when using custom meta boxes with radio button taxonomy selectors?
- Plugin – Combine Meta Box Input Fields into single saveble record
- 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
- Disable closing on metaboxes
- Cannot save CPT meta box
- Create a Dropdown from Custom Post Type
- Using POST method in meta box, no results
- meta box on custom post type
- Add additional field to custom post_type
- Save Multiple Metabox values
- Create metaboxes based on custom post type
- 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
- Retrieving meta-box from a custom-post-type
- Create a custom post type for a photo post
- How to insert data into meta box from another plugin?
- CMB2 metabox create select with list of post from CPT
- Display metaboxes if checkbox ir marked
- Create a select metabox that the user can pupolate?
- Display custom meta on page that has been check in custom post type
- Sanitaizing Select Optin For Custom Post Type Metabox in WP
- Query Custom Posts – Add To Selection
- Saving metabox keys and storing values as array
- How to recover the post ID earlier in the WP admin hook action “firing” sequence?
- Publish box in CPT remove ‘edit’ link
- Saving a Custom Post Type with a Meta Box results in a “Updating Failed” error
- Create Post Types from a XML url (Real Estate website)
- WP_List_Table Inside Metabox Not Working on Clicking Search Button
- Add other all taxonomies as meta boxes to custom post type
- Dropdown of existing posts in a metabox
- Metaboxes in Loop
- How save custom meta type posts multicheck grouped by taxonomy (with CMB2) [closed]
- php output of generated custom metabox
- Custom meta box data not saving
- Collect custom post in a calendar
- Unable to get the values for metaboxes for custom post type
- Custom meta-box for all custom post types
- Howto: use existing post_meta as options for a different metabox (checkboxes or list)
- Meta-Box to add multiple items one at a time and on publish save all
- Displaying wp post categories into my custom metabox
- Filter CPT based on meta box value using Flexible Posts widget?
- Add Metabox to all custom post types
- Extending a CPT by Created by another plugin
- Creating entries with image attachements within posts and managing them in a list
- Show search for data extracted from metabox
- Issues on saving data from CPT select metabox
- Remove custom meta boxes from custom post type
- Multiple posts selection [closed]