Tribe__Customizer__Section::filter_settings( array $settings, array $search )
Hooks to the tribe_customizer_pre_get_option. This applies the $this->create_ghost_settings() method to the settings on the correct section.
Contents
Parameters
- $settings
-
(array) (Required) Values from the Database from Customizer actions.
- $search
-
(array) (Required) Indexed search @see Tribe__Customizer::search_var().
Return
(array)
Source
File: src/Tribe/Customizer/Section.php
public function filter_settings( $settings, $search ) {
// Exit early.
if ( null === $search ) {
return $settings;
}
// Only Apply if getting the full options or Section
if ( is_array( $search ) && count( $search ) > 1 ) {
return $settings;
}
if ( is_array( $search ) && count( $search ) === 1 ) {
$settings = $this->create_ghost_settings( $settings );
} else {
$settings[ $this->ID ] = $this->create_ghost_settings( $settings[ $this->ID ] );
}
return $settings;
}