Astra_Theme_Extension::customize_register_before_theme( object $wp_customize )
Base on addon activation section registered.
Description
Parameters
- $wp_customize
-
(object) (Required) customizer object.
Return
(void)
Source
File: classes/class-astra-theme-extension.php
public function customize_register_before_theme( $wp_customize ) {
if ( ! defined( 'ASTRA_THEME_VERSION' ) ) {
return;
}
if ( ! class_exists( 'Astra_WP_Customize_Section' ) ) {
wp_die( 'You are using an older version of the Astra theme. Please update the Astra theme to the latest version.' );
}
$addons = Astra_Ext_Extension::get_enabled_addons();
// Update the Customizer Sections under Layout.
if ( false != $addons['header-sections'] ) {
$wp_customize->add_section(
new Astra_WP_Customize_Section(
$wp_customize,
'section-mobile-primary-header-layout',
array(
'title' => __( 'Primary Header', 'astra-addon' ),
'section' => 'section-mobile-header',
'priority' => 10,
)
)
);
}
// Update the Customizer Sections under Typography.
if ( false != $addons['typography'] ) {
$wp_customize->add_section(
new Astra_WP_Customize_Section(
$wp_customize,
'section-header-typo-group',
array(
'title' => __( 'Header', 'astra-addon' ),
'panel' => 'panel-typography',
'priority' => 20,
)
)
);
add_filter(
'astra_customizer_primary_header_typo',
function( $header_arr ) {
$header_arr['section'] = 'section-header-typo-group';
return $header_arr;
}
);
}
}
Expand full source code Collapse full source code View on Trac
Changelog
| Version | Description |
|---|---|
| 1.0.0 | Introduced. |