修改WordPress后台定制功能

保护后台登录

[php]
add_action(‘login_enqueue_scripts’,’login_protection’);
function login_protection(){
if($_GET[‘word’] != ‘press’)header(‘Location: [url]http://www.howsync.com/'[/url]);
}
[/php]

这样一来,后台登录的唯一地址就是 http://www.howsync.com/wp-login.php?word=press,如果不是这个地址,就会自动跳转到http://www.howsync.com.

[php]
//移除WordPress顶部管理工具栏Admin Bar
add_filter( ‘show_admin_bar’, ‘__return_false’ );
 
//隐藏核心更新提示 WP 3.0+
add_filter( ‘pre_site_transient_update_core’, create_function( ‘$a’, "return null;" ) );
  
//隐藏插件更新提示 WP 3.0+
remove_action( ‘load-update-core.php’, ‘wp_update_plugins’ );
add_filter( ‘pre_site_transient_update_plugins’, create_function( ‘$b’, "return null;" ) );
  
//隐藏主题更新提示 WP 3.0+
remove_action( ‘load-update-core.php’, ‘wp_update_themes’ );
add_filter( ‘pre_site_transient_update_themes’, create_function( ‘$c’, "return null;" ) );
 
 
//屏蔽后台左上LOGO
function annointed_admin_bar_remove() {
        global $wp_admin_bar;
        /* Remove their stuff */
        $wp_admin_bar->remove_menu(‘wp-logo’);
}
add_action(‘wp_before_admin_bar_render’, ‘annointed_admin_bar_remove’, 0);
[/php]

发表评论