bp_docs_doc_has_attachments

Does this doc have attachments?.

Description

bp_docs_doc_has_attachments( (null) $doc_id = null ); 

Parameters (1)

0. $doc_id — Optional. (null) => null
The doc id.

Usage

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

Defined (1)

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

/includes/templatetags.php  
  1. function bp_docs_doc_has_attachments( $doc_id = null ) { 
  2. if ( is_null( $doc_id ) ) { 
  3. $doc_id = get_the_ID(); 
  4.  
  5. $atts = bp_docs_get_doc_attachments( $doc_id ); 
  6.  
  7. return ! empty( $atts );