theme_mod_<id_base>
The WordPress Core theme mod id base hook.
Description
Parameters (1)
- 0. $array (callback) =>
array( $this, '_preview_filter' )
- The array.
Usage
- To run the hook, copy the example below.
- $array = apply_filters( 'theme_mod_{$id_base}', $array );
- if ( !empty( $array ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the theme_mod_<id_base> callback
- function filter_theme_mod_id_base( $array ) {
- // make filter magic happen here...
- return $array;
- };
- // add the filter
- add_filter( "theme_mod_{$id_base}", 'filter_theme_mod_id_base', 10, 1 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( "theme_mod_{$id_base}", 'filter_theme_mod_id_base', 10, 1 );
Defined (2)
The filter is defined in the following location(s).
- /wp-includes/class-wp-customize-setting.php
- add_filter( "theme_mod_{$id_base}", array( $this, '_preview_filter' ) );
- add_filter( "theme_mod_{$id_base}", $multidimensional_filter );