How to redirect to different admin page in WordPress?
-
I’m constantly running into the same annoyance, so i thought i’d see if there’s any ideas or experience out there…
What has been the goal is to port this script to a WordPress plugin. Then to further develop it.
Custom plugin pages always load as admin.php?page=… unless I want to load them from the plugin directory directly, which I don’t. Now if I do an ‘action’ from that page, I need to process that somehow and then redirect back to the page.
<?php /* Plugin Name: EG204 2nd Edition */ ?> <?php function EG204_2nd_Edition_to_Menu() { add_menu_page( 'EG-204', 'EG-204 Ver. 2', '7', 'EG', 'EG204_ExoSkel' , '' , '4' ); } function EG204_ExoSkel() { ?> <?php //// //Lots of PHP code //// ?> <?php } add_action('admin_menu', 'EG204_2nd_Edition_to_Menu'); //Have tried adding this, which doesn't seem to do anything... add_action('template_redirect','EG204_ExoSkel'); ?>
This causes–once the form inside the PHP is submitted–it stays on the admin.php page… When what is wanted is to redirect, or to stay on the same page.
Would appreciate any help! Thanks!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to redirect to different admin page in WordPress?’ is closed to new replies.