Admin URL to my plugin's page

后端 未结 2 856
再見小時候
再見小時候 2021-01-17 09:57

My plugin is basically a link display page, for instance if you want to display a page with links to other websites.

In wp-admin I have a menu item on the left side

2条回答
  •  再見小時候
    2021-01-17 10:36

    URL for menu page or options page has 'page' parameter ( page slug defined in add_menu_page() or add_options_page() ). You can always get the current page from $_GET['page'] param, so URL for the options page is:

    admin_url( "options-general.php?page=".$_GET["page"] )
    

    , and URL for menu page ( actually it works with options pages also ) is:

    admin_url( "admin.php?page=".$_GET["page"] )
    

提交回复
热议问题