[wp-hackers] 1.5.1: Important Bugs

Robert Deaton false.hopes at gmail.com
Thu Mar 31 19:17:52 GMT 2005

This still doesn't resolve the problem. The problem is that even when
supplying a function to the add_options_page or add_submenu_page the
plugin file is still included and the function is not called. I quote
from the codex:

"If the optional function parameter is not supplied, then WordPress
will include the file referenced by the file parameter into the
content area of the page. Without code to detect whether your plugin
functions have been declared, this will likely cause PHP errors when
all of your plugin functions are redeclared. You can use the
is_plugin_page() function to mitigate this issue; however, using the
function parameter is recommended."

This would suggest that if you do supply the function, then that
function would be called and the plugin page would not be included
again. This, however, is not the case, because the plugin file is
loaded again, and instead of the function being called a hook is added
with the function name you supply. Unless I'm a complete moron, this
is still an issue, and that mosquito patch isn't completely related.

On Thu, 31 Mar 2005 13:46:24 -0500, Owen Winkler
<ringmaster at midnightcircus.com> wrote:
> Robert Deaton wrote:
> > According to the codex [1], If you supply a function to
> > add_submenu_page, that function would be called to display the content
> > and the plugin file would not be included for its page. From what I
> > can see after the past two hours of headaches surfing the source code,
> > the function is not called, and rather a hook is created with the
> > function name supplied. Not only that, but even if a function is
> > supplied, it still tries to include the page, because somewhere in the
> > get_plugin_page_hookname and get_plugin_page_hook there is a bug that
> > results in the hook not being returned, and thus the conditional on
> > line 46 of admin.php fails, which causes the file to be included.
> > Someone please, help out on this, its killing me.
> Upgrade to a recent SVN revision of 1.5.1.
> The documentation on Codex should be accurate with this fix applied:
> http://mosquito.wordpress.org/view.php?id=902
> See the changed paragraph in Codex:
> http://codex.wordpress.org/index.php?title=Adding_Administration_Menus&diff=0&oldid=9603
> Owen

--Robert Deaton

More information about the wp-hackers mailing list