[wp-trac] [WordPress Trac] #28511: Wp-admin #wpwrap hooks
WordPress Trac
noreply at wordpress.org
Fri Jun 13 00:31:51 UTC 2014
#28511: Wp-admin #wpwrap hooks
-------------------------------+-------------------------------------------
Reporter: evandentremont | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 3.9.1
Severity: normal | Resolution:
Keywords: reporter-feedback | Focuses: ui, administration, template
-------------------------------+-------------------------------------------
Comment (by evandentremont):
Replying to [comment:2 ocean90]:
> Can you please provide some use cases/code examples for these hooks?
The use case that comes up internally was to keep client branding on the
admin page for contributors.
This is an example stack overflow question
http://wordpress.stackexchange.com/questions/51023/add-header-and-footer-
to-wp-backend
I invoked it like this.
Header.php is everything until and including <body> then <?php
include("headerbody.php") ?> same idea with the footer
{{{
<?php
// enqueue_stylesheets includes all the stylesheets on front end
function theme_header(){
include('headerbody.php');
}
function theme_footer(){
include('footerbody.php');
}
if( current_user_can( 'subscriber' ) ){
add_action("pre_admin_header", "theme_header", 1);
add_action( 'admin_head', 'enqueue_stylesheets' );
add_action("post_admin_footer", "theme_footer", 1);
} // only if subscriber
?>
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28511#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list