cf_custom_fields_pre_save_meta_key_to_post_type

Filter value before saving using to post type processor.

Description

apply_filters( 'cf_custom_fields_pre_save_meta_key_to_post_type', (mixed) $value, (string) $slug, (int) $entry_id ); 

Parameters (3)

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

Usage

To run the hook, copy the example below.
  1. $value = apply_filters( 'cf_custom_fields_pre_save_meta_key_to_post_type', $value, $slug, $entry_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_to_post_type callback 
  2. function filter_cf_custom_fields_pre_save_meta_key_to_post_type( $value, $slug, $entry_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_to_post_type', 'filter_cf_custom_fields_pre_save_meta_key_to_post_type', 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_to_post_type', 'filter_cf_custom_fields_pre_save_meta_key_to_post_type', 10, 3 ); 

Defined (2)

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

/includes/to-post-type.php  
  1. $value = apply_filters( 'cf_custom_fields_pre_save_meta_key_to_post_type', $value, $slug, $entry_id ); 
  1. $value = apply_filters( 'cf_custom_fields_pre_save_meta_key_to_post_type', $value, $slug, $entry_id );