Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Denis Yanchevskiy

    (@denisco)

    Hello @jparra-1,
    I’m sorry to be late with the reply.

    Try this snippet

    function dco_ca_get_attachment_preview_with_download( $attachment_content, $attachment_id, $embed_type ) {
    	if( 'misc' === $embed_type ) {
    		return str_replace( '<a href', '<a download href', $attachment_content );
    	}
    }
    
    add_filter( 'dco_ca_get_attachment_preview', 'dco_ca_get_attachment_preview_with_download', 10, 3 );
    Plugin Author Denis Yanchevskiy

    (@denisco)

    Since version 2.3.0 you can use this snippet:
    add_filter( 'dco_ca_force_download_misc_attachments', '__return_true' );

    Plugin Author Denis Yanchevskiy

    (@denisco)

    Marking as resolved. Feel free to reopen this topic, or create a new one if you have another questions.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Download instead of open’ is closed to new replies.