From 8abed76f893215202941a7514eec8d6ace11d6f5 Mon Sep 17 00:00:00 2001 From: Seaton Jiang Date: Mon, 2 May 2022 00:26:24 +0800 Subject: [PATCH] fix: centbrowser gutenberg (#492) --- assets/css/admin.css | 11 +++++++++++ inc/theme-article.php | 9 +++++---- inc/theme-core.php | 14 +++++++++++--- 3 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 assets/css/admin.css diff --git a/assets/css/admin.css b/assets/css/admin.css new file mode 100644 index 0000000..04e2853 --- /dev/null +++ b/assets/css/admin.css @@ -0,0 +1,11 @@ +.editor-styles-wrapper .wp-site-blocks, +.editor-styles-wrapper>.is-root-container, +.editor-styles-wrapper .edit-post-visual-editor__post-title-wrapper, +.editor-styles-wrapper .wp-block-group.alignfull, +.editor-styles-wrapper .wp-block-group.has-background, +.editor-styles-wrapper .wp-block-cover.alignfull, +.editor-styles-wrapper .is-root-container .wp-block[data-align="full"]>.wp-block-group, +.editor-styles-wrapper .is-root-container .wp-block[data-align="full"]>.wp-block-cover { + padding-left: max(1.25rem, 5vw); + padding-right: max(1.25rem, 5vw); +} \ No newline at end of file diff --git a/inc/theme-article.php b/inc/theme-article.php index 4dfd916..8b094e9 100644 --- a/inc/theme-article.php +++ b/inc/theme-article.php @@ -4,7 +4,7 @@ * 文章相关函数 * @author Seaton Jiang * @license GPL-3.0 License - * @version 2022.02.20 + * @version 2022.05.01 */ // 文章链接添加 target 和 rel @@ -455,9 +455,10 @@ function post_seo_callback($post) } if (kratos_option('g_image_filter', true)) { - add_action( 'admin_footer-post-new.php', 'fanly_mediapanel_lock_uploaded' ); - add_action( 'admin_footer-post.php', 'fanly_mediapanel_lock_uploaded' ); - function fanly_mediapanel_lock_uploaded() { + add_action('admin_footer-post-new.php', 'fanly_mediapanel_lock_uploaded'); + add_action('admin_footer-post.php', 'fanly_mediapanel_lock_uploaded'); + function fanly_mediapanel_lock_uploaded() + { echo ''; } } diff --git a/inc/theme-core.php b/inc/theme-core.php index 3f56751..2171241 100644 --- a/inc/theme-core.php +++ b/inc/theme-core.php @@ -4,7 +4,7 @@ * 核心函数 * @author Seaton Jiang * @license GPL-3.0 License - * @version 2022.04.30 + * @version 2022.05.01 */ // CDN 资源地址 @@ -76,10 +76,10 @@ function theme_autoload() wp_add_inline_style('kratos', " @media screen and (min-width: 992px) { .k-nav .navbar-brand h1 { - color: ". kratos_option('g_nav', '#ffffff') ."; + color: " . kratos_option('g_nav', '#ffffff') . "; } .k-nav .navbar-nav > li.nav-item > a { - color: ". kratos_option('g_nav', '#ffffff') ."; + color: " . kratos_option('g_nav', '#ffffff') . "; } } "); @@ -114,6 +114,14 @@ function theme_autoload() } add_action('wp_enqueue_scripts', 'theme_autoload'); +// 后台资源加载 +function kratos_admin_enqueue() +{ + wp_enqueue_style('admin-custom-css', get_template_directory_uri() . '/assets/css/admin.css', array(), filemtime(get_stylesheet_directory() . '/assets/css/admin.css')); +} + +add_action('admin_enqueue_scripts', 'kratos_admin_enqueue', 20); + // 前台管理员导航 if (!kratos_option('g_adminbar', true)) { add_filter('show_admin_bar', '__return_false');