WordPress: link to a secondary plugin page

I’m developing a WordPress plugin and so far made main plugin administration page linked from admin menu (my_plugin_main.php). Here I have a grid with a list of “products”.

I want to add a link to the grid footer to “my_plugin_edit_product.php” but I don’t know how to do it, if I link

Read More
wp-admin/admin.php?page=my_plugin_main/my_plugin_edit_product.php

or

wp-admin/admin.php?page=my_plugin_edit_product

I get an access error.

How can I link a secondary plugin page from the main one? (I need all WordPress functionallity and admin menu to be present in this page too)

Thank you

Related posts

Leave a Reply

1 comment

  1. You can Load it by Ajax with JQuery ( which is included in WP ) in your first plugin page.

    (function($) {
      $(function() {
        $('a.yourlink').click(function() {
            $(this).next('#yourdiv').load('yourpage.php', { href: this.href });
            return false;
        });
      });
    })(jQuery);
    

    Or you have to register it by using “add_menu_page” : http://codex.wordpress.org/Function_Reference/add_menu_page

    But i will be accessible from the left menu of the admin page.