bp_docs_doc_settings_markup

A hook for intergration pieces to insert their settings markup.

Description

bp_docs_doc_settings_markup( (int) $doc_id = 0, (int) $group_id = 0 ); 

Parameters (2)

0. $doc_id — Optional. (int)
The doc id.
1. $group_id — Optional. (int)
The group id.

Usage

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

Defined (1)

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

/includes/templatetags.php  
  1. function bp_docs_doc_settings_markup( $doc_id = 0, $group_id = 0 ) { 
  2. global $bp; 
  3.  
  4. if ( ! $doc_id ) { 
  5. $doc_id = is_singular() ? get_the_ID() : 0; 
  6.  
  7. $doc_settings = bp_docs_get_doc_settings( $doc_id, 'default', $group_id ); 
  8.  
  9. $settings_fields = array( 
  10. 'read' => array( 
  11. 'name' => 'read',  
  12. 'label' => __( 'Who can read this doc?', 'bp-docs' ) 
  13. ),  
  14. 'edit' => array( 
  15. 'name' => 'edit',  
  16. 'label' => __( 'Who can edit this doc?', 'bp-docs' ) 
  17. ),  
  18. 'read_comments' => array( 
  19. 'name' => 'read_comments',  
  20. 'label' => __( 'Who can read comments on this doc?', 'bp-docs' ) 
  21. ),  
  22. 'post_comments' => array( 
  23. 'name' => 'post_comments',  
  24. 'label' => __( 'Who can post comments on this doc?', 'bp-docs' ) 
  25. ),  
  26. 'view_history' => array( 
  27. 'name' => 'view_history',  
  28. 'label' => __( 'Who can view the history of this doc?', 'bp-docs' ) 
  29. ); 
  30.  
  31. foreach ( $settings_fields as $settings_field ) { 
  32. bp_docs_access_options_helper( $settings_field, $doc_id, $group_id ); 
  33.  
  34. // Hand off the creation of additional settings to individual integration pieces 
  35. do_action( 'bp_docs_doc_settings_markup', $doc_settings );