diff --git a/footer.php b/footer.php
index 6d52dd5..2db20b2 100644
--- a/footer.php
+++ b/footer.php
@@ -11,6 +11,9 @@ $wa_clean = preg_replace( '/[^0-9]/', '', $raw_telp );
if ( substr( $wa_clean, 0, 1 ) === '0' ) {
$wa_clean = '62' . substr( $wa_clean, 1 );
}
+
+$wa_btn_label = get_option( 'edukarsa_wa_btn_text', 'Tanya PMB' );
+$wa_def_msg = get_option( 'edukarsa_wa_default_msg', 'Halo Admin EduKarsa, saya ingin bertanya informasi lebih lanjut.' );
?>
@@ -136,7 +139,7 @@ if ( substr( $wa_clean, 0, 1 ) === '0' ) {
-
+
+
+
+
Pembaca Suara (Audio)
+
+ 🔊 Baca
+ ⏹ Berhenti
+
+
+
Ukuran Teks
@@ -178,11 +190,11 @@ if ( substr( $wa_clean, 0, 1 ) === '0' ) {
-
+
-
+
- Tanya PMB
+
@@ -302,7 +314,70 @@ if ( substr( $wa_clean, 0, 1 ) === '0' ) {
localStorage.removeItem('edukarsa_a11y_grayscale');
localStorage.removeItem('edukarsa_a11y_links');
applyA11y();
+ if ('speechSynthesis' in window) {
+ window.speechSynthesis.cancel();
+ const pBtn = document.getElementById("a11y-speak-play");
+ if (pBtn) { pBtn.classList.remove('speaking'); pBtn.innerText = "🔊 Baca"; }
+ }
});
+
+ // 4. Fitur Suara Text-to-Speech (Web Speech API Native)
+ const speakPlayBtn = document.getElementById("a11y-speak-play");
+ const speakStopBtn = document.getElementById("a11y-speak-stop");
+
+ if ('speechSynthesis' in window && speakPlayBtn) {
+ const synth = window.speechSynthesis;
+
+ speakPlayBtn.addEventListener("click", function() {
+ if (synth.speaking) {
+ synth.cancel();
+ }
+
+ // Ambil konten teks utama artikel atau bodi halaman
+ const contentEl = document.querySelector("article .entry-content") || document.getElementById("primary") || document.body;
+ const textToRead = contentEl.innerText.replace(/\s+/g, ' ').trim();
+ if (!textToRead) return;
+
+ const utterance = new SpeechSynthesisUtterance(textToRead);
+
+ // Deteksi bahasa yang sedang aktif
+ const match = document.cookie.match(/googtrans=\/id\/([a-zA-Z\-]+)/i);
+ const activeLang = match ? match[1].toLowerCase() : 'id';
+
+ if (activeLang === 'en') {
+ utterance.lang = 'en-US';
+ } else if (activeLang === 'ar') {
+ utterance.lang = 'ar-SA';
+ } else {
+ utterance.lang = 'id-ID';
+ }
+
+ utterance.rate = 0.95; // Kecepatan baca ideal untuk artikulasi jelas
+
+ utterance.onstart = function() {
+ speakPlayBtn.classList.add('speaking');
+ speakPlayBtn.innerText = "🔊 Membaca...";
+ };
+
+ utterance.onend = utterance.onerror = function() {
+ speakPlayBtn.classList.remove('speaking');
+ speakPlayBtn.innerText = "🔊 Baca";
+ };
+
+ synth.speak(utterance);
+ });
+
+ speakStopBtn?.addEventListener("click", function() {
+ if (synth.speaking) {
+ synth.cancel();
+ speakPlayBtn.classList.remove('speaking');
+ speakPlayBtn.innerText = "🔊 Baca";
+ }
+ });
+ } else if (speakPlayBtn) {
+ speakPlayBtn.style.display = 'none';
+ if (speakStopBtn) speakStopBtn.style.display = 'none';
+ }
}
});
diff --git a/inc/admin-menu.php b/inc/admin-menu.php
index 7bb821f..e6d1774 100644
--- a/inc/admin-menu.php
+++ b/inc/admin-menu.php
@@ -61,6 +61,7 @@ function edukarsa_register_settings() {
'edukarsa_mid_bg_image', 'edukarsa_mid_bg_color',
'edukarsa_cta_bg', 'edukarsa_cta_title', 'edukarsa_cta_btn_teks', 'edukarsa_cta_btn_url',
'edukarsa_footer_logo', 'edukarsa_footer_desc', 'edukarsa_footer_alamat', 'edukarsa_footer_telp', 'edukarsa_footer_email', 'edukarsa_footer_jam',
+ 'edukarsa_wa_btn_text', 'edukarsa_wa_default_msg',
'edukarsa_tampil_fb', 'edukarsa_footer_fb', 'edukarsa_tampil_ig', 'edukarsa_footer_ig', 'edukarsa_tampil_yt', 'edukarsa_footer_yt', 'edukarsa_tampil_tiktok', 'edukarsa_footer_tiktok', 'edukarsa_tampil_x', 'edukarsa_footer_x',
'edukarsa_footer_copyright', 'edukarsa_custom_css'
);
@@ -192,10 +193,10 @@ function edukarsa_settings_page_html() {
-
Tampilkan Seksi FAQ
- ?Jika dimatikan, seksi FAQ disembunyikan dari beranda. Seluruh item FAQ yang sudah dibuat tetap tersimpan aman.
+ ?Jika dinonaktifkan, seksi FAQ disembunyikan dari beranda. Seluruh item FAQ yang sudah dibuat tetap tersimpan aman di database.
Kelola Data FAQ ↗
@@ -381,7 +381,6 @@ function edukarsa_settings_page_html() {
-
Label Tampilan Seksi FAQ (Tanya Jawab)
@@ -394,10 +393,29 @@ function edukarsa_settings_page_html() {
-
+
-
+
+
+
+
+
+ 💬 Kustomisasi Tombol WhatsApp Melayang (Floating Button)
+
+
+
Nomor WhatsApp otomatis diambil dari kolom Nomor Telepon di bawah.
+
+