WordPress.org

Plugin Directory

Changeset 562084


Ignore:
Timestamp:
06/21/12 23:46:14 (22 months ago)
Author:
sLaNGjI
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-toolbar-removal/trunk/wp-toolbar-removal.php

    r562080 r562084  
    5454 */ 
    5555if(!function_exists('add_action')){header('HTTP/1.0 403 Forbidden');header('HTTP/1.1 403 Forbidden');exit();} 
    56  
    5756function wptbr_rsb(){echo'<style type="text/css">html.wp-toolbar,html.wp-toolbar #wpcontent,html.wp-toolbar #adminmenu,html.wp-toolbar #wpadminbar,body.admin-bar,body.admin-bar #wpcontent,body.admin-bar #adminmenu,body.admin-bar #wpadminbar{padding-top:0px !important}</style>';}add_action('admin_print_styles','wptbr_rsb',21); 
    58  
    59 //function wptbr_rbcb(){if(has_filter('wp_head','_admin_bar_bump_cb')){remove_filter('wp_head','_admin_bar_bump_cb');}}add_filter('wp_head','wptbr_rbcb',1); 
    60  
     57function wptbr_rbcb(){if(has_filter('wp_head','_admin_bar_bump_cb')){remove_filter('wp_head','_admin_bar_bump_cb');}}add_filter('wp_head','wptbr_rbcb',1); 
    6158function wptbr_ngr( $wp_toolbar ) { 
    6259 
     
    158155function wptbr_hdr(){?><style type="text/css">table#wptbr td#wptbr_ttl a:link,table#wptbr td#wptbr_ttl a:visited{text-decoration:none}table#wptbr td#wptbr_lgt,table#wptbr td#wptbr_lgt a{text-decoration:none}</style><table style="margin-left:6px;float:left;z-index:100;position:relative;left:0px;top:0px;background:none;padding:0px;border:0px;border-bottom:1px solid #DFDFDF" id="wptbr" border=0 cols=4 width="97%" height="33"><tr><td align=left valign=center id="wptbr_ttl"><?php echo'<a href="'.home_url().'">'.__(get_bloginfo()).'</a>'?></td><td align=right valign=center id="wptbr_lgt"><div style="padding-top:2px"><?php wp_get_current_user();$current_user=wp_get_current_user();if(!($current_user instanceof WP_User))return;echo''.$current_user->display_name.''?><?php if(is_multisite()&&is_super_admin()){if(!is_network_admin()){echo' | <a href="'.network_admin_url(). '">'. __('Network Admin'). '</a>';}else{echo' | <a href="' .get_dashboard_url(get_current_user_id()). '">'.__('Site Admin') . '</a>';}}?> | <?php echo'<a href="' .wp_logout_url(home_url()). '">'.__('Log Out'). '</a>'?></div></td><td width="8"></td></tr></table><?php }add_action('in_admin_header','wptbr_hdr'); 
    159156 
    160 //add_filter('init','wptbr_init'); 
     157remove_action('init','wp_admin_bar_init'); 
     158remove_filter('init','wp_admin_bar_init'); 
    161159 
    162160$wp_scripts = new WP_Scripts(); 
    163161wp_deregister_script( 'admin-bar' ); 
    164 $wp_styles = new WP_Styles(); 
    165 wp_deregister_style( 'admin-bar' ); 
    166  
    167162//wp_deregister_script('wp-admin-bar'); 
    168163//wp_deregister_script('wp_admin_bar_wp_menu'); 
     
    171166//wp_deregister_script('nacin_promote_network_admin_in_toolbar'); 
    172167 
     168$wp_styles = new WP_Styles(); 
     169wp_deregister_style( 'admin-bar' ); 
    173170//wp_deregister_style('wp-admin-bar'); 
    174171//wp_deregister_style('admin_bar_menu'); 
     
    176173 
    177174remove_action( 'wp_footer', 'wp_admin_bar_render', 1000 ); 
    178 //remove_filter( 'wp_footer', 'wp_admin_bar_render', 1000 ); 
     175remove_filter( 'wp_footer', 'wp_admin_bar_render', 1000 ); 
    179176remove_action( 'admin_footer', 'wp_admin_bar_render', 1000 ); 
    180 //remove_filter( 'admin_footer', 'wp_admin_bar_render', 1000 ); 
     177remove_filter( 'admin_footer', 'wp_admin_bar_render', 1000 ); 
    181178 
    182179//remove_action('admin_footer','wp_admin_bar_render'); 
     
    187184//remove_action('admin_head','wp_admin_bar_render',1000); 
    188185//remove_filter('admin_head','wp_admin_bar_render',1000); 
    189  
    190 remove_action('init','wp_admin_bar_init'); 
    191 remove_filter('init','wp_admin_bar_init'); 
    192186 
    193187remove_action( 'wp_head', 'wp_admin_bar_css' ); 
     
    196190remove_action( 'admin_footer', 'wp_admin_bar_js' ); 
    197191remove_action( 'wp_ajax_adminbar_render', 'wp_admin_bar_ajax_render' ); 
    198 //remove_filter( 'wp_ajax_adminbar_render', 'wp_admin_bar_ajax_render' ); 
     192remove_filter( 'wp_ajax_adminbar_render', 'wp_admin_bar_ajax_render' ); 
    199193 
    200194remove_filter( 'locale', 'wp_admin_bar_lang' ); 
     
    235229//remove_filter('personal_options','_get_admin_bar_pref'); 
    236230 
    237 //function wptbr_init(){add_filter('show_admin_bar','__return_false');} 
    238 function wptbr_spab_init(){add_filter( 'show_wp_pointer_admin_bar', '__return_false' );} 
    239  
     231//show_admin_bar(false); 
     232 
     233function wptbr_init(){add_filter('show_admin_bar','__return_false');}add_filter('init','wptbr_init'); 
     234function wptbr_spab_init(){add_filter( 'show_wp_pointer_admin_bar', '__return_false' );}add_filter('init','wptbr_spab_init'); 
    240235function wptbr_rsf(){echo'<style type="text/css">html{margin-top:0px !important}* html body{margin-top:0px !important}</style>';}add_filter('wp_head','wptbr_rsf',99); 
    241 function wptbr_ruppoabpc(){echo'<style type="text/css">.show-admin-bar{display:none}</style>';}add_action('admin_print_styles-profile.php','wptbr_ruppoabpc');show_admin_bar(false); 
     236function wptbr_ruppoabpc(){echo'<style type="text/css">.show-admin-bar{display:none}</style>';}add_action('admin_print_styles-profile.php','wptbr_ruppoabpc'); 
    242237function wptbr_nfo(){echo"\n<!--Plugin ToolBar Removal 2012.0621.0341 RC Active-->";}add_action('wp_head','wptbr_nfo');add_action('wp_footer','wptbr_nfo'); 
    243238?> 
Note: See TracChangeset for help on using the changeset viewer.