Reply To: Viewing Attachment rather than downloading attachment


Home Forums Front End PM PRO Viewing Attachment rather than downloading attachment Reply To: Viewing Attachment rather than downloading attachment

#18877
shamim
Keymaster

Add following code in your theme’s (child theme’s if you are using) functions.php

add_filter( 'fep_filter_attachment_download_link', function( $link, $att_id ){
    $attachment = FEP_Attachments::init()->get( fep_get_the_id(), $att_id );
    $name = basename( $attachment->att_file );
    $link = '<a href="' . fep_query_url( 'view-download', array( 'fep_id' => $attachment->att_id, 'fep_parent_id' => $attachment->mgs_id ) ) . '" title="' . sprintf( __( 'View %s', 'front-end-pm' ), esc_attr( $name ) ) . '">' . esc_html( $name ) . '</a>';

    return $link;
}, 10, 2);