Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Im creating a plugin but I have a privileges problem.

Here is my code:

add_action('admin_menu', 'add_quiniela_menu');


function add_quiniela_menu()
{
    add_menu_page('Quiniela Game', 'Quiniela Game', 0, 'quiniela/quiniela_funcs.php', '', '');
    add_submenu_page( 'quiniela/quiniela_funcs.php',
        'Characters', 
        'Characters', 
        0, 
        'admin.php?page=quiniela/characters.php'
    );

}

This adds a menu page called Quiniela Game, and I add a submenu page called Characters.

When I click on "Characters" I get this error:

You do not have sufficient privileges to access this page

Any idea how to fix it ?

Thanks!

share|improve this question

closed as too localized by toscho Jul 17 '12 at 23:33

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

1 Answer

admin.php?page=quiniela/characters.php is coming from where in your codes well try this.

function add_quiniela_menu()
{
    add_menu_page('Quiniela Game', 'Quiniela Game', 0, 'quiniela/quiniela_funcs.php', '', '');
    add_submenu_page( 'quiniela/quiniela_funcs.php',
        'Characters', 
        'Characters', 
        0, 
        'quiniela/quiniela_funcs.php?page=characters'
    );

}
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.