Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
backend body id hook - is there a way ?
#1
I'm looking for a way, to stylize contents of <div id="maincontent"> container, along with a horiz nav tab item in backend.
I thought that <body <?php filename_id(); ?> > in admin's theme header adds a unique ID of the plugin automatically, but all plugins I've watched end up with <body id="load">.

I assume there's a simple way to hook a value into <body> tag, but I can't find anything about that, and w/o it, I can't refer to backend's content containers css starting with #load , as other plugins pages will inherit those values.

Does anyone have a working snippet maybe?
Addons: blue business theme, Online Visitors, Notepad
Reply
#2
Not tested, but you may try using hook 'header', then in your function something like:

Code:
if (get_filename_id()=='load' && $_GET['id']=='your_plugin') {
?>
<style>
#load ... /* redefine styles... */
...
</style>
<?php ...
Reply
#3
Hmm I've posted this somewhere Ill see ifbo can find it
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#4
Carlos Wrote:Not tested, but you may try using hook 'header', then in your function something like:

Code:
if (get_filename_id()=='load' && $_GET['id']=='your_plugin') {

Muchas gracias ! This should do, although I'll have to do a little bit of gymnastics in the code to achieve a flawless vict. Wink

I haven't found snippet that Shawn has mentioned, but if it is a more flexible solution, others will surely benefit from it.
Addons: blue business theme, Online Visitors, Notepad
Reply
#5
I think you can get the plugin pages with these globals, like this.
This returns true if page is pages or edit for example, regardless of if its a plugin.

Code:
function tab_is_pages(){
global $plugin_info,$plugin_id;
return (get_filename_id() == 'load' and $plugin_info[$plugin_id]['page_type'] == 'pages' ) or get_filename_id()=='edit';
}
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply




Users browsing this thread: 1 Guest(s)