diff --git a/inc/setup.php b/inc/setup.php
index 7b588c7..d178a45 100644
--- a/inc/setup.php
+++ b/inc/setup.php
@@ -42,11 +42,14 @@ function edukarsa_admin_scripts( $hook ) {
add_action( 'admin_enqueue_scripts', 'edukarsa_admin_scripts' );
// 4. REDIRECT SETELAH AKTIVASI TEMA
+
+// 4. REDIRECT AMAN SETELAH AKTIVASI TEMA
function edukarsa_activation_redirect() {
global $pagenow;
- if ( is_admin() && 'themes.php' === $pagenow && isset( $_GET['activated'] ) ) {
- wp_redirect( admin_url( 'admin.php?page=edukarsa_settings' ) );
+ if ( 'themes.php' === $pagenow && isset( $_GET['activated'] ) ) {
+ // Redirect yang aman, dipanggil setelah seluruh menu dan hak akses WordPress siap
+ wp_safe_redirect( admin_url( 'admin.php?page=edukarsa_settings' ) );
exit;
}
}
-add_action( 'after_switch_theme', 'edukarsa_activation_redirect' );
+add_action( 'admin_init', 'edukarsa_activation_redirect' );
diff --git a/style.css b/style.css
index 8908a70..a23d049 100644
--- a/style.css
+++ b/style.css
@@ -4,7 +4,7 @@ Theme URI: https://edukarsa.masbudi.my.id
Author: masbudikusuma
Author URI: https://masbudi.my.id
Description: Tema WordPress profesional untuk sekolah dan kampus (Gaya Modern Card Layout).
Fitur Unggulan Tema: