feat(admin): rebuild page display settings
This commit is contained in:
1 parent
09b1e8fd35
commit
480e2bf07e
117 files changed
+1815
-9081
No files matched your search
@@ -101,14 +101,14 @@ class ThemeSearch {
|
||||
}
|
||||
|
||||
public static function search_custom_key(): array {
|
||||
$raw = Settings::get_value('search_custom_key', ['title', 'content', 'excerpt', 'post_tag', 'forum_topic', 'shop_cat', 'shop_discount']);
|
||||
$raw = Settings::get_value('search_custom_key', ['title', 'content', 'excerpt', 'category', 'post_tag']);
|
||||
if (is_array($raw)) {
|
||||
$items = $raw;
|
||||
} else {
|
||||
$items = preg_split('/[,,\s]+/', (string) $raw) ?: [];
|
||||
}
|
||||
$items = array_map(static fn($k) => trim(sanitize_key((string) $k)), $items);
|
||||
$valid = ['title', 'content', 'excerpt', 'category', 'post_tag', 'topics', 'coment', 'user', 'forum_topic', 'forum_tag', 'shop_cat', 'shop_tag', 'shop_discount'];
|
||||
$valid = ['title', 'content', 'excerpt', 'category', 'post_tag', 'coment', 'user'];
|
||||
return array_values(array_intersect(array_filter(array_unique($items)), $valid));
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ class ThemeSearch {
|
||||
$terms = [(string) $query->get('s')];
|
||||
}
|
||||
$groups = [];
|
||||
$taxonomies = ['post_tag', 'category', 'topics', 'forum_tag', 'forum_topic', 'shop_tag', 'shop_cat', 'shop_discount'];
|
||||
$taxonomies = ['post_tag', 'category'];
|
||||
foreach ($terms as $term) {
|
||||
$like = (!empty($query->query_vars['exact']) ? '' : '%') . $wpdb->esc_like((string) $term) . (!empty($query->query_vars['exact']) ? '' : '%');
|
||||
$parts = [];
|
||||
@@ -212,7 +212,7 @@ class ThemeSearch {
|
||||
if (in_array('user', $keys, true)) {
|
||||
$join .= " LEFT JOIN {$wpdb->users} AS aksrt_search_users ON ({$wpdb->posts}.post_author = aksrt_search_users.ID)";
|
||||
}
|
||||
if (array_intersect(['post_tag', 'category', 'topics', 'forum_tag', 'forum_topic', 'shop_tag', 'shop_cat', 'shop_discount'], $keys)) {
|
||||
if (array_intersect(['post_tag', 'category'], $keys)) {
|
||||
$join .= " LEFT JOIN {$wpdb->term_relationships} AS aksrt_search_tr ON ({$wpdb->posts}.ID = aksrt_search_tr.object_id)";
|
||||
$join .= " LEFT JOIN {$wpdb->term_taxonomy} AS aksrt_search_tt ON (aksrt_search_tr.term_taxonomy_id = aksrt_search_tt.term_taxonomy_id)";
|
||||
$join .= " LEFT JOIN {$wpdb->terms} AS aksrt_search_terms ON (aksrt_search_tt.term_id = aksrt_search_terms.term_id)";
|
||||
|
||||
Reference in new issue
Block a user