1
votes

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

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

1

1 Answers

0
votes

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.