Styling fix
This commit is contained in:
parent
c3ad996eb2
commit
9aaf994638
|
@ -67,7 +67,8 @@ class WCA_Test_Helper_Rest_Api_Filters {
|
|||
$replacement = true;
|
||||
}
|
||||
|
||||
self::update( function( $filters ) use (
|
||||
self::update(
|
||||
function ( $filters ) use (
|
||||
$endpoint,
|
||||
$dot_notation,
|
||||
$replacement
|
||||
|
@ -79,7 +80,8 @@ class WCA_Test_Helper_Rest_Api_Filters {
|
|||
'enabled' => true,
|
||||
);
|
||||
return $filters;
|
||||
});
|
||||
}
|
||||
);
|
||||
return new WP_REST_RESPONSE(null, 204);
|
||||
}
|
||||
|
||||
|
@ -90,20 +92,24 @@ class WCA_Test_Helper_Rest_Api_Filters {
|
|||
}
|
||||
|
||||
public static function delete( $request ) {
|
||||
self::update(function($filters) use ($request) {
|
||||
self::update(
|
||||
function ( $filters ) use ( $request ) {
|
||||
array_splice($filters, $request->get_param('index'), 1);
|
||||
return $filters;
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
return new WP_REST_RESPONSE(null, 204);
|
||||
}
|
||||
|
||||
public static function toggle( $request ) {
|
||||
self::update(function($filters) use ($request) {
|
||||
self::update(
|
||||
function ( $filters ) use ( $request ) {
|
||||
$index = $request->get_param('index');
|
||||
$filters[$index]['enabled'] = !$filters[$index]['enabled'];
|
||||
return $filters;
|
||||
});
|
||||
}
|
||||
);
|
||||
return new WP_REST_RESPONSE(null, 204);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue