bp_docs_doc_attachment_drawer

Builds the markup for the attachment drawer in directories.

Description

bp_docs_doc_attachment_drawer(); 

Usage

  1. if ( !function_exists( 'bp_docs_doc_attachment_drawer' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress-docs/includes/templatetags.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_docs_doc_attachment_drawer(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/templatetags.php  
  1. function bp_docs_doc_attachment_drawer() { 
  2. $atts = bp_docs_get_doc_attachments( get_the_ID() ); 
  3. $html = ''; 
  4.  
  5. if ( ! empty( $atts ) ) { 
  6. $html .= '<ul>'; 
  7. $html .= '<h4>' . __( 'Attachments', 'bp-docs' ) . '</h4>'; 
  8.  
  9. foreach ( $atts as $att ) { 
  10. $html .= bp_docs_attachment_item_markup( $att->ID, 'simple' ); 
  11.  
  12. $html .= '</ul>'; 
  13.  
  14. echo $html;