pressbooks aldine theme the theme used for the front page or default book
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.7 KiB

7 years ago
<?php
namespace Aldine;
7 years ago
/**
* Theme customizer
*/
add_action('customize_register', function (\WP_Customize_Manager $wp_customize) {
// Add postMessage support
$wp_customize->get_setting('blogname')->transport = 'postMessage';
$wp_customize->selective_refresh->add_partial('blogname', [
'selector' => '.brand',
'render_callback' => function () {
bloginfo('name');
}
]);
$wp_customize->add_section('pb_network_social', [
'title' => __('Social Media', 'aldine'),
'priority' => 30,
]);
$wp_customize->add_setting('pb_network_facebook', [
'type' => 'option',
'transport' => 'postMessage'
]);
$wp_customize->add_control('pb_network_facebook', [
'label' => __('Facebook URL','aldine'),
'section' => 'pb_network_social',
'settings' => 'pb_network_facebook',
]);
$wp_customize->add_setting('pb_network_linkedin', [
'type' => 'option',
'transport' => 'postMessage'
]);
$wp_customize->add_control('pb_network_linkedin', [
'label' => __('LinkedIn URL','aldine'),
'section' => 'pb_network_social',
'settings' => 'pb_network_linkedin',
]);
$wp_customize->add_setting('pb_network_twitter', [
'type' => 'option',
'transport' => 'postMessage'
]);
$wp_customize->add_control('pb_network_twitter', [
'label' => __('Twitter URL','aldine'),
'section' => 'pb_network_social',
'settings' => 'pb_network_twitter',
]);
7 years ago
});
/**
* Customizer JS
*/
add_action('customize_preview_init', function () {
wp_enqueue_script('aldine/customizer.js', asset_path('scripts/customizer.js'), ['customize-preview'], null, true);
7 years ago
});