<obj_name>_data_<field>_before_save

The BuddyPress Moderation obj name data field before save hook.

Description

apply_filters( '<obj_name>_data_<field>_before_save', (unknown) $value, (unknown) $this___id ); 

Parameters (2)

0. $value (unknown)
The value.
1. $this___id (unknown)
The this id.

Usage

To run the hook, copy the example below.
  1. $value = apply_filters( '{$obj_name}_data_{$field}_before_save', $value, $this___id ); 
  2.  
  3. if ( !empty( $value ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the <obj_name>_data_<field>_before_save callback 
  2. function filter_obj_name_data_field_before_save( $value, $this___id ) { 
  3. // make filter magic happen here... 
  4. return $value
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( "{$obj_name}_data_{$field}_before_save", 'filter_obj_name_data_field_before_save', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( "{$obj_name}_data_{$field}_before_save", 'filter_obj_name_data_field_before_save', 10, 2 ); 

Defined (1)

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

/classes/bpModAbstractDBobj.php  
  1. $this->__data[$field] = apply_filters($this->__obj_name . '_data_' . $field . '_before_save', $value, $this->__id);