Μετά από μία εγκατάσταση ή μεταφορά μίας σελίδας, μόλις κάνουμε Login στο wordpress, εμφανίζει συνεχόμενα…
WordPress hooks
Μία λίστα με τη σειρά εκτέλεσης των hooks στο front end του wordpress. Μπορεί να σας βοηθήσει στην προσπάθεια σας να καλέσετε κάποια hooks διαδοχικά. Προσωπικά μου ήταν πολύ χρήσιμο όταν προσπάθησα να βάλω ένα cookie για την linkwise και σε δεύτερη φάση να τσεκάρω αν υπάρχει το cookie και να ορίσω κάποια divs που ήθελα να κρύψω με CSS.
Να μην ξεχνάμε ότι πάντα παίζει ρόλο και το priority που θα ορίσουμε στο hook.
- mu_plugin_loaded
- network_plugin_loaded
- muplugins_loaded
- registered_taxonomy
- registered_post_type
- plugin_loaded
- plugins_loaded
- sanitize_comment_cookies
- setup_theme
- load_textdomain
- after_setup_theme // The earliest for a theme; user is not authorised, pugins are not initialized
- auth_cookie_malformed
- auth_cookie_valid
- set_current_user // Triggered by kses, user is set
- 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
- widgets_init
- register_sidebar
- wp_register_sidebar_widget
- wp_default_scripts // Provides access to WP_Scripts object
- wp_default_styles
- admin_bar_init
- add_admin_bar_menus
- wp_loaded // Almost the same state as init, check docs for differences
- parse_request
- send_headers // That’s just where output starts technically
- parse_query // Main query object is ready, you can check its parmeters
- pre_get_posts
- posts_clauses
- posts_selection
- wp // The most suitable place to edit main query before it executes
- template_redirect // The most suitable place to redirect. No content displayed still
- get_header // before displaying header.php
- wp_head // insecure third-party output starts just here
- wp_enqueue_scripts
- wp_print_styles
- wp_print_scripts