• I have a basic problem making my plugin. I added a menu item ‘my plugin’ and clicking it opens the page ‘myplugin-index.php. In this page I want to link to another page in the plugin directory ‘members.php’. I use the following URL:

    <a href="<?php echo admin_url( 'admin.php?page=bta/members.php' ); ?>">List all members</a>

    clicking results in the page:

    https://localhost:8888/wordpress/wp-admin/admin.php?page=bta/members.php

    and the screen gives me:

    You do not have sufficient permissions to access this page.

    If I add ‘members’ as a submenu it will actually work (but I don t want to have a submenu). Can somebody explain this to me?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    I can’t explain it because I’ve had no reason to ever directly call admin.php. I think what you want to do is call members.php directly in your link. Then on members.php, you should require_once() the admin.php file to enable the WP environment and require the user be logged in.

    Thread Starter tonaua

    (@tonaua)

    Thanks for trying to understand my questions. What I actually try to do is splitting my plugin file in multiple files. I want to make links from my main file to files like members.php and games.php. These hyperlinks give me troubles like described. Am I doing something strange with this? I cannot imagine that this is something complicated to do…

    Will try your suggestion to include admin.php

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Admin_url > You do not have sufficient permissions to access this page.’ is closed to new replies.