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

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

Description

This action hook runs immediately after the global WP class object is set up. The $wp object is passed to the hooked function as a reference (no return is necessary).

This hook is one effective place to perform any high-level filtering or validation, following queries, but before WordPress does any routing, processing, or handling.

Source File

The 'wp' hook is found in /wp-includes/class-wp.php, within the main() method of the WP() class.