mirror of https://github.com/vtrois/kratos
feat: add admin bar
parent
4a8dc6674b
commit
e5936e4a0c
|
@ -3,7 +3,7 @@
|
||||||
* 核心函数
|
* 核心函数
|
||||||
* @author Seaton Jiang <seaton@vtrois.com>
|
* @author Seaton Jiang <seaton@vtrois.com>
|
||||||
* @license MIT License
|
* @license MIT License
|
||||||
* @version 2020.07.29
|
* @version 2020.08.04
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (kratos_option('g_cdn', false)) {
|
if (kratos_option('g_cdn', false)) {
|
||||||
|
@ -46,6 +46,21 @@ function theme_autoload()
|
||||||
wp_enqueue_style('fontawesome', ASSET_PATH . '/assets/css/fontawesome.min.css', array(), '5.13.0');
|
wp_enqueue_style('fontawesome', ASSET_PATH . '/assets/css/fontawesome.min.css', array(), '5.13.0');
|
||||||
}
|
}
|
||||||
wp_enqueue_style('kratos', ASSET_PATH . '/assets/css/kratos.min.css', array(), THEME_VERSION);
|
wp_enqueue_style('kratos', ASSET_PATH . '/assets/css/kratos.min.css', array(), THEME_VERSION);
|
||||||
|
$admin_bar_css = "
|
||||||
|
@media screen and (max-width: 782px) {
|
||||||
|
.k-nav{
|
||||||
|
padding-top: 46px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media screen and (min-width: 782px) {
|
||||||
|
.k-nav{
|
||||||
|
padding-top: 32px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
";
|
||||||
|
if (current_user_can('level_10')) {
|
||||||
|
wp_add_inline_style('kratos', $admin_bar_css);
|
||||||
|
}
|
||||||
wp_enqueue_style('custom', get_template_directory_uri() . '/custom/custom.css', array(), THEME_VERSION);
|
wp_enqueue_style('custom', get_template_directory_uri() . '/custom/custom.css', array(), THEME_VERSION);
|
||||||
// js
|
// js
|
||||||
wp_deregister_script('jquery');
|
wp_deregister_script('jquery');
|
||||||
|
@ -71,7 +86,7 @@ function theme_autoload()
|
||||||
add_action('wp_enqueue_scripts', 'theme_autoload');
|
add_action('wp_enqueue_scripts', 'theme_autoload');
|
||||||
|
|
||||||
// 禁用 Admin Bar
|
// 禁用 Admin Bar
|
||||||
add_filter('show_admin_bar', '__return_false');
|
// add_filter('show_admin_bar', '__return_false');
|
||||||
|
|
||||||
// 移除自动保存、修订版本
|
// 移除自动保存、修订版本
|
||||||
remove_action('post_updated', 'wp_save_post_revision');
|
remove_action('post_updated', 'wp_save_post_revision');
|
||||||
|
|
Loading…
Reference in New Issue