Created
April 5, 2018 22:15
-
-
Save kaoru-fukusato/42383f2d528ae3ebf6b83daa7ba3e493 to your computer and use it in GitHub Desktop.
管理画面カスタマイズまとめ-wp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function custom_login_logo() { ?> | |
<style> | |
.login #login h1 a { | |
width: 128px; | |
height:128px; | |
background: url(<?php echo get_stylesheet_directory_uri(); ?>/images/logo01.png) no-repeat 0 0; | |
} | |
</style> | |
<?php } | |
add_action( 'login_enqueue_scripts', 'custom_login_logo' ); | |
function custom_login_logo_url() { | |
return get_bloginfo( 'url' ); | |
} | |
add_filter( 'login_headerurl', 'custom_login_logo_url' ); | |
function custom_login_logo_title() { | |
return get_bloginfo( 'name' ); | |
} | |
add_filter( 'login_headertitle', 'custom_login_logo_title' ); | |
remove_action( 'welcome_panel', 'wp_welcome_panel' ); | |
function example_remove_dashboard_widgets() { | |
global $wp_meta_boxes; | |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']); // 現在の状況(概要) | |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']); // 最近のコメント | |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']); // 被リンク | |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']); // プラグイン | |
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']); // クイック投稿 | |
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']); // 最近の下書き | |
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']); // WordPressブログ | |
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']); // WordPressフォーラム | |
} | |
add_action('wp_dashboard_setup', 'example_remove_dashboard_widgets'); | |
if (!current_user_can('administrator')) { | |
add_filter('pre_site_transient_update_core', create_function('$a', "return null;")); | |
} | |
add_action( 'wp_before_admin_bar_render', 'my_wp_before_admin_bar_render' ); | |
function my_wp_before_admin_bar_render() { | |
global $wp_admin_bar; | |
$wp_admin_bar->remove_menu('wp-logo'); // wordpressロゴ | |
} | |
function my_admin_head(){ | |
echo '<style type="text/css">#contextual-help-link-wrap{display:none;}</style>'; | |
echo '<style type="text/css">#screen-options-link-wrap{display:none;}</style>'; | |
} | |
add_action('admin_head', 'my_admin_head'); | |
// フッターWordPressリンクを非表示に | |
function custom_admin_footer() { | |
echo '<a href="abcd@gmail.com">管理者にお問い合わせ</a>'; | |
} | |
add_filter('admin_footer_text', 'custom_admin_footer'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment