bp_docs_doc_action_links

Outputs the links that appear under each Doc in the Doc listing.

Description

bp_docs_doc_action_links(); 

Usage

  1. if ( !function_exists( 'bp_docs_doc_action_links' ) ) { 
  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_action_links(); 
  7.  

Defined (1)

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

/includes/templatetags.php  
  1. function bp_docs_doc_action_links() { 
  2. $links = array(); 
  3.  
  4. $links[] = '<a href="' . bp_docs_get_doc_link() . '">' . __( 'Read', 'bp-docs' ) . '</a>'; 
  5.  
  6. if ( current_user_can( 'bp_docs_edit', get_the_ID() ) ) { 
  7. $links[] = '<a href="' . bp_docs_get_doc_edit_link() . '">' . __( 'Edit', 'bp-docs' ) . '</a>'; 
  8.  
  9. if ( current_user_can( 'bp_docs_view_history', get_the_ID() ) && defined( 'WP_POST_REVISIONS' ) && WP_POST_REVISIONS ) { 
  10. $links[] = '<a href="' . bp_docs_get_doc_link() . BP_DOCS_HISTORY_SLUG . '">' . __( 'History', 'bp-docs' ) . '</a>'; 
  11.  
  12. if ( current_user_can( 'manage', get_the_ID() ) && bp_docs_is_doc_trashed( get_the_ID() ) ) { 
  13. $links[] = '<a href="' . bp_docs_get_remove_from_trash_link( get_the_ID() ) . '" class="delete confirm">' . __( 'Untrash', 'bp-docs' ) . '</a>'; 
  14.  
  15. $links = apply_filters( 'bp_docs_doc_action_links', $links, get_the_ID() ); 
  16.  
  17. echo implode( ' | ', $links );