[wp-trac] [WordPress Trac] #36952: get_theme_mod called when getting the root value of a custom type

WordPress Trac noreply at wordpress.org
Thu May 26 09:48:13 UTC 2016


#36952: get_theme_mod called when getting the root value of a custom type
--------------------------+-----------------------------
 Reporter:  jontis        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Customize     |    Version:  4.5.2
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Notice the else if statement

 {{{#!php
 /* wp-includes/class-wp-customize-setting.php:533 */
 protected function get_root_value( $default = null ) {
                 $id_base = $this->id_data['base'];
                 if ( 'option' === $this->type ) {
                         return get_option( $id_base, $default );
                 } else if ( 'theme_mod' ) {
                         return get_theme_mod( $id_base, $default );
                 } else {
                         /*
                          * Any WP_Customize_Setting subclass implementing
 aggregate multidimensional
                          * will need to override this method to obtain the
 data from the appropriate
                          * location.
                          */
                         return $default;
                 }
         }
 }}}

 Same bug applies to set_root_value

 This can cause the Customizer to fail loading with the error
 "sprintf(): Too few arguments"
 On the sprintf function in get_theme_mod if $default is a string
 containing more than two % (percentage symbols)

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


More information about the wp-trac mailing list