redirect on theme switch – WordPress

You could use the after_theme_switch hook to do this, and wp_safe_redirect() works fine to redirect to local urls only. In your callback function check for the $_GET['activated'] flag or you may get a “too many redirects” type of error.

add_action( 'after_switch_theme', 'my_theme_redirect' );
function my_theme_redirect() {
    if( isset( $_GET['activated'] ) ) {
        wp_safe_redirect( admin_url('admin.php?page=alecaddd_sunset') );
        exit;
    }
}