Tribe__Customizer__Section::__construct()
Setup and Load hooks for this Section.
Return
Source
File: src/Tribe/Customizer/Section.php
final public function __construct() {
$slug = self::get_section_slug( get_class( $this ) );
// If for weird reason we don't have the Section name
if ( ! is_string( $this->ID ) ){
$this->ID = $slug;
}
// Allow child classes to setup the section
$this->setup();
// Hook the Register methods
add_action( "tribe_customizer_register_{$this->ID}_settings", array( $this, 'register_settings' ), 10, 2 );
add_filter( 'tribe_customizer_pre_sections', array( $this, 'register' ), 10, 2 );
// Append this section CSS template
add_filter( 'tribe_customizer_css_template', array( $this, 'get_css_template' ), 15 );
add_filter( "tribe_customizer_section_{$this->ID}_defaults", array( $this, 'get_defaults' ), 10 );
// Create the Ghost Options
add_filter( 'tribe_customizer_pre_get_option', array( $this, 'filter_settings' ), 10, 2 );
// By Default Invoking a new Section will load, unless `load` is set to false
if ( true === (bool) $this->load ) {
Tribe__Customizer::instance()->load_section( $this );
}
}
Changelog
| Version | Description |
|---|---|
| 4.0 | Introduced. |