Try this in your theme’s functions.php
file, or a .php
file of a plugin that you may be writing:
add_action('save_post', 'xxx_save_meta_box');
function xxx_meta_box_callback() {
add_meta_box('xxx-meta','xxx Details','xxx_meta_box','xxx-post-type','side','default');
error_log('meta box cb');
}
function xxx_save_meta_box($post_id, $post) {
error_log('running ...');
die('OK!!!');
}
Related Posts:
- Is there a filter/action to add content to WP admin metaboxes?
- save_post not working with attachments
- How to hook something before edit_form_title?
- How do wordpress hooks respond to user interaction?
- A correct hook for saving meta boxes data
- Meta boxes not showing up
- What is the “Advanced” $context in add_meta_box?
- Creating a metabox to upload multiple images
- Post custom metabox textarea using wp_editor
- How do I get attachment_id?
- Removing Metabox for “Slug” without removing functionality
- Prevent sorting and dragging of specific postbox metabox
- Removing meta boxes: remove-meta_box() or unset()?
- CMB2 metabox conditional logic
- How to pass variable via $callback_args for add_meta_box
- Undefined function error when creating Custom Meta Box
- How to get meta box data to display on a page
- Move excerpt to always be directly below post content in admin
- Use meta box value in CPT as post title
- Getting the ID of a meta box
- Custom filter for the_content doesn’t work correctly
- Check if meta key value already exists
- Is there a predefined callback function for custom categories?
- Conditional Meta Boxes
- Why is `add_meta_box` not working?
- How to access global $wp_meta_boxes variable on front-end?
- PHP Warning: call_user_func() expects parameter 1 to be a valid callback
- prevent post submission
- $post->ID incorrect within meta box
- How do I display Youtube/Vimeo video ID on custom post type when user enters it in custom meta box?
- WordPress media manager multiple selection output
- post-excerpt not one of the options under screen options
- How to remove/hide the predictive autocomplete popup when I type in the tag/term metabox
- metabox upload file
- Are there any standard HTML markup for metabox?
- Can not pass the value of google pie chart from custom meta box
- Dynamically adding WYSIWYG to metaboxes
- Filter Hook Returning Blank When Used Twice
- How to add a SAVE button to replace PUBLISH on a custom post type?
- Why does get_post_meta not work with the posts page?
- Taxonomy as checkboxes
- What are ‘authors’ in WordPress, and is there an author ‘metabox class’ available anywhere?
- Convert textarea with wp_editor
- Trying to limit access to custom meta box without success
- Using wp_editor tinyMCE in metabox cause form alert on leaving page
- Setting multiple image urls using WordPress’ Media Uploader
- Custom metabox field help tips popups
- How to detect if metabox content was updated by the user
- Getting gutenberg (WordPress 5) to save TInymce data?
- Adding metabox to wordpress plugins menu page
- Edit woocommerce product post type
- Get meta fields by meta box id
- Set default value for radio button in WP Alchemy custom meta box?
- quicktags “link” button doesn’t work, but all other buttons do
- Add custom action in post type
- PHP Notice: Undefined index: mytheme_meta_box_nonce
- Polylang not translating Metabox fields [closed]
- Global Variable vs Local Variable
- input radio ‘checked’ saves, but select option ‘selected’ doesn’t
- save_post_{$post->post_type} action firing on second save
- Add a metabox when editing a media – but only for images
- edit_page or edit-pages for current_user_can()?
- Save meta data with post, Without using any plugin [closed]
- Metabox not being added
- Editor meta box Showing but not saving
- Adding a metabox shortcode “paypal accept payment” in my custom post type back-end
- The $post variable – Did I get the grasp of how the Backend actions get parsed?
- Change the title of an Administration Panel
- display metabox on front end (my-metabox-class)
- Custom Meta Box calling JS function twice
- Custom Meta Data is not being saved
- how to reset metabox excerpt to open
- How to create a custom metabox like the wordpress provided tag metabox?
- Update Post meta with custom variable
- How to alter static Page text through the Theme Customizer API
- Moving a metabox – not obeying context or removing old
- Programmatically create new post from a metabox button
- Saving metabox content not working
- semantic ui dropdown for custom metabox
- How to hide/show meta box using jQuery,if click on Drop-Down Menu
- wp_editor metabox does not output the saved html format
- Get value from meta box
- Adding Meta Box to Specific Submenu Page
- Multiple category filters
- meta_box: update_post_meta for
- Issue with file paths after porting metabox from main theme to child theme
- Error in get post by met_key
- Custom meta box not saving values of radio buttons in WordPress
- Display multiple “save draft button” on a post edit
- Serialization problem after auto-update
- Selecting a dynamic sidebar via metabox in wordpress
- Add additional metafields based on value of select box
- Issues with Saving Dynamic Metabox
- Updating post meta and Meta Box plugin
- header specific meta box result detect url
- Meta Boxes causing Header errors
- Attaching a metabox to a single post
- How do I allow Authors and Contributors to use the metabox
- CSS styling not working in a custom metabox
- My meta box don’t want to save value