Consider using a menu slug other than __FILE__ for add_options_page
-
Thanks for the great plugin. I have one minor issue. On two multisite installations where I was testing it (though not on a third, curiously) I ran into this error every time I tried to save settings:
you do not currently have privileges on this site
I noticed in the file myYTPlayer-admin.php you call:
add_options_page('mbYTPlayer', 'mb.YTPlayer', 'manage_options', __FILE__, 'mbYTPlayer_options_page');
I know that other plugins do this without a problem, but for some reason using __FILE__ as the “menu-slug” is causing me trouble, at least on two sites. Maybe it’s because your filename includes uppercase characters whereas the slug gets created all in lower case? It could be something about my configuration or rewrites. At any rate, changing your code to the following fixes the issue for me:
add_options_page('mbYTPlayer', 'mb.YTPlayer', 'manage_options', 'mbytplayer-options-page', 'mbYTPlayer_options_page');
I thought I would mention it in case it’s something you’d be willing to incorporate.
Thanks!
- The topic ‘Consider using a menu slug other than __FILE__ for add_options_page’ is closed to new replies.