Skip to content

Instantly share code, notes, and snippets.

@aprakasa
Created December 9, 2012 00:23
Show Gist options
  • Save aprakasa/4242702 to your computer and use it in GitHub Desktop.
Save aprakasa/4242702 to your computer and use it in GitHub Desktop.
Redirect theme/plugin after activation
<?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