Currently, I am using the following hook to add CSS for a plugin options page:
PHP Code:
add_action('admin_head', array(&$this, 'cbnetmyplugin_css'));
(The function, of course, then holds the added CSS.)
But, what if I want to target my own plugin options page, specifically? How can I do that?
Say, for instance, the URL for my options page is:
PHP Code:
/wordpress/wp-admin/options-general.php?page=cbnet-my-plugin-name
I would like to add an if statement, like such:
PHP Code:
$mypluginoptionpageslug = 'cbnet-my-plugin-name';
$adminurl = foo; //what goes here?
$ismypluginoptionpage = ( strpos($adminurl,$mypluginoptionpageslug) !== false ? 'true' : 'false' );
if ( $ismypluginoptionpage == 'true' ) {
add_action('admin_head', array(&$this, 'cbnetmyplugin_css'));
}
So the question is, what goes in "foo":
PHP Code:
$adminurl = foo; //what goes here?
That would give me the current URL, or other way of identifying which option page I'm currently on?