get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
}
add_action( 'customize_register', 'bookinspiration_customize_register' );
/**
* Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
*
* Since bookinspiration v1.6
*
*/
function bookinspiration_customize_preview_js() {
wp_enqueue_script( 'bookinspiration_customizer', get_template_directory_uri() . '/javascripts/customizer.js', array( 'customize-preview' ), '20130916', true );
}
add_action( 'customize_preview_init', 'bookinspiration_customize_preview_js' );
/**
* bookinspiration TextArea Control Class
*
* Since bookinspiration v0.5
**/
if ( class_exists( 'WP_Customize_Control' ) ) {
# Adds textarea support to the theme customizer
class bookinspirationTextAreaControl extends WP_Customize_Control {
public $type = 'textarea'; # can change to 'number' for input[type=number] field
public function __construct( $manager, $id, $args = array() ) {
$this->statuses = array( '' => __( 'Default', 'bookinspiration' ) );
parent::__construct( $manager, $id, $args );
}
public function render_content() {
echo '';
}
}
}
/**
* bookinspiration Category Drop Down List Class
*
* modified dropdown-pages from wp-includes/class-wp-customize-control.php
*
* @since bookinspiration v1.0
*/
if ( class_exists( 'WP_Customize_Control' ) ) {
class WP_Customize_Dropdown_Categories_Control extends WP_Customize_Control {
public $type = 'dropdown-categories';
public function render_content() {
$dropdown = wp_dropdown_categories(
array(
'name' => '_customize-dropdown-categories-' . $this->id,
'echo' => 0,
'hide_empty' => false,
'show_option_none' => '— ' . __('Select', 'reactor') . ' —',
'hide_if_empty' => false,
'selected' => $this->value(),
)
);
$dropdown = str_replace('