bp_docs_display_folder_meta

Show Folder info on a single Doc.

Description

bp_docs_display_folder_meta(); 

Usage

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

Defined (1)

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

/includes/addon-folders.php  
  1. function bp_docs_display_folder_meta() { 
  2. $doc_id = get_the_ID(); 
  3. $folder_id = bp_docs_get_doc_folder( $doc_id ); 
  4.  
  5. if ( ! $folder_id ) { 
  6. return; 
  7.  
  8. $folder = get_post( $folder_id ); 
  9.  
  10. if ( ! is_a( $folder, 'WP_Post' ) || 'bp_docs_folder' !== $folder->post_type ) { 
  11. return; 
  12.  
  13. echo sprintf( 
  14. '<p class="folder-meta" data-folder-id="%d">%s<a href="%s">%s</a>',  
  15. esc_attr( $folder_id ),  
  16. bp_docs_get_genericon( 'category', $folder_id ),  
  17. esc_url( bp_docs_get_folder_url( $folder_id ) ),  
  18. esc_attr( $folder->post_title ) 
  19. );