1

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.

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?

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.