• Resolved superpuru

    (@superpuru)


    We are using free version of download Monitor. Our preferred outlook for download links has been “filename” -template which has shown a small icon of the filetype in front of the link, e.g. a pdf-logo. After version 4.9.3 the icon isn’t there anymore. Also the template code has changed quite a bit, and if I understand correctly it is using hooks now to enable features before and after a download link.

    How do I construct a function which adds a filetype icon as it used to be in 4.9.3 and before? An example?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Razvan Aldea

    (@raldea89)

    Hello @superpuru,

    Seems to be a bug from our part. We’ll address this is our next update, until then please use the following snippet:

    add_filter( 'dlm_template_attributes', 'superpuru_filetype', 30, 3 ); 
    
    function superpuru_filetype( $attributes, $download, $template ) {  
    if ( 'filename' === $template ) {   $attributes['link_attributes']['class'][] = 'filetype-icon filetype-' . esc_html( $download->get_version()->get_filetype() ); 
     }   
    return $attributes; 
    }

    Please let me know if the problem is solved in your case.

    Warmly,
    Razvan

    • This reply was modified 9 months, 2 weeks ago by Razvan Aldea. Reason: redo code
    • This reply was modified 9 months, 2 weeks ago by Razvan Aldea. Reason: redo code
    Thread Starter superpuru

    (@superpuru)

    Thanks for the reply. Yes, that fixes it!

    • This reply was modified 9 months, 2 weeks ago by superpuru.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Since 4.9.3 filename template not showing icon’ is closed to new replies.