Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kharissulistiyo
Last active February 16, 2023 17:20
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save kharissulistiyo/8392698 to your computer and use it in GitHub Desktop.
Save kharissulistiyo/8392698 to your computer and use it in GitHub Desktop.
Admin Page Redirection After WordPress Theme Activated
/**
* WordPress snippet
* Admin page redirection
* Put this inside theme setup function
*/
global $pagenow;
if ( is_admin() && 'themes.php' == $pagenow && isset( $_GET['activated'] ) ) {
wp_redirect(admin_url("themes.php?page=rundown-settings")); // Your admin page URL
}
@two-points
Copy link

Thank you for the code.

Is it allowed in the theme on WordPress.org? Will theme reviewer allow such redirection?

Regards,
Nilesh G

@shamimriyad
Copy link

Error and showing this message 'Sorry, you are not allowed to access this page.'. How to solve it? bro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment