WordPress.org

Make WordPress Core

Ticket #35357: 35357.patch

File 35357.patch, 752 bytes (added by mordauk, 5 years ago)
  • src/wp-includes/plugin.php

     
    422422}
    423423
    424424/**
     425 * Retrieve the number of times a filter has been applied.
     426 *
     427 * @since x.x
     428 *
     429 * @global array $wp_filter Stores all of the filters.
     430 *
     431 * @param string $tag The name of the filter hook.
     432 * @return int The number of times filter $tag has been applied.
     433 */
     434function did_filter( $tag = '' ) {
     435    global $wp_filter;
     436
     437    if ( ! isset( $wp_filter[ $tag ] ) ) {
     438        return 0;
     439    }
     440
     441    return $wp_filter[ $tag ];
     442}
     443
     444/**
    425445 * Retrieve the name of an action currently being processed.
    426446 *
    427447 * @since 3.9.0