Created
December 9, 2012 00:23
-
-
Save aprakasa/4242702 to your computer and use it in GitHub Desktop.
Redirect theme/plugin after activation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'init', 'ayo_redirect_plugin_activation' ); | |
function ayo_redirect_plugin_activation(){ | |
global $pagenow; | |
if ( is_admin() && isset( $_GET['activated'] ) && $pagenow == 'plugins.php' ) | |
wp_redirect( admin_url( 'options-general.php?page=plugin-page-slug' ) ); | |
exit; | |
} | |
add_action( 'init', 'ayo_redirect_theme_activation' ); | |
function ayo_redirect_theme_activation(){ | |
global $pagenow; | |
if ( is_admin() && isset( $_GET['activated'] ) && $pagenow == 'themes.php' ) | |
wp_redirect( admin_url( 'admin.php?page=theme-settings-slug' ) ); | |
exit; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment