Ready to get started?Download WordPress


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

Plugin API/Action Reference/init

Runs after WordPress has finished loading but before any headers are sent. Useful for intercepting $_GET or $_POST triggers.

For example, to act on $_POST data:
add_action('init', 'process_post');

function process_post(){
 if(isset($_POST['unique_hidden_field'])) {
   // process $_POST data here

Also load_plugin_textdomain calls should be made during init, otherwise users cannot hook into it.

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