Custom Fields
Re-Envisioned
Support MB Custom Post Type How to force_delete files in custom uploads folder?

This topic contains 1 reply, has 2 voices, and was last updated by  Anh Tran 1 month, 1 week ago.

  • Creator
    Topic
  • #15367

    webdev
    Participant

    It’s a bit of an edge case.

    Specifically, with these settings for a custom post type:

                'type'             => 'file',
                'force_delete'     => true,
                'upload_dir' => WP_CONTENT_DIR . '/resources/',
    

    File deletes as expected when deleted from CPT edit screen, but if the containing post is binned and the bin emptied, the uploaded file remains. I can write a hook if you could suggest the best action/filter, but was wondering if there are any other parameters that can be passed to ensure the file is deleted?
    Thanks

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.