The locale
hook happens long before init
. To see when which hook, variable, constant, function, class or file is available install my plugin T5 WP Load Order.
You get a looong file with a very detailed log. Search for Hook: locale
, then for Hook: init
. You will see that you need plugins_loaded
as parent action if you want to chain hooks.
Is it a good practice? It depends. If you need the second callback only when the first was running successful, then yes. If both callbacks should run independently of each other, then no.
Chaining should reflect the logic of your program.
Related Posts:
- How can I edit post data before it is saved?
- Edit plugin without hooks in functions.php
- How to list the Hooks and order of execution in current loading page? [duplicate]
- Pass A Value From Outside To A Plugin Variable
- How can I filter blog name?
- Determine plugin name from within plugin_action_links filter
- merging an array to an existing array using add_filter
- Get Time Taken By Each Action Hook in WordPress
- Redirect to another page using contact form 7? [closed]
- Add hook after content without formatting
- Customize plugin templates
- Display_rows() and column_cb() strange behaviour
- How wordpress plugin hooks works? [duplicate]
- How to Add Extra Text In WordPress Title Before Post Publish
- How to only hook on Single.php after content?
- How to save the values of checkbox to the register setting?
- Using add_filter inside another class
- Enqueue style inside shortcode but its loaded at the bottom of page (before footer scripts)
- Which functions in theme or plugin load first
- WordPress Plugin as ‘Library’ From Abstract Application?
- Add CSS animation as Preloader to WordPress
- Good tools for locating hooks in a wordpress page/admin interface/blog post?
- Hide WordPress Plugin Deactivation Links
- Built in admin ajax hooks?
- Does the ‘nav_menu_css_class’ filter accept 2 or 3 arguments?
- do_action and hook methods
- Is it possible to add an action to the currently running action?
- Created Widget Not Showing up on Admin Panel
- How to filter content post only on save
- Filter or action hook to insert content on admin pages before tag
- OOP: Display warning and deactivate the plugin if PHP version is less than 5.4
- How to prevent action in ajax request, when in admin side?
- How to add rewrite rules and pagination to retrieve attachments files?
- What are the benefit in adding hook in the init() hook?
- Reposition Woocommerce Message
- Custom plugins/Manipulated plugins: Always a terrible idea to inherit these types of WP sites that discourage updates? [closed]
- How to modify shortcode attributes with data from current post
- 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
- JS Support Ticket – Auto create WP account
- Any hook for pre-plugin-update -either bulk or single plugin update
- Input with spaces in Shortcode attributes overwritten by defaults
- How to find the origin of a file upload from within wp_handle_upload?
- How to get all of the activate_plugin action parameters?
- Modifying the comments section through a plugin regardless of theme
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- Passing an array from shortcode-function to filter-function
- custom payment gateway in woocommerce failed to connect to remote api server
- Best place for short bio,image and button [closed]
- do_action() hook into load-(page)
- Howto check version of another plugin and then add a submenu page to it
- add_filter doesn’t work
- Check if variable is set in filter
- How can I run a custom shortcode function on a live site and only run if the viewer is a specific machine?
- remove_action not removing add_action from constructor
- Plugin function inside custom plugin
- Save user total active time after login in wordpress [closed]
- Advanced WordPress plugin activation detection
- How to create a plugin that includes all the other plugins?
- wp_loaded with static Singleton
- Why is it important to check for isset and is_array before checking in_array in this example?
- is it possible to hook every page style?
- Calling a save function from a “submit” button
- Add a function call after content automatically?
- what is the point of telling add_filter how many parameters you want passed to the function?
- How to add filter for wordpress plugin?
- How to use add_action for multiple instances of the same class
- How to hook into action/filter call
- Integrating Custom Database with WordPress
- Custom Module, Extending WP with a Plugin?
- How to automatically activate users after registration without activation email?
- Custom Post Type, Custom Columns List
- Edit post image attributes on fly?
- Check if theme supports sidebar
- admin_post hook not firing function inside class
- Unpublished Pages Failing To Appear On Custom Path
- Ultimate Members Default Post Layout problem
- Plugin function in child theme
- Create survey that redirects to sidebar menu customized to answers
- Load my Inline js footer area
- Remove action added in plugin class from theme
- Woocommerce list variations that are added already to cart in Single Product
- Using multi-dimensional array with filter
- Echo custom admin field into a is_single()
- WordPress Boilerplate Plugin doesn’t see callback functions for add_settings_field and add_settings_section
- 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
- Custom pages with plugin
- How can I pass value to function in add_menu_page?
- show Visual form builder in the front end
- add query string to all pages after user logged in
- Post curl function save twice using plugin hook function wordpress
- How to generate a responsive output from plugin?
- WordPress Code Access to Restricted Content without Registration
- What can I do to customize a widget provided with this plugin? from where have I to start?
- WordPress Customise
- Order shipped by which driver[hook for woocoomerce order staus changed and popup in admin panel ] [closed]
- Unable to pass arguments from plugin form to filter hook using ajax, the data is transferring via ajax but unable to pass as arguments in filter hooks
- How to make a Template page to show the information of different things Shop and Product page?
- Why is my activator class adding the files/running the actions I add?