Unit tests for has_filter() not resetting the array pointer.

props pento.
fixes #29070. see [29472].


git-svn-id: https://develop.svn.wordpress.org/trunk@29665 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2014-09-02 06:49:11 +00:00
parent 1cde8312b6
commit d8b80c3254
2 changed files with 22 additions and 0 deletions

View File

@@ -105,6 +105,7 @@ function add_filter( $tag, $function_to_add, $priority = 10, $accepted_args = 1
* return value.
*/
function has_filter($tag, $function_to_check = false) {
// Don't reset the internal array pointer
$wp_filter = $GLOBALS['wp_filter'];
$has = ! empty( $wp_filter[ $tag ] );