[wp-hackers] Missing Menus

Andy Staines andy at yellowswordfish.com
Sat May 19 22:53:54 GMT 2007

Hi Robert

>> add_submenu_page('edit.php', __('Simple Forum', 'sforum'), __('Simple
>> Forum', 'sforum'), 8, 'simple-forum/sf-admin.php');
> This uses old user levels instead of a cap. Most likely the reason the
> menu doesn't show.

Well, all the same, it actually works for everyone except one user from
WP2.0 right up to 2.2. It also tallies with the examples in  the codex
(http://codex.wordpress.org/Adding_Administration_Menus) and after checking
other plugins I am using here they also use this format. Mark J's 'Subscribe
to comments' for example  - OK it uses the 'add_management_page' wrapper but
still uses a level 8. So should the role be substituted now? As in the
string -  'Administrator'?

>> There is more however. We have now discovered that the 'activate' hook
>> didn't run either as the necessary new tables have not been created and nor
>> have the options been setup. So that's two hooks that are not being
>> actioned. There are a lot of users of this and this is a unique problem to
>> date.
> You need to paste code for that too. The way you say the 'activate'
> hook (quoted) makes me think you actually tried to use a hook called
> activate, which we don't call. You need to register your plugin's
> activation hook with register_activation_hook().

The same applies to the activation - no problems anywhere else. I used:

add_action('activate_simple-forum/sf-control.php', 'sf_setup_data');

And again this is straight out the codex
(http://codex.wordpress.org/Creating_Tables_with_Plugins) and has worked
flawlessly up until this particular install.

I am more than  happy to change both of these if it resolves that users
problems who really wants to use this plugin but it would be nice to know
why, if something has changed, it is suddenly kicking in now.

As always, help and guidance apreciated.

More information about the wp-hackers mailing list