//コアファイルの自動更新を非表示
add_filter( 'pre_site_transient_update_core', '__return_zero' );
remove_action( 'wp_version_check', 'wp_version_check' );
remove_action( 'admin_init', '_maybe_update_core' );
//管理メニューのアップデートの数字を消す
function hide_admin_items() {
?>
<style type="text/css">
.update-plugins,update-count,#contextual-help-link-wrap,li#wp-admin-bar-updates {
display:none !important;
}
</style>
<?php
}
add_action ('admin_head','hide_admin_items');
// 管理バーにログアウトを追加
function add_new_item_in_admin_bar() {
global $wp_admin_bar;
$wp_admin_bar->add_menu(array(
'id' => 'new_item_in_admin_bar',
'title' => __('ログアウト'),
'href' => wp_logout_url()
));
}
add_action('wp_before_admin_bar_render', 'add_new_item_in_admin_bar');
//管理メニューから余分なメニューを消す
function remove_admin_menu_items() {
remove_submenu_page('index.php','update-core.php');//更新
remove_menu_page('themes.php');//外観
}
add_action('admin_menu','remove_admin_menu_items');
//ログイン画面でIPを表示させる。
function custom_login_message() {
$ipAddress = $_SERVER["REMOTE_ADDR"];
$message = "<p class=\"message\"><strong>Your IP: {$ipAddress}</strong><br/></p>";
return $message;
}
add_filter('login_message', 'custom_login_message');
// フッターWordPressリンクを非表示に お問い合わせをつける。
function custom_admin_footer() {
echo '<a href="mailto:hogehoge@sys-guard.com">製作:システムガーディアン担当 お問い合わせ</a>';
}
add_filter('admin_footer_text', 'custom_admin_footer');
//※または何もかかない場合
//管理画面下部のバージョン番号を削除
// function remove_footer_version() {
// remove_filter( 'update_footer', 'core_update_footer' );
// }
// add_action( 'admin_menu', 'remove_footer_version' );
//管理画面の「Wordpressのご利用ありがとうございます。」の文言を削除
// add_filter('admin_footer_text', '__return_empty_string');
//ヘルプを消す
function disable_help_link() {
echo '<style type="text/css">
#contextual-help-link-wrap {display: none !important;}
</style>';
}
add_action('admin_head', 'disable_help_link');
//特定のカテゴリーを非表示にする
add_filter('widget_categories_args', 'my_theme_catexcept',10);
function my_theme_catexcept($cat_args){
$exclude_id = '4'; // 除外するカテゴリID
$cat_args['exclude'] = $exclude_id; // 除外
return $cat_args;
}
関連記事 - More from my site -