bp_docs_current_user_can_create_in_context

Can the current user create a Doc in this context?.

Description

bp_docs_current_user_can_create_in_context(); 

Is sensitive to group contexts (and the associated with permissions levels)


Usage

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

Defined (1)

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

/includes/functions.php  
  1. function bp_docs_current_user_can_create_in_context() { 
  2. if ( function_exists( 'bp_is_group' ) && bp_is_group() ) { 
  3. $can_create = current_user_can( 'bp_docs_associate_with_group', bp_get_current_group_id() ); 
  4. } else { 
  5. $can_create = current_user_can( 'bp_docs_create' ); 
  6.  
  7. return apply_filters( 'bp_docs_current_user_can_create_in_context', $can_create );