bp_docs_ajax_value_inputs

Output data for JS access on directories.

Description

bp_docs_ajax_value_inputs(); 

Usage

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

Defined (1)

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

/includes/templatetags.php  
  1. function bp_docs_ajax_value_inputs() { 
  2. // Store the group ID in a hidden input. 
  3. if ( bp_docs_is_group_docs() ) { 
  4. $group_id = bp_get_current_group_id(); 
  5. } else { 
  6. // Having the value always set makes JS easier. 
  7. $group_id = 0; 
  8. ?> 
  9. <input type="hidden" id="directory-group-id" value="<?php echo $group_id; ?>"> 
  10. <?php 
  11. // Store the user ID in a hidden input. 
  12. $user_id = bp_displayed_user_id(); 
  13. ?> 
  14. <input type="hidden" id="directory-user-id" value="<?php echo $user_id; ?>"> 
  15. <?php 
  16. // Allow other plugins to add inputs. 
  17. do_action( 'bp_docs_ajax_value_inputs', $group_id, $user_id );