bp_attachments_pre_cover_image_ajax_upload

Filters whether or not to handle cover image uploading.

Description

apply_filters( 'bp_attachments_pre_cover_image_ajax_upload', (array) $array, (array) $bp_params, (array) $needs_reset, (array) $object_data ); 

If you want to override this function, make sure you return an array with the result key set.

Parameters (4)

0. $array (array) => array()
The array.
1. $bp_params (array)
The bp params.
2. $needs_reset (array)
Stores original value of certain globals we need to revert to later.
3. $object_data (array)
The object data.

Usage

To run the hook, copy the example below.
  1. $array = apply_filters( 'bp_attachments_pre_cover_image_ajax_upload', $array, $bp_params, $needs_reset, $object_data ); 
  2.  
  3. if ( !empty( $array ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the bp_attachments_pre_cover_image_ajax_upload callback 
  2. function filter_bp_attachments_pre_cover_image_ajax_upload( $array, $bp_params, $needs_reset, $object_data ) { 
  3. // make filter magic happen here... 
  4. return $array
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'bp_attachments_pre_cover_image_ajax_upload', 'filter_bp_attachments_pre_cover_image_ajax_upload', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'bp_attachments_pre_cover_image_ajax_upload', 'filter_bp_attachments_pre_cover_image_ajax_upload', 10, 4 ); 

Defined (1)

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

/bp-core/bp-core-attachments.php  
  1. $pre_filter = apply_filters( 'bp_attachments_pre_cover_image_ajax_upload', array(), $bp_params, $needs_reset, $object_data );