bsk_pdfm_filter_pdf_list_item
Use this filter to change the title / link / date / description / featured image / html structure of a PDF item when it shown in UL or OL. You may use PDF id to make it only applied for specific PDF item. Default category title structure is as the following:
<li class="bsk-pdfm-list-item" data-date="2017-06-10-Sat" date-id="9"> <a href="http://localhost/wordpress-496-empty/wp-content/uploads/bsk-pdf-manager/2018/06/1445_macleay_courseguides_accounting-10.pdf" title="1445_macleay_courseguides_accounting 10" class="bsk-pdf-manager-pdf-link pdf-id-9">1445_macleay_courseguides_accounting 10</a> </li>
Or with featured image & description
<li class="bsk-pdfm-list-item" data-date="2017-06-10-Sat" date-id="9"> <a href="http://localhost/wordpress-496-empty/wp-content/uploads/bsk-pdf-manager/2018/06/1445_macleay_courseguides_accounting-10.pdf" title="1445_macleay_courseguides_accounting 10" class="bsk-pdfm-pdf-link-for-featured-image pdf-id-9"> <img width="300" height="200" src="http://localhost/wordpress-496-empty/wp-content/uploads/2018/06/IMG_2238-300x200.jpg" class="attachment-medium size-medium" alt="" srcset="http://localhost/wordpress-496-empty/wp-content/uploads/2018/06/IMG_2238-300x200.jpg 300w, http://localhost/wordpress-496-empty/wp-content/uploads/2018/06/IMG_2238-768x512.jpg 768w, http://localhost/wordpress-496-empty/wp-content/uploads/2018/06/IMG_2238-1024x683.jpg 1024w" sizes="100vw" /> </a> <a href="http://localhost/wordpress-496-empty/wp-content/uploads/bsk-pdf-manager/2018/06/1445_macleay_courseguides_accounting-10.pdf" title="1445_macleay_courseguides_accounting 10" class="bsk-pdfm-pdf-link-for-title pdf-id-9">1445_macleay_courseguides_accounting 10</a> <p class="bsk-pdf-manger-pdf-description">Here is the description of the PDF. When search bar enabled, it will also query keywords from this field.</p> </li>
Example
/** * Change the structure of PDF item in category list * @var String $pdf_default_structure The default PDF item html structure * @var Integer $pdf_id The PDF item id * @var String $pdf_title The PDF item title * @var String $pdf_url The URL link to the PDF * @var String $thumbnail_html The featured image of the PDF item * @var String $pdf_date The date of the PDF item * @var String $pdf_description The description of the PDF item * @var Object $category_obj The category object of the PDF item belongs to, only available in display by category or display with selector mode * @return String new PDF item structure */ add_filter( "bsk_pdfm_filter_pdf_list_item", "change_list_item_structure", 10, 8 ); function change_list_item_structure( $pdf_default_structure, $pdf_id, $pdf_title, $pdf_url, $thumbnail_html, $pdf_date, $pdf_description, $category_obj ) { $category_str = ''; if( $category_obj && is_object($category_obj) ){ $category_str .= '<p>'.$category_obj->title.'</p>'; $category_str .= '<p>'.$category_obj->description.'</p>'; } if( $pdf_id == 9 ){ $new_pdf_structure = ' <li class="bsk-pdfm-list-item" data-date="2017-06-10-Sat" date-id="9"> <a href="https://wordpress.org/plugins/bsk-pdf-manager/"><h2>'.$pdf_title.'</h2></a> <p>'.$pdf_description.'</p>'.$category_str.' </li>'; return $new_pdf_structure; } return $pdf_default_structure; }