Make WordPress Core

Changeset 60258

Timestamp:
05/27/2025 03:51:39 PM (5 months ago)
Author:
jorbin
Message:

Plugins: Clarify documentation for when current_action and current_filter can return false.

If current_action or current_filter is called outside of an action/filter, then these functions will return false.

Props debarghyabanerjee, mukesh27, peterwilsoncc, SirLouen.
Fixes #63479.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/plugin.php

    r60179 r60258  
    360360 * @global string[] $wp_current_filter Stores the list of current filters with the current one last
    361361 *
    362  * @return string Hook name of the current filter.
     362 * @return string|false Hook name of the current filter, false if no filter is running.
    363363 */
    364364function current_filter() {
     
    633633 * @since 3.9.0
    634634 *
    635  * @return string Hook name of the current action.
     635 * @return string|false Hook name of the current action, false if no action is running.
    636636 */
    637637function current_action() {
Note: See TracChangeset for help on using the changeset viewer.