WordPress.org

Make WordPress Core

Ticket #12400: wp-loaded.diff

File wp-loaded.diff, 946 bytes (added by Denis-de-Bernardy, 4 years ago)

wp_loaded hook after init

  • wp-settings.php

     
    733733 
    734734$wp->init();  // Sets up current user. 
    735735 
    736 // Everything is loaded and initialized. 
     736/** 
     737 * Most of WP is loaded at this stage, and the user is authenticated. WP continues 
     738 * to load on the init hook that follows (e.g. widgets), and many plugins instantiate 
     739 * themselves on it for all sorts of reasons (e.g. they need a user, a taxonomy, etc.). 
     740 * 
     741 * If you wish to plug an action once WP is loaded, use the wp_loaded hook below. 
     742 */ 
    737743do_action('init'); 
    738744 
    739 ?> 
     745/** 
     746 * The purpose of this hook is to fire actions once WP, all plugins, and the theme, 
     747 * are fully loaded and instantiated. 
     748 * 
     749 * AJAX requests should use wp-ajax.php and wp-admin/admin-ajax.php instead. 
     750 *  
     751 * @since 3.0 
     752 */ 
     753do_action('wp_loaded'); 
     754?> 
     755 No newline at end of file