cmb_override_option_get_<option_key>

Retrieve option value based on name of option.

Description

apply_filters( 'cmb_override_option_get_<option_key>', (string) $cmb_no_override_option_get, (mixed) $default ); 

Parameters (2)

0. $cmb_no_override_option_get (string) => 'cmb_no_override_option_get'
Name of option to retrieve. Expected to not be SQL-escaped.
1. $default — Optional. (mixed)
Default value to return if the option does not exist.

Usage

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

Defined (1)

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

/admin/includes/CMBF/init.php  
  1. $test_get = apply_filters( "cmb_override_option_get_$option_key", 'cmb_no_override_option_get', $default );