digitaliway - Tôi đã hack plugin để hiển thị liên kết xem trước.
Sau khi liên kết tải xuống trong tplsingle.php, tôi đã chèn đoạn mã sau:
<?php if ($this->file->remote_url == false): ?>
<a href="/<?php echo $this->file->viewerlink ?>" class="openlink wpfdlightbox wpfd_previewlink" data-id="<?php echo $this->file->ID; ?>" data-catid="<?php echo $this->file->catid; ?>" data-file-type="<?php echo $this->file->ext; ?>" >
<img src="http://yoursite.com/wp-content/plugins/wp-file-download/app/site/assets/images/theme/preview.png"></a>
<?php endif; ?>
Rõ ràng là bạn sẽ cần tải lên một biểu tượng dưới dạng preview.png để nó hiển thị hình ảnh nút xem trước.
Và sau đó trong theme .php, hãy thêm các dòng sau vào danh sách các tập lệnh của hàm showFile ():
wp_enqueue_style('wpfd-colorbox', plugins_url( 'app/site/assets/css/colorbox.css' , WPFD_PLUGIN_FILE ),array(),WPFD_VERSION);
wp_enqueue_style('wpfd-viewer', plugins_url( 'app/site/assets/css/viewer.css' , WPFD_PLUGIN_FILE ),array(),WPFD_VERSION);
wp_enqueue_script('wpfd-colorboxjs', plugins_url( 'app/site/assets/js/jquery.colorbox-min.js' , WPFD_PLUGIN_FILE ),array(),WPFD_VERSION);
wp_enqueue_script('wpfd-colorbox-init', plugins_url( 'app/site/assets/js/colorbox.init.js' , WPFD_PLUGIN_FILE ),array(),WPFD_VERSION);
wp_localize_script('wpfd-colorbox-init','wpfdcolorbox',array('ajaxurl' => Application::getInstance('wpfd')->getAjaxUrl()));
FYI đây là phiên bản cuối cùng trước 4.0 vì vậy nếu bạn đã cập nhật, tôi không chắc liệu điều này có hoạt động hay không. Tôi chưa cập nhật vì phiên bản mới đã phá vỡ trang web của chúng tôi.