Plugin Directory

Changeset 2020056


Ignore:
Timestamp:
01/27/2019 10:15:16 PM (7 years ago)
Author:
avneetk
Message:

Fixed file icon.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • file-download/trunk/download-widget.php

    r2020045 r2020056  
    3333     */
    3434    public function widget( $args, $instance ) {
    35         $firstPart = strtok( $instance['the_file'], '.' );
    36         $allTheRest = strtok( '' );
    37         if($allTheRest == 'docx' || $allTheRest == 'doc'){
     35        $type = @end(explode('.', $instance['the_file']));
     36        if($type == 'docx' || $type == 'doc'){
    3837            $icon_src = plugins_url('docx-file-icon.svg', __FILE__);
    39         }else if ($allTheRest == 'pdf'){
     38        }else if ($type == 'pdf'){
    4039            $icon_src = plugins_url('pdf-file-icon.svg', __FILE__);
    4140        }else{
Note: See TracChangeset for help on using the changeset viewer.