1

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!

1 Answer 1

0

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'
    );

}

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