Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
load.php --> just my opinion
#1
Ok,

I'm creating a plugin and go to this url:
admin/load.php?id=pluginname

The page loads correctly, but the highlighted tab at the top is THEME, and therefore shows the THEME sidebar.
I believe this should default to the PLUGINS tab and show that plugins' additional pages on the right.

Thoughts?
Clients always want to be able to change the content of their pages, but they are unwilling to do so.

Have you ever coded in your underwear before?
Reply
#2
Hey, dude pretty sure thats in the register plugin array
Code:
register_plugin(
    $thisfile,                     # ID of plugin, should be filename minus php
    'fooBar Plugin',                            # Title of plugin
    '1.0',                     # Version of plugin
    'Jamie Whiskers',            # Author of plugin
    'http://www.example.net',     # Author URL
    'The all mighty FooBar Plugin',     # Plugin Description
    'plugins',                     # Page type of plugin
    'foo'                          # Function that displays content
);

Page type Plugin I think is what you need to change.
Reply
#3
Duh!! Big Grin

One of those days.

Anyway, I've got the options.php file setup and displaying only when the plugin is displayed, but what about the other plugins, could I hide them when I display the selected plugin so I can show off my other options in the sidebar?
Clients always want to be able to change the content of their pages, but they are unwilling to do so.

Have you ever coded in your underwear before?
Reply
#4
We need to update the docs...

This variable is so it knows which sidebar to include and which Main tab to make “current”. The available ones are what is before the sidebar-*.php files in the /admin/template directory

Mike
My Github Repos: Github
Website: DigiMute
Reply
#5
Honestly i dont think so. I mean there might be a way, you would have to override the other plugins-sidebar actions. I would just make so it shows up in your content section, a nice added menu at the top.
Reply
#6
^ I thought about that, I just don't know what the best approach would be. I'm not sure if the dev's want individual menu structures that are written and different each time, or if they want a menu structure that doesn't change from plugin to plugin.
Clients always want to be able to change the content of their pages, but they are unwilling to do so.

Have you ever coded in your underwear before?
Reply
#7
You might want to use an adaption of the following code to add items to the sidebar of choice:

Code:
# hook
add_action('support-sidebar','gssr_sidelink');

# functions
function gssr_sidelink(){
    if(get_filename_id()==='salt-regeneration') { $current = 'class="current"'; } else { $current = null; }
    echo '<li><a href="'.$_SERVER['PHP_SELF'] . '?regen" '.$current.' >Regenerate Security Salt</a></li>';
}
(Stolen from Chris’ salt regeneration plugin.)

Just throw an if-clause around the add_action() that checks whether they are on one of your plugin pages. That way you won’t be filling up the sidebar when the user doesn’t want all your options there.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply




Users browsing this thread: 1 Guest(s)