[wp-hackers] "This page" inconsistency

Owen Winkler ringmaster at midnightcircus.com
Wed Apr 5 18:32:35 GMT 2006

David Coppit wrote:
> Questions: Is the first non-directory method a feature or a bug? Is this
> inconsistency a feature or a bug? Is there a "correct" way of getting the
> current page?

The implementation seems to change depending on the status of fixing 
bugs filed in Trac, but...

If you use plugin_basename(__FILE__) instead of basename(__FILE__) you 
should get the plugin file and the directory, if it is being used.

To demonstrate using some of your code:

$_SERVER['PHP_SELF'] . "?page=" . plugin_basename(__FILE__)

Does every server/config provide PHP_SELF?  It might be better to use 
get_settings('home') . '/wp-admin/{actual_page_name_here}'


More information about the wp-hackers mailing list