refactor: remove unused widgets
This commit is contained in:
1 parent
895b7b2014
commit
30b08282f5
10 files changed
-1979
No files matched your search
@@ -33,7 +33,6 @@ class WidgetAjax {
|
||||
'/widgets/hot-posts' => 'rest_hot_posts',
|
||||
'/widgets/oneline-posts' => 'rest_oneline_posts',
|
||||
'/widgets/recent-comments' => 'rest_recent_comments',
|
||||
'/widgets/user-lists' => 'rest_user_lists',
|
||||
'/widgets/tag-cloud' => 'rest_tag_cloud',
|
||||
'/widgets/categories' => 'rest_categories',
|
||||
'/widgets/term-cards' => 'rest_term_cards',
|
||||
@@ -223,23 +222,6 @@ class WidgetAjax {
|
||||
return new \WP_REST_Response(['success' => true, 'html' => $html], 200);
|
||||
}
|
||||
|
||||
public function rest_user_lists(\WP_REST_Request $request) {
|
||||
if (!class_exists('\AKSRT\Widgets\WidgetUserLists')) {
|
||||
return $this->fail();
|
||||
}
|
||||
$instance = [
|
||||
'number' => max(1, min(50, (int) ($request->get_param('number') ?? 8))),
|
||||
'orderby' => sanitize_key((string) ($request->get_param('orderby') ?? 'user_registered')),
|
||||
'order' => sanitize_key((string) ($request->get_param('order') ?? 'DESC')),
|
||||
'include' => sanitize_text_field((string) ($request->get_param('include') ?? '')),
|
||||
'exclude' => sanitize_text_field((string) ($request->get_param('exclude') ?? '')),
|
||||
'hide_box' => (int) ($request->get_param('hide_box') ?? 0),
|
||||
'blur_bg' => (int) ($request->get_param('blur_bg') ?? 0),
|
||||
];
|
||||
$html = \AKSRT\Widgets\WidgetUserLists::render_html($instance);
|
||||
return new \WP_REST_Response(['success' => true, 'html' => $html], 200);
|
||||
}
|
||||
|
||||
public function rest_category_block(\WP_REST_Request $request) {
|
||||
if (!class_exists('\AKSRT\Widgets\CategoryBlockWidget')) {
|
||||
return $this->fail();
|
||||
|
||||
Reference in new issue
Block a user