wp WordPress Action Hook

The wp hook is one of the most versatile hooks in WordPress. It can be used to modify how WordPress behaves or to add new functionality to your site. In this article, we will explore some of the different ways you can use the wp hook to improve your WordPress site.

do_action_ref_array( 'wp', WP $wp ) #

Fires once the WordPress environment has been set up.


Parameters

$wp

(WP)Current WordPress environment instance (passed by reference).


Top ↑

More Information

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. It is run in the main() WP method in which the $query_args are passed to parse_request(), as well as when send_headers() , query_posts()handle_404(), and register_globals() are setup.


Top ↑

Source

File: wp-includes/class-wp.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by the Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.