|
|
@ -30,11 +30,27 @@ function customize_register( \WP_Customize_Manager $wp_customize ) { |
|
|
|
if ( isset( $wp_customize->selective_refresh ) ) { |
|
|
|
if ( isset( $wp_customize->selective_refresh ) ) { |
|
|
|
$wp_customize->selective_refresh->add_partial( 'blogname', [ |
|
|
|
$wp_customize->selective_refresh->add_partial( 'blogname', [ |
|
|
|
'selector' => '.site-title a', |
|
|
|
'selector' => '.site-title a', |
|
|
|
'render_callback' => __NAMESPACE__ . '\\customize_partial_blogname', |
|
|
|
'render_callback' => function() { |
|
|
|
|
|
|
|
bloginfo( 'name' ); |
|
|
|
|
|
|
|
}, |
|
|
|
] ); |
|
|
|
] ); |
|
|
|
$wp_customize->selective_refresh->add_partial( 'blogdescription', [ |
|
|
|
$wp_customize->selective_refresh->add_partial( 'blogdescription', [ |
|
|
|
'selector' => '.site-description', |
|
|
|
'selector' => '.site-description', |
|
|
|
'render_callback' => __NAMESPACE__ . '\\customize_partial_blogdescription', |
|
|
|
'render_callback' => function() { |
|
|
|
|
|
|
|
bloginfo( 'description' ); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
] ); |
|
|
|
|
|
|
|
$wp_customize->selective_refresh->add_partial( 'pb_front_page_catalog_title', [ |
|
|
|
|
|
|
|
'selector' => '#latest-books-title', |
|
|
|
|
|
|
|
'render_callback' => function() { |
|
|
|
|
|
|
|
get_option( 'pb_front_page_catalog_title' ); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
] ); |
|
|
|
|
|
|
|
$wp_customize->selective_refresh->add_partial( 'pb_network_contact_form_title', [ |
|
|
|
|
|
|
|
'selector' => '#contact .contact__title', |
|
|
|
|
|
|
|
'render_callback' => function() { |
|
|
|
|
|
|
|
get_option( 'pb_network_contact_form_title' ); |
|
|
|
|
|
|
|
}, |
|
|
|
] ); |
|
|
|
] ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -119,6 +135,7 @@ function customize_register( \WP_Customize_Manager $wp_customize ) { |
|
|
|
$wp_customize->add_setting('pb_front_page_catalog_title', [ |
|
|
|
$wp_customize->add_setting('pb_front_page_catalog_title', [ |
|
|
|
'type' => 'option', |
|
|
|
'type' => 'option', |
|
|
|
'sanitize_callback' => 'sanitize_text_field', |
|
|
|
'sanitize_callback' => 'sanitize_text_field', |
|
|
|
|
|
|
|
'default' => __( 'Our Latest Titles', 'pressbooks-aldine' ), |
|
|
|
]); |
|
|
|
]); |
|
|
|
$wp_customize->add_control('pb_front_page_catalog_title', [ |
|
|
|
$wp_customize->add_control('pb_front_page_catalog_title', [ |
|
|
|
'label' => __( 'Front Page Catalog Title', 'pressbooks-aldine' ), |
|
|
|
'label' => __( 'Front Page Catalog Title', 'pressbooks-aldine' ), |
|
|
@ -143,6 +160,7 @@ function customize_register( \WP_Customize_Manager $wp_customize ) { |
|
|
|
$wp_customize->add_setting('pb_network_contact_form_title', [ |
|
|
|
$wp_customize->add_setting('pb_network_contact_form_title', [ |
|
|
|
'type' => 'option', |
|
|
|
'type' => 'option', |
|
|
|
'sanitize_callback' => 'sanitize_text_field', |
|
|
|
'sanitize_callback' => 'sanitize_text_field', |
|
|
|
|
|
|
|
'default' => __( 'Contact Us', 'pressbooks-aldine' ), |
|
|
|
]); |
|
|
|
]); |
|
|
|
$wp_customize->add_control('pb_network_contact_form_title', [ |
|
|
|
$wp_customize->add_control('pb_network_contact_form_title', [ |
|
|
|
'label' => __( 'Contact Form Title', 'pressbooks-aldine' ), |
|
|
|
'label' => __( 'Contact Form Title', 'pressbooks-aldine' ), |
|
|
@ -161,24 +179,6 @@ function customize_register( \WP_Customize_Manager $wp_customize ) { |
|
|
|
]); |
|
|
|
]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Render the site title for the selective refresh partial. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @return void |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
function customize_partial_blogname() { |
|
|
|
|
|
|
|
bloginfo( 'name' ); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Render the site tagline for the selective refresh partial. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @return void |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
function customize_partial_blogdescription() { |
|
|
|
|
|
|
|
bloginfo( 'description' ); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Binds JS handlers to make Theme Customizer preview reload changes asynchronously. |
|
|
|
* Binds JS handlers to make Theme Customizer preview reload changes asynchronously. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|