IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
105 | 105 | */ |
106 | 106 | function has_filter($tag, $function_to_check = false) { |
107 | 107 | // Don't reset the internal array pointer |
108 | | $wp_filter = $GLOBALS['wp_filter']; |
| 108 | $wp_filter = $GLOBALS['wp_filter']; |
109 | 109 | |
110 | | $has = ! empty( $wp_filter[ $tag ] ); |
| 110 | if( false === $function_to_check ) { |
| 111 | if( empty( $wp_filter[ $tag ] ) ) return false; |
111 | 112 | |
112 | | // Make sure at least one priority has a filter callback |
113 | | if ( $has ) { |
114 | | $exists = false; |
115 | | foreach ( $wp_filter[ $tag ] as $callbacks ) { |
116 | | if ( ! empty( $callbacks ) ) { |
117 | | $exists = true; |
118 | | break; |
119 | | } |
120 | | } |
| 113 | // Make sure at least one priority has a filter callback |
| 114 | foreach ( $wp_filter[ $tag ] as $priority => $callbacks ) { |
| 115 | if ( ! empty ( $callbacks ) ) { |
| 116 | /* Bug in case $priority equal zero */ |
| 117 | return $priority !== 0 ? $priority : true; |
| 118 | } |
| 119 | } |
121 | 120 | |
122 | | if ( ! $exists ) { |
123 | | $has = false; |
124 | | } |
125 | | } |
| 121 | return false; |
| 122 | } |
126 | 123 | |
127 | | if ( false === $function_to_check || false == $has ) |
128 | | return $has; |
129 | | |
130 | | if ( !$idx = _wp_filter_build_unique_id($tag, $function_to_check, false) ) |
131 | | return false; |
| 124 | if ( ! $idx = _wp_filter_build_unique_id( $tag, $function_to_check, false ) ) |
| 125 | return false; |
132 | 126 | |
133 | | foreach ( (array) array_keys($wp_filter[$tag]) as $priority ) { |
134 | | if ( isset($wp_filter[$tag][$priority][$idx]) ) |
135 | | return $priority; |
136 | | } |
| 127 | foreach ( (array) array_keys( $wp_filter[$tag]) as $priority ) { |
| 128 | if ( isset( $wp_filter[$tag][$priority][$idx] ) ) |
| 129 | return $priority !== 0 ? $priority : true; |
| 130 | } |
137 | 131 | |
138 | | return false; |
| 132 | return false; |
139 | 133 | } |
140 | 134 | |
141 | 135 | /** |