You need to match the $priority
you used to hook the action:
remove_action( 'save_post', array( $this, 'save_box' ), 20 /* Same as add_action call */ );
http://codex.wordpress.org/Function_Reference/remove_action
Make sure you take the $post_id
argument in your save_box
method too:
function save_box( $post_id ) {
...
}
Related Posts:
- How to catch and modify custom field values when a page is updated
- remove_action(‘save_post’) in function that was triggered by save post not working
- set_post_format called after wp_update_post when using bulk edit?
- Why do some hooks not work inside class context?
- trigger save_post event programmatically
- __NAMESPACE__ with register_activation_hook
- Is it possible to save/modify a post without calling the “save_post” action hook?
- Hooks are not executing
- Create hooks based on an array of hook names?
- Returning ACF custom field from publish_post
- How to check what kind of saving it is?
- Firing a function AFTER redirect
- How to properly setup an activation hook
- Conditional for autosave or auto draft?
- admin_notices action doesn’t trigger within save_post action
- save_post hook to add terms getting deleted when using bulk edit
- ‘save_post’ hook not working in WP 3.5
- WordPress plugin activation, deactivation and uninstall hook not being triggered
- Is there a before_save_post hook or something similar
- Block Update Profile Errors
- Add action save post when create and publish
- Problem with call_user_func_array front end
- WordPress save_post hook not firing when checking if _GET[‘post’] is set
- Object oriented programming, add_action in constructor not firing
- Which hook should I use for this scenario regarding the registration process and account/profile update?
- How to use the password_reset hook to validate new password and display error
- How do I set a custom post type Category after import using wp_set_post_terms
- WooCommerce: change display order of product short description and price [closed]
- Is there a WordPress core & plugins update action hook?
- is it possible to get the hook name in add_action?
- What hook is executed just after wp_query has been executed?
- Use $query->set multiple times with pre_get_posts?
- How can I hook into the post editor title field in order to change the HTML?
- WordPress v5.0.3 Gutenberg & JS error “Uncaught SyntaxError: missing ) after argument list”
- Can’t get ID of post that relates to the comment
- Searching hook to set cookies before and avoid “headers already sent”
- Hook before inserting user into database [duplicate]
- wp_redirect() not working on form submission with init hook
- Add my own function to existing WooCommerce hook
- WooCommerce – Overwrite action hook [closed]
- Admin Hook at the Login Page
- Which Hook? Hide attachments from specific post types in media library
- Custom action on login and “remember me”
- add_action for unknown custom post types
- How to hook into Add New Member in BuddyPress
- Using wp_editor tinyMCE in metabox cause form alert on leaving page
- Hook when new CPT published AND postmeta inserted
- Need to check is_archive during init
- When WP_CLI runs WordPress from the command line, are hooks called?
- Executing Arbitrary Code at a Specific URL without Creating a Post or Page?
- Query categories that have a description
- Save User Meta Email Address in Lowercase
- How to change image atributes right before an image to be saved?
- Trying to run a compile command while saving post
- Action hook for custom tax edit
- wp cron job fires at every second or so, if callback is wrapped with DOING_CRON check it never fires at all
- I don’t understand how add_action and do_action work in tandem. The former executes the code already…what is do_action for?
- Remove an action by extending class and replacing it
- Insert HTML in post, below nav bar but above content?
- Convert Gravity Form Entry Date on Export
- Hook Adding content after title
- Fatal error: Call to a member function get_queried_object_id()
- “admin_enqueue_scripts” hook or $_GET[‘page’]?
- How to add content to suscriptor dashboard frontend?
- Custom Meta Box (SELECT2) Not Saving Taxonomy Terms
- Add PHP code to header section from plugin
- How to change a WordPress term’s slug before saving
- dynamic add_action according to child pages (for homepage control)
- Remove action in a parent theme from the child theme
- Remove action within a class in a parent theme’s includes folder from the child theme
- Action hook save_post for newly created posts – $post object data is all empty
- add_filter to the_content from plugin function
- How to add custom tab page in backend?
- Add html code in admin page
- What hook should I use that will fire whenever I open a post for editing in the WP back-end?
- Can not using get_header() cause trouble (later on)?
- Is there a author_update action?
- Catch and display error on save_post action
- How to set Media Box form elements default value?
- How to get product information using hooks?
- Print additional fields in wp_new_user_notification_email_admin
- remove_action not working for a function
- Is there no concise way, a library maybe, to help with unhooking class functions and so on?
- Debug a WP install: how to find which functions write post updates during a process (a woocommerce checkout in my case)
- What hook should I use to add post meta data with on update?
- How to I prevent WordPress from switching external HTTP links to HTTPS?
- Stylesheet is getting removed/deregistered automatically
- How to override get_avatar() function?
- Change user role if it’s orders count more than
- Using actions, hooks and filters in a non-WordPress page
- Hook into create_category
- Trouble adding data to options table
- How to hook into publish_posttype?
- How to add a new link to the default register form’s footer links?
- $GLOBALS & global doesn’t work [closed]
- Hooks not working on live server
- Suitable hook when creating, updating and deleting posts programmatically
- How can I get the ID before after_setup_theme?
- Hook on opening a media/document
- Hooks to trigger a callback when adding, removing, rearranging or updating a widget in the widget area