• Hello,

    I made a full custom plugin to manage some challenges. I have a main page listing all challenges (/wp-admin/admin.php?page=challenge/challenge.php), each challenge has a link (/wp-admin/admin.php?page=challenge/challenge_edit.php&challenge_id=xx)

    I can’t access this edit page I got the following error : “You do not have sufficient permissions to access this page.”

    I search over the Internet for a solution but didn’t find the on for my problem, I already tried to insert key sentences in the wp-config.php and all other strange solutions I found.

    Someone can help me please ?

Viewing 1 replies (of 1 total)
  • Thread Starter 10-nice

    (@10-nice)

    Ok I found solution myself.

    function addMenuItem() {
      	add_menu_page( 'Challenge Administration', 'Challenge', 0, __FILE__, array( ChallengePlugin, 'displayAdminPage' ) );
      	add_submenu_page( __FILE__, 'Challenge edit', 'Challenge edit', 0, str_replace( 'challenge.php', 'challenge_edit.php', __FILE__ ), array( ChallengePlugin, 'displayEditPage' ) );
      }
    add_action('admin_menu', array('ChallengePlugin', 'addMenuItem'));

    I had to add the subùenu item to declare the edit page…

Viewing 1 replies (of 1 total)
  • The topic ‘Security error in a custom plugin’ is closed to new replies.