WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Action Reference/wp loaded

This page is marked as incomplete. You can help Codex by expanding it.

Description

After WordPress is fully loaded.

Example

// Minify HTML codes when page is output.
add_action('wp_loaded','my_minify_html');
function my_minify_html(){
	/** 
	 * use html_compress($html) function to minify html codes.
	 */
	ob_start('html_compress');
}

function html_compress($html){
	/** 
	 * some minify codes here ...
	 */
	return $html;
}

Usage

add_action('wp_loaded','your callback function');



This hook is fired once WP, all plugins, and the theme are fully loaded and instantiated.

AJAX requests should use wp-admin/admin-ajax.php. admin-ajax.php can handle requests for users not logged in.