• 03-01-2018, 17:41:58
    #1
    Kimlik doğrulama veya yönetimden onay bekliyor.
    ...
  • 03-01-2018, 18:12:05
    #3
    ondadokuz910 adlı üyeden alıntı: mesajı görüntüle
    add_action( 'before_delete_post', 'yazi_ile_one_cikan_gorseli_sil', 10 );
    function yazi_ile_one_cikan_gorseli_sil($post_id)
    {
            if(has_post_thumbnail( $post_id ))
            {
              $attachment_id = get_post_thumbnail_id( $post_id );
              wp_delete_attachment($attachment_id, true);
            }
    }
    bunu fonk php ye attım. fakat yazıyı silince öne çıkan görsel ortam dosyalarında hala duruyor. kodda eksik bişeyler mi var acaba
    If you're using this hook note that it will not fire if the user is deleting an Attachment, since attachments are force deleted, i.e., not sent to the Trash. Instead use the delete_post() hook.
    Wp Codex te sorunuzun cevabı var.
  • 03-01-2018, 18:17:45
    #4
    ondadokuz910 adlı üyeden alıntı: mesajı görüntüle
    add_action( 'before_delete_post', 'yazi_ile_one_cikan_gorseli_sil', 10 );function yazi_ile_one_cikan_gorseli_sil($post_id){        if(has_post_thumbnail( $post_id ))        {          $attachment_id = get_post_thumbnail_id( $post_id );          wp_delete_attachment($attachment_id, true);        }}
    bunu fonk php ye attım. fakat yazıyı silince öne çıkan görsel ortam dosyalarında hala duruyor. kodda eksik bişeyler mi var acaba
    Az önce test ettim sorunsuz çalıştı.
    Kodu wp-includes/functions.php dosyasına ekleyin.
    Ortam dosyasının silinmesi için yazıyı çöpe taşımanız yetmez, kalıcı olarak silmeniz lazım.