Skip to content

Commit ecdeb3d

Browse files
committed
Use static closure and remove unnecessary variable
1 parent ce14af6 commit ecdeb3d

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tests/phpunit/tests/functions/wpGetArchives.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,13 @@ public function test_wp_get_archives_post_type() {
210210
*/
211211
public function test_wp_get_archives_args_filter() {
212212
// Test that the filter can modify the limit argument.
213-
$filter_callback = function ( $args ) {
214-
$args['limit'] = 3;
215-
return $args;
216-
};
217-
add_filter( 'wp_get_archives_args', $filter_callback );
213+
add_filter(
214+
'wp_get_archives_args',
215+
static function ( $args ) {
216+
$args['limit'] = 3;
217+
return $args;
218+
}
219+
);
218220

219221
$ids = array_slice( array_reverse( self::$post_ids ), 0, 3 );
220222

0 commit comments

Comments
 (0)