cf_custom_fields_pre_save_meta_key_metabox

Filter value before saving using to metabox processor.

Description

apply_filters( 'cf_custom_fields_pre_save_meta_key_metabox', (mixed) $value, (string) $slug, (int) $post_id ); 

Parameters (3)

0. $value (mixed)
The value to be saved
1. $slug (string)
Slug of field
2. $post_id (int)
The post id.

Usage

To run the hook, copy the example below.
  1. $value = apply_filters( 'cf_custom_fields_pre_save_meta_key_metabox', $value, $slug, $post_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 cf_custom_fields_pre_save_meta_key_metabox callback 
  2. function filter_cf_custom_fields_pre_save_meta_key_metabox( $value, $slug, $post_id ) { 
  3. // make filter magic happen here... 
  4. return $value
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'cf_custom_fields_pre_save_meta_key_metabox', 'filter_cf_custom_fields_pre_save_meta_key_metabox', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'cf_custom_fields_pre_save_meta_key_metabox', 'filter_cf_custom_fields_pre_save_meta_key_metabox', 10, 3 ); 

Defined (2)

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

/includes/metabox.php  
  1. $value = apply_filters( 'cf_custom_fields_pre_save_meta_key_metabox', $value, $slug, $post->ID ); 
  1. $value = apply_filters( 'cf_custom_fields_pre_save_meta_key_metabox', $value, $slug, $post->ID );