how to open page, defined in plugin, from dashboad widget

I have a plugin that adds a number of admin pages, and drives two page templates for the public facing documents. It also loads one dashboard widget for “subscribers”. In this widget is a list of links to a summary pages. The summary page is located in the plugin directory tree, and has the same ownership and privileges as all other php files.

The links appear and I can click on them, but get the “you do not have permissions to access this page” notice.

Read More

In the plugin functions, I have declared this function:

function pgc_certificate_display() {
    include('pg-certificate-display.php');
}

In plugin initialization I declare the page slug:

add_users_page('edit.php?post_type=page', 'Certificates', 'Certificates', 'read', 'certificate-display', 'pgc_certificate_display');

In the code that manufactures the list of summary pages is in the dashboard widget php, where the URL is constructed as follows:

$_SERVER['SCRIPT_NAME'] . '?page=certificate-display&cert_number=' . $cert['cert_number']

I have error display enabled and none are being raised.

What are the incorrect bits in this?

Related posts

Leave a Reply

1 comment

  1. This is not the best solution, but it worked so we made deadline.

    I created a child theme and a page template, which allowed me to write a simple URL to open the page.