I wrote a plugin that displays all products in a woocommerce store in admin settings option, now I want to add a link to download the products as CSV file.
The problem is, when I click the link I get a permission error saying I don't have permission to view this page.
Here's my code:
function extra_tablenav($which) {
if ($which == "top") {
echo '<h3 style="display:inline">'
. __('These products are currently in the database:')
. '</h3>' .
' ' .
'<a href="' . admin_url('admin.php?page=download_csv.php') . '">' . __('Export to CSV') . '</a>';
}
}
How can I fix those permissions?