ข้ามไปที่เนื้อหาหลัก
  วันพุธที่ 12 เมษายน 2017
  2 ตอบกลับ
  การเข้าชม 2.1K
  ติดตาม
ต้องการมีตัวเลือกในการเพิ่มนามแฝงหรือฟิลด์ชื่อแสดงในรหัสย่อ ตัวอย่างเช่น [wpfd_single_file id = "111" name = "ดาวน์โหลดตอนนี้"] แทนที่จะแสดงชื่อไฟล์

นอกจากนี้ยังต้องการให้ลิงก์ดูตัวอย่างปรากฏบนไฟล์เดี่ยว WPFD ฉันแฮ็คปลั๊กอินเพื่อทำสิ่งนี้แล้ว แต่จะทำให้ชีวิตของฉัน 1000x ง่ายขึ้นถ้าฟังก์ชั่นนี้อยู่นอกกรอบและฉันไม่จำเป็นต้องแก้ไขรหัสหลังจากการอัปเดตแต่ละครั้ง

ขอบคุณ!
NS
8 ปีที่แล้ว
FYI My Hack for Preview Link (pre-4.0):

หลังจากลิงค์ดาวน์โหลดใน tplsingle.php ฉันแทรกรหัสต่อไปนี้:


        <?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; ?>


จากนั้นใน Theme.php เพิ่มบรรทัดต่อไปนี้ภายใต้รายการฟังก์ชัน 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()));
NS
8 ปีที่แล้ว
สวัสดี

ดูดีและขอบคุณสำหรับการแบ่งปัน นี่คือสิ่งที่ฉันสามารถเพิ่มลงในรายการคุณสมบัติปลั๊กอินได้อย่าง:)

แน่นอน
  • หน้าหนังสือ :
  • 1
ยังไม่มีการตอบกลับสำหรับโพสต์นี้