• 16-06-2013, 13:50:39
    #1
    Wordpress te upload edilen resimlerin adlarını türkçe karakterlerden temizleyen bir eklenti var mı acaba?

    Resim adı: Fotoğraf Aşıklar Günü ise, bu fotoğraf yüklendiğinde resim adı: fotograf-asiklar-gunu olarak ayarlanmasını istiyorum, bunu nasıl sağlarım ?
  • 16-06-2013, 14:25:42
    #2
    Kimlik doğrulama veya yönetimden onay bekliyor.
    add_filter( 'sanitize_file_name_chars', 'turkce_filter', 10, 2 );
     function turkce_filter ( $special_chars, $filename_raw ) {
        $chars = array('ç', 'Ç', 'ğ', 'Ğ', 'ı', 'İ', 'ö', 'Ö', 'ş', 'Ş', 'ü', 'Ü');
        $special_chars = array_merge( $special_chars, $chars );
        return $special_chars;
     }
    temanizdaki functions.php icerisine yukardaki kodlari eklersen duzelecektir
  • 16-06-2013, 14:47:51
    #3
    Ergün adlı üyeden alıntı: mesajı görüntüle
    add_filter( 'sanitize_file_name_chars', 'turkce_filter', 10, 2 );
     function turkce_filter ( $special_chars, $filename_raw ) {
        $chars = array('ç', 'Ç', 'ğ', 'Ğ', 'ı', 'İ', 'ö', 'Ö', 'ş', 'Ş', 'ü', 'Ü');
        $special_chars = array_merge( $special_chars, $chars );
        return $special_chars;
     }
    temanizdaki functions.php icerisine yukardaki kodlari eklersen duzelecektir
    Söylediğin eklemeyi yaptım ama resim adı istediğim şekilde olmadı gene;

    Yüklediğim resim : Furkan etleri götürüyo.jpg
    Seo lu hali: Furkan-etleri-gtryo.jpg
  • 16-06-2013, 15:16:32
    #4
    asagidaki kodlari denermisin

    add_filter('sanitize_file_name', 'turkce_filter', 10);
    function turkce_filter ($filename) {
     $turkish_chars = array('ç', 'Ç', 'ğ', 'Ğ', 'ı', 'İ', 'ö', 'Ö', 'ş', 'Ş', 'ü', 'Ü');
     $sanitized_chars = array('c', 'C', 'g', 'G', 'i', 'I', 'o', 'O', 's', 'S', 'u', 'U');
     $friendly_filename = preg_replace($turkish_chars, $sanitized_chars, $filename);
     return $friendly_filename;
    }
  • 16-06-2013, 15:21:55
    #5
    Ergün adlı üyeden alıntı: mesajı görüntüle
    asagidaki kodlari denermisin

    add_filter('sanitize_file_name', 'turkce_filter', 10);
    function turkce_filter ($filename) {
     $turkish_chars = array('ç', 'Ç', 'ğ', 'Ğ', 'ı', 'İ', 'ö', 'Ö', 'ş', 'Ş', 'ü', 'Ü');
     $sanitized_chars = array('c', 'C', 'g', 'G', 'i', 'I', 'o', 'O', 's', 'S', 'u', 'U');
     $friendly_filename = preg_replace($turkish_chars, $sanitized_chars, $filename);
     return $friendly_filename;
    }
    bu kodu ekleyince de aşağıdaki gibi bir hata aldım

    Warning: preg_replace() [function.preg-replace]: No ending delimiter '�' found in /home/celtikli/public_html/wp-content/themes/MobiTech2/functions.php on line 259
    5147

    ve resimde upload edilemedi tabiki
  • 16-06-2013, 15:27:49
    #6
    vermis oldugum kodu kaldirip functions.php utf-8 bomsuz olarak kodla sonra ekle kodlari.
  • 16-06-2013, 15:32:45
    #7
    Ergün adlı üyeden alıntı: mesajı görüntüle
    vermis oldugum kodu kaldirip functions.php utf-8 bomsuz olarak kodla sonra ekle kodlari.
    yok hocam yine değişen birşey olmadı aynı hatayı alıyorum.
  • 16-06-2013, 15:36:41
    #8
    add_filter('sanitize_file_name', 'turkce_filter', 10);
    asagidaki ile degistirip denermisin

    add_filter( 'sanitize_file_name_chars', 'turkce_filter', 10, 2 );
  • 16-06-2013, 15:40:36
    #9
    add_filter( 'sanitize_file_name_chars', 'turkce_filter', 10, 2 );
    function turkce_filter ($filename) {
    $turkish_chars = array('ç', 'Ç', 'ğ', 'Ğ', 'ı', 'İ', 'ö', 'Ö', 'ş', 'Ş', 'ü', 'Ü');
    $sanitized_chars = array('c', 'C', 'g', 'G', 'i', 'I', 'o', 'O', 's', 'S', 'u', 'U');
    $friendly_filename = preg_replace($turkish_chars, $sanitized_chars, $filename);
    return $friendly_filename;
    }

    bu şekilde denedim. Bu seferde aşağıdaki gibi bir hata aldım;


    Warning: preg_replace() [function.preg-replace]: No ending delimiter '�' found in /home/celtikli/public_html/wp-content/themes/MobiTech2/functions.php on line 259

    Warning: preg_replace() [function.preg-replace]: No ending delimiter '�' found in /home/celtikli/public_html/wp-content/themes/MobiTech2/functions.php on line 259

    Warning: preg_replace() [function.preg-replace]: No ending delimiter '�' found in /home/celtikli/public_html/wp-content/themes/MobiTech2/functions.php on line 259

    Warning: preg_replace() [function.preg-replace]: No ending delimiter '�' found in /home/celtikli/public_html/wp-content/themes/MobiTech2/functions.php on line 259

    Warning: preg_replace() [function.preg-replace]: No ending delimiter '�' found in /home/celtikli/public_html/wp-content/themes/MobiTech2/functions.php on line 259

    Warning: preg_replace() [function.preg-replace]: No ending delimiter '�' found in /home/celtikli/public_html/wp-content/themes/MobiTech2/functions.php on line 259

    Warning: preg_replace() [function.preg-replace]: No ending delimiter '�' found in /home/celtikli/public_html/wp-content/themes/MobiTech2/functions.php on line 259

    Warning: preg_replace() [function.preg-replace]: No ending delimiter '�' found in /home/celtikli/public_html/wp-content/themes/MobiTech2/functions.php on line 259

    Warning: preg_replace() [function.preg-replace]: No ending delimiter '�' found in /home/celtikli/public_html/wp-content/themes/MobiTech2/functions.php on line 259

    Warning: preg_replace() [function.preg-replace]: No ending delimiter '�' found in /home/celtikli/public_html/wp-content/themes/MobiTech2/functions.php on line 259

    Warning: preg_replace() [function.preg-replace]: No ending delimiter '�' found in /home/celtikli/public_html/wp-content/themes/MobiTech2/functions.php on line 259

    Warning: preg_replace() [function.preg-replace]: No ending delimiter '�' found in /home/celtikli/public_html/wp-content/themes/MobiTech2/functions.php on line 259

    Warning: preg_replace() [function.preg-replace]: No ending delimiter '�' found in /home/celtikli/public_html/wp-content/themes/MobiTech2/functions.php on line 259

    Warning: preg_replace() [function.preg-replace]: No ending delimiter '�' found in /home/celtikli/public_html/wp-content/themes/MobiTech2/functions.php on line 259

    Warning: preg_replace() [function.preg-replace]: No ending delimiter '�' found in /home/celtikli/public_html/wp-content/themes/MobiTech2/functions.php on line 259

    Warning: preg_replace() [function.preg-replace]: No ending delimiter '�' found in /home/celtikli/public_html/wp-content/themes/MobiTech2/functions.php on line 259

    Warning: preg_replace() [function.preg-replace]: No ending delimiter '�' found in /home/celtikli/public_html/wp-content/themes/MobiTech2/functions.php on line 259

    Warning: preg_replace() [function.preg-replace]: No ending delimiter '�' found in /home/celtikli/public_html/wp-content/themes/MobiTech2/functions.php on line 259

    Warning: preg_replace() [function.preg-replace]: No ending delimiter '�' found in /home/celtikli/public_html/wp-content/themes/MobiTech2/functions.php on line 259

    Warning: preg_replace() [function.preg-replace]: No ending delimiter '�' found in /home/celtikli/public_html/wp-content/themes/MobiTech2/functions.php on line 259

    Warning: preg_replace() [function.preg-replace]: No ending delimiter '�' found in /home/celtikli/public_html/wp-content/themes/MobiTech2/functions.php on line 259

    Warning: preg_replace() [function.preg-replace]: No ending delimiter '�' found in /home/celtikli/public_html/wp-content/themes/MobiTech2/functions.php on line 259

    Warning: preg_replace() [function.preg-replace]: No ending delimiter '�' found in /home/celtikli/public_html/wp-content/themes/MobiTech2/functions.php on line 259

    Warning: preg_replace() [function.preg-replace]: No ending delimiter '�' found in /home/celtikli/public_html/wp-content/themes/MobiTech2/functions.php on line 259

    Warning: preg_replace() [function.preg-replace]: No ending delimiter '�' found in /home/celtikli/public_html/wp-content/themes/MobiTech2/functions.php on line 259

    Warning: preg_replace() [function.preg-replace]: No ending delimiter '�' found in /home/celtikli/public_html/wp-content/themes/MobiTech2/functions.php on line 259
    5151