[wp-trac] [WordPress Trac] #39184: Fatal error in child-theme customizer partials

WordPress Trac noreply at wordpress.org
Thu Dec 8 14:34:37 UTC 2016


#39184: Fatal error in child-theme customizer partials
--------------------------+-----------------------------
 Reporter:  bastho        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Customize     |    Version:  4.7
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 When calling wp_customize::selective_refresh::add_partial without
 '''render_callback''' attribute, like this:

 {{{#!php
 <?php
 $wp_customize->selective_refresh->add_partial( 'setting_name', array(
  'selector' => '#object-id',
 ) );
 }}}

 No error is return, everything works well.
 But, when a child theme is created, the customizer crashes with error:

 {{{
 Fatal error: Cannot unset string offsets in [...]/wp-includes/class-wp-
 customize-widgets.php on line 1077
 }}}


 Simply adding a dummy renderer as:

 {{{#!php
 <?php
 $wp_customize->selective_refresh->add_partial( 'setting_name', array(
  'selector' => '#object-id',
  'render_callback' => 'return_true',
 ) );
 }}}

 make it working every where.

 Suggestions:

 1. Making the '''render_callback''' attribute mandatory
 2. Dealing with a default callback in child themes

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39184>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list