I have create a plugin that I want to redirect to the options page of that plugin after the user activates it. This works fine when I test it locally. However, on a live installation of wordpress, it does not behave in the same manner.
Here is my code below:
register_activation_hook(__FILE__, 'srpt_plugin_activate');
add_action('admin_init', 'srpt_plugin_redirect');
function my_plugin_activate() {
add_option('srpt_activation_redirect', true);
}
function srpt_plugin_redirect() {
$srpt_url = admin_url( 'admin.php?page=plugin-options-page/plugin-options-page.php', 'http' );
if (get_option('srpt_activation_redirect', false)) {
delete_option('srpt_activation_redirect');
wp_redirect($srpt_url);
}
This is the substitution to the original uri:
plugin-options-page.php
Thank you for your time if I don't get a chance to thank you later. Wayne Hatter.
WP_DEBUGon inwp-config.phpfile and test. – Ashfame May 28 '12 at 12:49