I am new to wordpress plugin development. I have created a list page and an add item page. When I add successfully, I want to redirect and it is giving me this error.
Notice the error is on pluggable.php on line 876
I have checked many sources but unable to find the solution so far
- I have used
wp_redirect('admin.php?page=ccURLList'); exit;
it gives the attached error - I have used
no-header
in the query string of form submission, it does work but in case of any error I wanted to show the page again and that page is without any sidebar or wp stuff - When i move the
wp_redirect
to my main fileclickCounter.php
it says function is unknown
If any of you can resolve this issue, it will be highly appreciated.
EDIT
clickCounter.php
is my main file. It creates menus etc.
I have a list page which is working.
I have an add page. I have put the wp_redirect on the very first lines after
<?php
// ccURLAdd.php my add page
if (!defined('ABSPATH'))
die('You are not allowed to call this page directly.');
add_action( 'init', 'CCaddNewLink' );
function CCaddNewLink(){
wp_redirect(home_url());
exit;
}
//wp_redirect('admin.php?page=click-counter');
exit;
Below is my main file
<?php
// clickCounter.php my main page.
/* some plugin info */
add_action('admin_menu', 'ccAdminMenu');
function ccAdminMenu()
{
add_menu_page("Click Counter", "Click Counter", 8, 'click-counter', "ccAdminMenuListUrls", CC_HTML_WEB . "/images/icon.png");
add_submenu_page('click-counter', 'Add New Link', 'Add Link', 8, 'click-counter-url-new', 'ccAdminAddUrl');
}
function ccAdminAddUrl()
{
include 'ccURLAdd.php';
}
echo
edNotice
s. You will need to post your code.