[wp-hackers] Removing Admin Toolbar from Front-End
Frank Bueltge
frank at bueltge.de
Tue Dec 20 20:41:17 UTC 2011
sorry for this fast snippet, with errors in syntax; please see here:
https://gist.github.com/1503172
On Tue, Dec 20, 2011 at 7:32 PM, Frank Bueltge <frank at bueltge.de> wrote:
> add_action( 'init', '_mw_adminimize_remove_admin_bar', 0 );
> function fb_remove_admin_bar() {
> wp_deregister_script( 'admin-bar' );
> wp_deregister_style( 'admin-bar' );
> remove_action( 'init', '_wp_admin_bar_init' );
> remove_action( 'wp_footer', 'wp_admin_bar_render', 1000 );
> remove_action( 'admin_footer', 'wp_admin_bar_render', 1000 );
>
> // maybe also: 'wp_head'
> foreach ( array( 'admin_head' ) as $hook ) {
> add_action(
> $hook,
> create_function(
> '',
> "echo '<style>body.admin-bar #wpcontent, body.admin-bar
> #adminmenu { padding-top: 0px !important; }</style>';"
> )
> );
> }
>
> add_action( 'in_admin_header', '_mw_adminimize_restore_links' );
More information about the wp-hackers
mailing list