feat(nav): close P0/P1 parity gaps (nav style, history, plate, admin build)
Wire header_nav_style transparent/blur, login history sync, plate publish type, clean dead search CSS, rebuild admin SPA locally (build gitignored).
This commit is contained in:
1 parent
1d1fef50af
commit
0d9db942f8
13 files changed
+181
-85
No files matched your search
@@ -26,6 +26,7 @@ if (!function_exists('aksrt_get_header_newposts_config')) :
|
||||
$shop = \AKSRT\Settings\Settings::get_shop_settings();
|
||||
if (!empty($forum['enabled'])) {
|
||||
$types[] = 'topic';
|
||||
$types[] = 'plate';
|
||||
}
|
||||
if (!empty($shop['enabled'])) {
|
||||
$types[] = 'product';
|
||||
@@ -87,6 +88,28 @@ if (!function_exists('aksrt_get_new_add_actions')) :
|
||||
'label' => __('发布商品', 'aksrt'),
|
||||
'icon' => 'fas fa-shopping-bag',
|
||||
];
|
||||
} elseif ($type === 'plate') {
|
||||
// zibll bbs_plate → AKSRT forum plate CPT (admin create for entitled users).
|
||||
$can = current_user_can('manage_options');
|
||||
if (!$can && class_exists('\AKSRT\Forum\Forum')) {
|
||||
try {
|
||||
$forum = \AKSRT\Forum\Forum::get_instance();
|
||||
if (method_exists($forum, 'forum_user_can')) {
|
||||
$can = (bool) $forum->forum_user_can(get_current_user_id(), 'plate_create');
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
$can = false;
|
||||
}
|
||||
}
|
||||
if (!$can || !post_type_exists('aksrt_forum_plate')) {
|
||||
continue;
|
||||
}
|
||||
$out[] = [
|
||||
'type' => 'plate',
|
||||
'url' => admin_url('post-new.php?post_type=aksrt_forum_plate'),
|
||||
'label' => __('创建版块', 'aksrt'),
|
||||
'icon' => 'fas fa-th-large',
|
||||
];
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
|
||||
Reference in new issue
Block a user