Hooks WordPress

Orden de ejecución de los hooks:

  1. mu_plugin_loaded
  2. network_plugin_loaded
  3. muplugins_loaded
  4. registered_taxonomy
  5. registered_post_type
  6. plugin_loaded
  7. plugins_loaded
  8. sanitize_comment_cookies
  9. setup_theme
  10. load_textdomain
  11. after_setup_theme // The earliest for a theme; user is not authorised, pugins are not initialized
  12. auth_cookie_malformed
  13. auth_cookie_valid
  14. set_current_user // Triggered by kses, user is set
  15. init // The most common and popular hook for plugins. Here you can get and process request vars if needed. All globals are set, as well as user & taxonomies, but no headers sent still to client
  16. widgets_init
  17. register_sidebar
  18. wp_register_sidebar_widget
  19. wp_default_scripts // Provides access to WP_Scripts object
  20. wp_default_styles
  21. admin_bar_init
  22. add_admin_bar_menus
  23. wp_loaded // Almost the same state as init, check docs for differences
  24. parse_request
  25. send_headers // That’s just where output starts technically
  26. parse_query // Main query object is ready, you can check its parmeters
  27. pre_get_posts
  28. posts_clauses
  29. posts_selection
  30. wp // The most suitable place to edit main query before it executes
  31. template_redirect // The most suitable place to redirect. No content displayed still
  32. get_header // before displaying header.php
  33. wp_head // insecure third-party output starts just here
  34. wp_enqueue_scripts
  35. wp_print_styles
  36. wp_print_scripts
👉  Visual Studio Code

👇Tu comentario