Restored functionality on WP 4.7 beta with new current_priority() method.

This commit is contained in:
Andrey Savchenko committed 2016-12-02 19:18:41 +02:00
1 parent 67ad1370ef
commit 68302633c0
1 file changed
+4 -7
+4 -7
View File
@@ -91,15 +91,12 @@ class Laps {
global $wp_filter; global $wp_filter;
$filter = current_filter(); $filter_name = current_filter();
$priority = key( $wp_filter[ $filter ] ); $filter_instance = $wp_filter[ $filter_name ];
$priority = $filter_instance instanceof \WP_Hook ? $filter_instance->current_priority() : key( $filter_instance );
if ( 'callbacks' === $priority ) { // Fails on WP 4.7, see https://core.trac.wordpress.org/ticket/39007
return $input;
}
$event = wp_parse_args( $event = wp_parse_args(
self::$events[ $filter ][ $priority ], self::$events[ $filter_name ][ $priority ],
array( array(
'action' => 'start', 'action' => 'start',
'category' => null, 'category' => null,