do_action( 'shutdown' )

Fires just before PHP shuts down execution.


Source Source

File: wp-includes/load.php

View on Trac



Top ↑

Changelog Changelog

Changelog
Version Description
1.2.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note 1 content
    Contributed by Philipp Stracker

    The shutdown action is always called, even on fatal errors, Ajax requests, and when using exit; or die(); 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.

You must log in before being able to contribute a note or feedback.