feat: add admin notice

pull/620/head^2
Seaton Jiang 2024-01-17 10:46:21 +08:00
parent dcce9271c5
commit 71e49f4543
No known key found for this signature in database
GPG Key ID: 1E85ACC90F7EB73E
2 changed files with 17 additions and 0 deletions

View File

@ -124,6 +124,16 @@ function kratos_admin_enqueue()
add_action('admin_enqueue_scripts', 'kratos_admin_enqueue', 20);
// 后台提示
if (kratos_option('g_admin_notice', true)) {
function custom_admin_notice()
{
$message = __('感谢您使用 Kratos 主题进行创作,全新主题 Fraise 即将上线,欢迎加入 QQ 群讨论交流618958939', 'kratos');
echo '<div class="notice notice-info "><p>' . $message . '</p></div>';
}
add_action('admin_notices', 'custom_admin_notice');
}
// 前台管理员导航
if (!kratos_option('g_adminbar', true)) {
add_filter('show_admin_bar', '__return_false');

View File

@ -155,6 +155,13 @@ CSF::createSection($prefix, array(
'subtitle' => __('启用/禁用页面图片灯箱功能', 'kratos'),
'default' => true,
),
array(
'id' => 'g_admin_notice',
'type' => 'switcher',
'title' => __('后台管理员通知', 'kratos'),
'subtitle' => __('启用/禁用后台管理员通知', 'kratos'),
'default' => true,
),
array(
'id' => 'g_excerpt_length',
'type' => 'text',