ete(); } } } catch ( \Throwable $th ) { $return = false; } return new \WP_REST_Response( [ 'success' => $return ], 200 ); } /** * Delete Log. * * @since 4.5.8 * * @param \WP_REST_Request $request The REST Request. * @return \WP_REST_Response The response. */ public static function deleteLog( $request ) { $body = $request->get_json_params(); $return = true; try { foreach ( $body as $block ) { $log = new Models\CrawlCleanupLog( $block ); if ( $log->exists() ) { $log->delete(); } } } catch ( \Throwable $th ) { $return = false; } return new \WP_REST_Response( [ 'success' => $return ], 200 ); } }