Simplified closure arguments.
This commit is contained in:
1 parent
bf4ca812aa
commit
7412da0741
1 file changed
+4
-6
@@ -83,29 +83,27 @@ class Hook_Record_Collector extends Stopwatch_Record_Collector {
|
|||||||
$stop = $start;
|
$stop = $start;
|
||||||
}
|
}
|
||||||
|
|
||||||
$collector = $this;
|
|
||||||
|
|
||||||
if ( '' !== $start ) {
|
if ( '' !== $start ) {
|
||||||
add_action( $start, function ( $input = null ) use ( $collector, $event, $category ) {
|
add_action( $start, function ( $input = null ) use ( $event, $category ) {
|
||||||
|
|
||||||
if ( 'Sidebar' === $event ) {
|
if ( 'Sidebar' === $event ) {
|
||||||
$event = $input;
|
$event = $input;
|
||||||
}
|
}
|
||||||
|
|
||||||
$collector->start( $event, $category );
|
$this->start( $event, $category );
|
||||||
|
|
||||||
return $input;
|
return $input;
|
||||||
}, $start_priority );
|
}, $start_priority );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( '' !== $stop ) {
|
if ( '' !== $stop ) {
|
||||||
add_action( $stop, function ( $input = null ) use ( $collector, $event ) {
|
add_action( $stop, function ( $input = null ) use ( $event ) {
|
||||||
|
|
||||||
if ( 'Sidebar' === $event ) {
|
if ( 'Sidebar' === $event ) {
|
||||||
$event = $input;
|
$event = $input;
|
||||||
}
|
}
|
||||||
|
|
||||||
$collector->stop( $event );
|
$this->stop( $event );
|
||||||
|
|
||||||
return $input;
|
return $input;
|
||||||
}, $stop_priority );
|
}, $stop_priority );
|
||||||
|
|||||||
Reference in new issue
Block a user