It is usually easy to find most hooks in documentation or source. It can be much more tricky for hooks that are dynamically generated, like post transitions. Essentially it doesn’t exist in source as specific hook – it is hook that is getting generated dynamically at runtime, depending on variables.
do_action("${old_status}_to_$new_status", $post);
do_action("${new_status}_$post->post_type", $post->ID, $post);
At local test stack I often just add var_dump()
on variables to source code to see what is going on. Dirty, but easy and fast. Obviously highly not recommended for production environment.
Related Posts:
- When can you get current page ID and initialize hooks right after?
- Using the ‘draft_to_publish’ hook (post status transition)
- Enqueue style inside shortcode but its loaded at the bottom of page (before footer scripts)
- Is it possible to add an action to the currently running action?
- How to prevent action in ajax request, when in admin side?
- template_redirect not being called when using ajax
- What are the benefit in adding hook in the init() hook?
- add_action in functions.php, do_action in plugin?
- add action for displaying posts using a shortcode
- ‘wp_login’ action hook not working with wp-login.php file
- Any hook for pre-plugin-update -either bulk or single plugin update
- How to get all of the activate_plugin action parameters?
- Get Time Taken By Each Action Hook in WordPress
- Are functions in main plugin file called before function bound to register_activation_hook runs?
- Hook for page Request?
- The function called on the wp head hook becomes null
- Passing function into add_action always returns the first argument
- Plugin Hook: Get posts
- How wordpress plugin hooks works? [duplicate]
- Passing a parameter to filter and action functions
- Get a list of all registered actions
- How can I edit post data before it is saved?
- How to only hook on Single.php after content?
- How to save the values of checkbox to the register setting?
- Edit plugin without hooks in functions.php
- How can I log a user out of WordPress before the page loads?
- What is the ‘admin_action_’ . $_REQUEST[‘action’] hook used for?
- How can I limit functionality in one version of a plugin?
- Shortcode display outside the div
- Pass A Value From Outside To A Plugin Variable
- Built in admin ajax hooks?
- Adding dynamic section to WordPress
- do_action and hook methods
- Fatal error: Class not found in
- How to filter content post only on save
- Filter or action hook to insert content on admin pages before tag
- Showing Notifications While Activating Plugin
- Action on post publish
- OOP: Display warning and deactivate the plugin if PHP version is less than 5.4
- How to add inline css/js inside a shortcode
- merging an array to an existing array using add_filter
- add action wp_head not working
- Can I use a method from an existing plugin as an action hook?
- Plugin custom Action Hook not working
- How to correctly detect accessing wp-content/uploads?
- Where to hook my plugin’s action
- How to pull code snippet from functionality plugin?
- How do action and filter hooks understand where to look for the core function that we hooked our function to them
- wordpress plugin is not activating from widget
- When to load auto-login code?
- Using a post-signup hook to get user details
- Calling plugin function inside custom plugin for onclick event
- Custom plugin init action causing general slowness
- do_action() hook into load-(page)
- Howto check version of another plugin and then add a submenu page to it
- Inject HTML meta tag inside wordpress tag using add_shortcode
- Submit Form data to another page via Ajax (WordPress Way)
- Why do plugins often ask to add in to templates?
- Does using `add_action( ‘init’…` cause performance issues?
- remove_action not removing add_action from constructor
- How to get menu location in wp_update_nav_menu hook
- Are there action hooks for comments?
- WooCommerce: after install hook
- Save user total active time after login in wordpress [closed]
- Advanced WordPress plugin activation detection
- wp_loaded with static Singleton
- is it possible to hook every page style?
- Add action to custom Function
- How to use add_action for multiple instances of the same class
- How to hook into action/filter call
- using wp_footer hook in a plugin
- How to append new form elements in “Add New” form of Users in WordPress admin panel?
- How to automatically activate users after registration without activation email?
- Hook from plugin doesn’t fire up from external PHP script
- Add hook after content without formatting
- admin_post hook not firing function inside class
- update_option_{$option} not working (do function after options are saved)
- Why do actions with class and public method don’t fire __construct()
- Hooking into the HTML header container
- When/where would want to attach other classes to the base class in a WordPress plugin?
- Use action, filter, or hook to append HTML to WordPress plugin function
- Hook to display element as product on category page
- Remove action added in plugin class from theme
- {status}_{post_type} does not run correctly?
- WordPress Boilerplate Plugin doesn’t see callback functions for add_settings_field and add_settings_section
- plugin not hooking to my custom hook
- Why can’t I shove an instance of a class into a variable from a do_action hook?
- Passing a parameter to filter and action functions
- Run only on plug-in activation instead of wp_head
- Plugin hook breaks new WP 4.0 media library grid view?
- Display_rows() and column_cb() strange behaviour
- Is it possible to cancel a post status transition?
- OOP Plugin: Where should I place the action hooks in the class?
- add query string to all pages after user logged in
- Post curl function save twice using plugin hook function wordpress
- WordPress Hooks : Where to place callbacks that repetitively yield the same effect?
- Hook automatic_updates_complete to autoupdate plugin
- Suitable hook when creating, updating and deleting posts programmatically
- Why is my activator class adding the files/running the actions I add?
- is_user_logged_in() undefined at shutdown in plugin context