112 lines
3.7 KiB
PHP
112 lines
3.7 KiB
PHP
<?php
|
|
|
|
namespace RomhackPlaza\Theme\Customizer;
|
|
use RomhackPlaza\Theme\Customizer;
|
|
|
|
defined( '\ABSPATH' ) || exit;
|
|
|
|
class Extends_Website extends Abstract_Section {
|
|
|
|
/**
|
|
* All settings are from Treville base.
|
|
* @param $wp_customize
|
|
* @return void
|
|
*/
|
|
public function section( $wp_customize ): void {
|
|
|
|
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
|
|
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
|
|
|
|
$wp_customize->selective_refresh->add_partial(
|
|
'blogname',
|
|
array(
|
|
'selector' => '.site-title a',
|
|
'render_callback' => fn() => bloginfo( 'name' ),
|
|
)
|
|
);
|
|
|
|
$wp_customize->selective_refresh->add_partial(
|
|
'blogdescription',
|
|
array(
|
|
'selector' => '.site-description',
|
|
'render_callback' => fn() => bloginfo( 'description' ),
|
|
)
|
|
);
|
|
|
|
$wp_customize->add_control(
|
|
new Control\Header(
|
|
$wp_customize,
|
|
'romhackplaza_theme_options[retina_logo_title]',
|
|
array(
|
|
'label' => esc_html__( 'Retina Logo', 'romhackplaza' ),
|
|
'section' => 'title_tagline',
|
|
'settings' => array(),
|
|
'priority' => 8,
|
|
)
|
|
)
|
|
);
|
|
|
|
$wp_customize->add_setting(
|
|
'romhackplaza_theme_options[retina_logo]',
|
|
array(
|
|
'default' => false,
|
|
'type' => 'option',
|
|
'transport' => 'refresh',
|
|
'sanitize_callback' => [Customizer::class, 'sanitize_checkbox'],
|
|
)
|
|
);
|
|
|
|
$wp_customize->add_control(
|
|
'romhackplaza_theme_options[retina_logo]',
|
|
array(
|
|
'label' => esc_html__( 'Scale down logo image for retina displays', 'romhackplaza' ),
|
|
'section' => 'title_tagline',
|
|
'settings' => 'romhackplaza_theme_options[retina_logo]',
|
|
'type' => 'checkbox',
|
|
'priority' => 9,
|
|
)
|
|
);
|
|
|
|
$wp_customize->add_setting(
|
|
'romhackplaza_theme_options[site_title]',
|
|
array(
|
|
'default' => true,
|
|
'type' => 'option',
|
|
'transport' => 'postMessage',
|
|
'sanitize_callback' => [ Customizer::class, 'sanitize_checkbox' ],
|
|
)
|
|
);
|
|
$wp_customize->add_control(
|
|
'romhackplaza_theme_options[site_title]',
|
|
array(
|
|
'label' => esc_html__( 'Display Site Title', 'romhackplaza' ),
|
|
'section' => 'title_tagline',
|
|
'settings' => 'romhackplaza_theme_options[site_title]',
|
|
'type' => 'checkbox',
|
|
'priority' => 10,
|
|
)
|
|
);
|
|
|
|
$wp_customize->add_setting(
|
|
'romhackplaza_theme_options[site_description]',
|
|
array(
|
|
'default' => true,
|
|
'type' => 'option',
|
|
'transport' => 'postMessage',
|
|
'sanitize_callback' => [ Customizer::class, 'sanitize_checkbox' ],
|
|
)
|
|
);
|
|
$wp_customize->add_control(
|
|
'romhackplaza_theme_options[site_description]',
|
|
array(
|
|
'label' => esc_html__( 'Display Tagline', 'romhackplaza' ),
|
|
'section' => 'title_tagline',
|
|
'settings' => 'romhackplaza_theme_options[site_description]',
|
|
'type' => 'checkbox',
|
|
'priority' => 11,
|
|
)
|
|
);
|
|
|
|
}
|
|
|
|
} |