Bỏ qua đến nội dung chính
  Thứ Tư, ngày 12 tháng 4 năm 2017
  2 Trả lời
  2,5 nghìn lượt truy cập
  Đặt mua
Tôi muốn có tùy chọn thêm tên bí danh hoặc tên hiển thị vào shortcode shortcode Ví dụ: [wpfd_single_file id="111" name="Download Now"] thay vì hiển thị tên tệp.

Ngoài ra, tôi muốn có liên kết xem trước xuất hiện trên các tệp đơn của wpfd. Tôi đã chỉnh sửa plugin để làm điều này, nhưng sẽ dễ dàng hơn rất nhiều nếu chức năng này được tích hợp sẵn và tôi không phải sửa đổi mã sau mỗi lần cập nhật.

Cảm ơn!
P
8 năm trước
Thông tin thêm: đây là bản hack của tôi để xem trước liên kết (trước phiên bản 4.0):

Sau khi liên kết tải xuống trong tplsingle.php, tôi đã chè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; ?>


Và sau đó trong theme.php thêm các dòng sau trong danh sách các tập lệnh của ShowFile () hàm:


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()));
T
8 năm trước
Chào,

Trông rất tốt và cảm ơn bạn đã chia sẻ. Đây là điều tôi chắc chắn có thể thêm vào danh sách tính năng của plugin:)

. Cảm ơn,
  • Trang :
  • 1
Không có câu trả lời nào được thực hiện cho bài đăng này.