do_action( 'shutdown' )
Fires just before PHP shuts down execution.
More Information
Runs just before PHP shuts down execution.
This hook is called by shutdown_action_hook() and registered with PHP as a shutdown function by register_shutdown_function() in wp-settings.php
.
Source
File: wp-includes/load.php
.
View all references
do_action( 'shutdown' );
Changelog
Version | Description |
---|---|
1.2.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.
The
shutdown
action is always called, even on fatal errors, Ajax requests, and when usingexit;
ordie();
to terminate a running request.That makes this function perfect for a “catch-all” logic, like writing a log file.
Note: If you call
exit;
inside your shutdown action-handler, the request will be instantly halted without calling other shutdown action-handlers.