@@ -12,6 +12,51 @@ function shapely_customize_register( $wp_customize ) {
1212 $ wp_customize ->get_setting ( 'blogname ' )->transport = 'postMessage ' ;
1313 $ wp_customize ->get_setting ( 'blogdescription ' )->transport = 'postMessage ' ;
1414 $ wp_customize ->get_setting ( 'header_textcolor ' )->transport = 'postMessage ' ;
15+ $ wp_customize ->get_setting ( 'custom_logo ' )->transport = 'refresh ' ;
16+
17+ // Abort if selective refresh is not available.
18+ if ( ! isset ( $ wp_customize ->selective_refresh ) ) {
19+ return ;
20+ }
21+
22+ $ wp_customize ->selective_refresh ->add_partial ( 'blogname ' , array (
23+ 'selector ' => '.site-title ' ,
24+ 'render_callback ' => function () {
25+ bloginfo ( 'name ' );
26+ },
27+ ) );
28+
29+ $ wp_customize ->selective_refresh ->add_partial ( 'footer_callout_text ' , array (
30+ 'selector ' => '.footer-callout ' ,
31+ 'render_callback ' => function () {
32+ shapely_footer_callout ();
33+ }
34+ ) );
35+ $ wp_customize ->selective_refresh ->add_partial ( 'footer_callout_btntext ' , array (
36+ 'selector ' => '.footer-callout ' ,
37+ 'render_callback ' => function () {
38+ shapely_footer_callout ();
39+ }
40+ ) );
41+ $ wp_customize ->selective_refresh ->add_partial ( 'footer_callout_link ' , array (
42+ 'selector ' => '.footer-callout ' ,
43+ 'render_callback ' => function () {
44+ shapely_footer_callout ();
45+ }
46+ ) );
47+ $ wp_customize ->selective_refresh ->add_partial ( 'blog_name ' , array (
48+ 'selector ' => '.header-callout ' ,
49+ 'render_callback ' => function () {
50+ shapely_top_callout ();
51+ }
52+ ) );
53+ $ wp_customize ->selective_refresh ->add_partial ( 'header_textcolor ' , array (
54+ 'selector ' => '.header-callout ' ,
55+ 'render_callback ' => function () {
56+ shapely_top_callout ();
57+ }
58+ ) );
59+
1560}
1661
1762add_action ( 'customize_register ' , 'shapely_customize_register ' );
@@ -131,7 +176,7 @@ function shapely_customizer( $wp_customize ) {
131176 }
132177
133178 $ wp_customize ->add_setting ( 'hide_post_title ' , array (
134- 'default ' => 1 ,
179+ 'default ' => 0 ,
135180 'sanitize_callback ' => 'shapely_sanitize_checkbox ' ,
136181 ) );
137182
@@ -157,6 +202,7 @@ function shapely_customizer( $wp_customize ) {
157202 $ wp_customize ->add_setting ( 'blog_name ' , array (
158203 'default ' => '' ,
159204 'sanitize_callback ' => 'shapely_sanitize_strip_slashes ' ,
205+ 'transport ' => 'postMessage '
160206 ) );
161207 $ wp_customize ->add_control ( 'blog_name ' , array (
162208 'label ' => __ ( 'Blog Name in top callout ' , 'shapely ' ),
@@ -188,6 +234,7 @@ function shapely_customizer( $wp_customize ) {
188234 $ wp_customize ->add_setting ( 'footer_callout_text ' , array (
189235 'default ' => '' ,
190236 'sanitize_callback ' => 'shapely_sanitize_strip_slashes ' ,
237+ 'transport ' => 'postMessage '
191238 ) );
192239 $ wp_customize ->add_control ( 'footer_callout_text ' , array (
193240 'label ' => __ ( 'Text for footer callout ' , 'shapely ' ),
@@ -198,6 +245,7 @@ function shapely_customizer( $wp_customize ) {
198245 $ wp_customize ->add_setting ( 'footer_callout_btntext ' , array (
199246 'default ' => '' ,
200247 'sanitize_callback ' => 'shapely_sanitize_strip_slashes ' ,
248+ 'transport ' => 'postMessage '
201249 ) );
202250 $ wp_customize ->add_control ( 'footer_callout_btntext ' , array (
203251 'label ' => __ ( 'Text for footer callout button ' , 'shapely ' ),
@@ -206,6 +254,7 @@ function shapely_customizer( $wp_customize ) {
206254 $ wp_customize ->add_setting ( 'footer_callout_link ' , array (
207255 'default ' => '' ,
208256 'sanitize_callback ' => 'esc_url_raw ' ,
257+ 'transport ' => 'postMessage '
209258 ) );
210259 $ wp_customize ->add_control ( 'footer_callout_link ' , array (
211260 'label ' => __ ( 'CFA button link ' , 'shapely ' ),
0 commit comments