You have the add_action
that’s supposed to hook your prfx_meta_save
function inside the function itself, so it never gets hooked or called. You need to move the add_action
outside the function.
This will never work:
function prfx_meta_save( $post_id ) {
add_action( 'save_post', 'prfx_meta_save' );
}
Move it outside the function:
function prfx_meta_save( $post_id ) {
// your save code
}
add_action( 'save_post', 'prfx_meta_save' );
Related Posts:
- Save selected item from dropdown menu in a meta box as a metadata value for a custom post type
- Second select list values are not saved after clicking update
- Why is my custom meta box input not saving
- add_meta_boxes action with refresh on save
- Saving metabox repeatable fields
- How to select the contents in the text view textrea in wp_editor?
- Usage of call back function of add_meta_box()
- Custom meta box values are not getting saved for my custom post type
- How do I make this Metabox show current DB value?
- save_post action inside a custom metabox class not working
- Dropdown category field inside repeatable metabox
- custom field meta-box with dropdown/autocomplete
- When to use Exceptions vs Error Objects vs just plain false/null
- Uninstalling a plugin: delete all options with specific prefix
- WordPress URL Rewrite not working
- How to remove a metabox from menu editor page?
- Display a text message if the shortcode is not found?
- Action ‘save_post’ not working for quick edit
- simple wordpress ajax plugin not working when not logged in
- how to create and show sessions in word press?
- do not show web page section when using advanced custom fields pro
- How to get all existing post types
- New Plugin Review
- Create custom blocks for bootstrap
- Query String being Removed Creating a Pagination Issue within a Custom Plugin
- Register non hierarchical taxonomy and the show meta box in the post type
- wp_insert_post() is returning the correct post ID, no failure, but the post content does not get updated
- Customize Plugin
- WordPress Scheduled Event Request Blocking
- Loop with slider (slider not loading)
- How to set up VS Code for WP plugin/theme development in 2021? [closed]
- Saving an array of dynamic repeater data as post_meta
- WordPress wpform plugin submit and get multiple checked value from checkbox [closed]
- Remove metabox from WordPress menu editor page?
- Improve page speed loading using CDN and async or defer attribute
- Script to browser problem PHP
- Store a default value for a transient on plugin activation
- Options API get_option() and update_option() Not Correctly Updating or Returning
- wp query foreach deleting record returning only first or last item
- PHP > Scheduled Tasks > Sending daily email with dynamic API variables
- WordPress Custom field Colors
- “Undefined index” error when saving empty array with checkboxes
- Is it save to use eval for a jQuery callback method coming from the database?
- Isotope Drop Down Categories Filter Function
- Scheduling an event inside plugin class is not working
- How to Change CSS Colors from Custom Plugin Settings Page
- Passing the name of selected color from the custom component to `render_callback`
- Any ideas why I am getting “I’m getting “wp-admin/admin-ajax.php 401 (Unauthorized)”
- Cant register rest routs from class instance
- wordpress frontend editor to add extra css to website
- Sorting dynamic select/dropdown for Contact Form 7 of Modern Tribe Events posts
- Action Hook Inside WordPress Plugin Shortcode
- How to use wp_nav_menu to create custom dropdown menu?
- Class property seems to lose scope, attached to save_post action?
- save metabox with new values _wp_page_template
- Dynamically replicate custom metabox in custom post type
- PHP: How to access db the right way in plugin?
- select a single val though a table in wordpress
- WordPress – Get Posts with Category data
- How to use wp_send_json() and output the value with ajax?
- How to check post meta isset or not empty during publish/save post?
- Problem with inserting multiple images in gallery of each WooCommerce product programmatically
- Is it possible to access admin-ajax.php using PHP?
- Call to “admin_notices” hook from a static method
- How to Create custom block for displaying information in content section which act like shortcode
- How to detect and handle the time difference between server and user in WordPress?
- How to setup the Email piping in WordPress plugin?
- Reliable way to add nonce to HTTP Header in WordPress?
- Getting an error when my plugin is updated, but the files update correctly
- Creating a POP Alert
- ssl redirect function is not working
- WordPress Plugin Development – get_option error
- how to add new PHP page in WordPress plugin
- How can I get my WordPress plugin to receive data and relay it in an ajax/php request to a remote server that requires authentication?
- Automatic email message after manual user approval
- Constant expression contains invalid operations plugin class properties visibility
- Gutenberg blocks shortcodes compatibility
- Enqueue sripts and styles only if function is called
- Add widget area from visual editor
- Save custom field on WP_List_Table
- Load script and styles using an array of resources
- Register/enqueue scripts only on certain admin pages
- Looping through custom data in a custom table to display all items in a post
- Input field duplicates on form submit by jQuery
- Unable to pass variable to database
- Gravity Forms Marketo Plugin Feed [closed]
- Add custom filter to register data in array
- Display a post based on its metabox selection
- save_post not called in plugin / custom field still saving overwriting metaboxes
- WP multisite network plugin fails to see classes loaded with spl autoload
- AJAX & PHP | Call a specific PHP function from a PHP file via AJAX?
- What is this mark for “? function()” [closed]
- Cookie not created in AJAX request
- using a shortcode in a hyperlink
- How to get meta box labels?
- Woocommerce Convert existing order to the cart
- Redirect posts to post editor page based on query string
- Load style and script for custom post type metabox
- Permissions error when I use my plugin to delete comments in the front-end
- WordPress wp_set_object_terms does not assign product to custom taxonomy