WordPress.org

Make WordPress Core

Opened 23 months ago

Last modified 23 months ago

#18357 new enhancement

Add action to do stuff before the admin menu is rendered

Reported by: llucax Owned by:
Priority: normal Milestone: Awaiting Review
Component: Administration Version: 3.2.1
Severity: trivial Keywords: has-patch
Cc: llucax@…

Description

Here is a trivial patch to allow users to inject some stuff in the Admin pages HTML body before the menu is rendered. The new action is called 'before_admin_menu_header', feel free to use a better name.

Attachments (1)

patch (389 bytes) - added by llucax 23 months ago.
Trivial patch

Download all attachments as: .zip

Change History (6)

llucax23 months ago

Trivial patch

comment:1 llucax23 months ago

  • Cc llucax@… added

comment:2 scribu23 months ago

  • Keywords reporter-feedback added

Use-case for said action?

comment:3 llucax23 months ago

  • Keywords reporter-feedback removed

More flexibility customizing the layout of the admin interface.

comment:4 scribu23 months ago

How exactly? Could you provide some example code?

comment:5 llucax23 months ago

Maybe this is a stupid example, but something like:

function f()
{
    echo "<div id=\"someid\">Some HTML before the menu</div>\n";
}
add_action('before_admin_menu_header', 'f');

If you like to know exactly what kind of HTML I like to add before the menu, I really don't know, it was a graphic designer request. We need to customize the admin theme.

PS: This is the first time I'm posting a patch here, after I removed the 'reporter-feedback' I thought maybe I shouldn't. Please let me know if I should keep it until you think you don't need more feedback from me.

Note: See TracTickets for help on using tickets.