You are getting that fatal error because your custom mdb_save_metaboxes
function is expecting to receive 3 parameters (function mdb_save_metaboxes($post_id, $post, $update)
), but WordPress only passed 1 parameter, because you did not tell WordPress that it needs to pass 3 parameters.
So to fix the issue, set the fourth parameter for add_action()
like so:
// If you do this, only 1 parameter will be passed to mdb_save_metaboxes:
add_action('save_post', 'mdb_save_metaboxes');
// So do this instead, to ensure that 3 parameters passed to the function.
add_action('save_post', 'mdb_save_metaboxes', 10, 3);
Related Posts:
- WP_List_Table Inside Metabox With Bulk Actions Not Working on Submit
- Get List of Registered Meta Boxes and Removing Them
- How to add tab which is visible only in admin side of product in woocommerce? [closed]
- Nonces can be reused multiple times? Bug / Security issue?
- What is nonce and how to use it with Ajax in WordPress? [duplicate]
- Dashboard like meta boxes in my plugin – how to save their position and open/closed state?
- Fatal error: Call to undefined function wp_mail()
- Nonce in settings API with tabbed navigation
- WordPress REST API call generates nonce twice on every call
- Save metabox with multiple checkbox array
- How to Use WordPress Color Picker API in Custom Post Type Metabox
- How to create Image gallery Metabox in wordpress [closed]
- Conflicting save_post functions when passing the post id and saving custom meta boxes for different post types
- How to add meta boxes to the ‘Add new post’ screen?
- Rearranging Dashboard meta boxes with use of plugin/functions.php
- Confusion on WP Nonce usage in my Plugin
- Plugin admin page meta_box toggle and order state not saving
- Metabox Not Showing on Custom Post Type But On Pages and Post
- WordPress password reset – why post rp_key?
- Best choice of options/settings framework for plugin/theme development
- Verify Nonce returns false – Request Nonce returns correct value
- Admin auto-refresh is interfering with Firebug — how to prevent it?
- Show add_meta_box by selecting a specific category
- update post meta for checkbox in the admin when inserted in the front-end
- Maximum lifetime for nonce
- Custom Taxonomy to dropdown box on adminside wordpress
- Create & Save multiple Meta-boxes
- Add a Save Button to Custom Meta Box [duplicate]
- Dashboard – get status and position of metaboxes and pass them to ajax method
- Passing nonce at admin menu link
- Getting List of all registered Dashboard Widgets
- what is the difference between these phares?
- Is nonce in PHP form and Ajax both necessary?
- How to get Metabox custom field to show checked if value is updated using post meta query?
- How do I update a field of a meta box?
- Custom login doesn’t work properly
- Input value from metabox is not found in $_POST after post save
- Including comments meta box on a plugin page
- wp_nonce_field displaying twice
- Fatal error: Call to a member function get_page_permastruct() on a non-object
- How to add a widget to the post editing view?
- Adding admin menus to wordpress
- Fatal error: Uncaught Error: Call to undefined function convert_to_screen()
- Automating the process of shortcode generation in a plugin – how is it done?
- Fatal error: Cannot redeclare admin_notice() [closed]
- Error: Call to a member function get_error_code() on a non-object
- The Correct Way to Use Nonce Field without Settings API
- Meta box on options page save form problem
- Moving/dragging a metabox removes TinyMCE’s content
- Store custom meta box data as serialized array
- WP nonce field checkbox prints checked=’checked’ outside input field
- Class cannot be found, but it’s available in the file, I get: Fatal Error: Uncaught Error: Class ‘Blocks\Base\Activation’ not found
- How to use nonce
- Where to use nonce
- How to add custom post widgets as tags into wordpress
- Any way to update_post_meta with html content? It gets stripped and becomes empty
- Adjust query on single
- Can I attach a plugin via my add_filter callback contents?
- Metabox is not displaying
- Catch metabox values in Plugin
- want to show CMB2 metabox on woocommerce product data tab
- Why is $_POST empty when saving custom Meta Box?
- Save meta box data from selected dropdown list in bbpress reply form
- Metabox types list
- WP_Fatal_Error_Handler OR WP_Error OR try/catch
- Uncaught Error: Call to undefined function wp_get_current_user() in
- Fatal error: Uncaught Error: Using $this when not in object context
- WordPress Filesystem create CSS-File – get Shortcode ID for Name
- How to save multiple values in custom post type from front end to back end
- add_meta_box does not display meta box in Admin
- Add WordPress Meta Box saved form input to WordPress RSS feed [duplicate]
- set a custom post type to a taxonomy term programmatically in metabox
- Dynamically getting tags in post edit screen
- How to show metabox just in post.php in admin?
- Plugin dev: How to multiply instances of a plugin in the same metabox?
- save_post not called in plugin / custom field still saving overwriting metaboxes
- Get fields of a widget
- Display Data’s metabox in page
- Show Metabox Images in slideshow instead of static
- How to set/change another post author by custom fields or something else?
- Fatal Error triggers Before WP_Error handler
- What is wrong with using add_option with Multisite instead of add_blog_option in a plugin
- $wp_filesystem returns NULL. What are the dependencies?
- set_sale_price in WooCommerce [closed]
- jquery document ready function not being called [closed]
- $reverse_top_level works the opposite way according to Codex?
- How to serve different thumbnails/images depending on users browser/platform
- How to export post meta with images in wordpress
- Parse form values before sending to options.php
- admin_post equivalent for guest user?
- I am trying to make a page in the admin section similar to the appearance of the Profile page for users
- unregister_setting() vs delete_option() for plugin update
- How to add Plugin functionality in WordPress Frontend Menus
- in_array function Problem
- Best practice for plugin: always detect admin-ajax call?
- Brainstorm – Slow Query from Plugin Need to Speed It Up
- How do I show how many products are remaining from the bought package
- How to create session for user which is not an admin user
- wordpress plugins with add-ons
- oneOf two possible objects in WP REST API?