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