[wp-trac] [WordPress Trac] #45484: starter content theme_mods/options throw php warning if not string

WordPress Trac noreply at wordpress.org
Thu Mar 21 23:04:01 UTC 2019


#45484: starter content theme_mods/options throw php warning if not string
--------------------------+------------------------------
 Reporter:  timph         |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Customize     |     Version:  4.7
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+------------------------------
Changes (by timph):

 * keywords:  needs-patch reporter-feedback => needs-patch


Comment:

 Okay.  If you add this to twenty-ninteen's **functions.php** file:

 {{{#!php
 add_theme_support( 'starter-content', [
         'theme_mods' => [
                 'testing' => [ 1, 2, 3 ],
         ],
 ] );
 }}}

 It results in: [21-Mar-2019 22:59:12 UTC] PHP Warning:  preg_match()
 expects parameter 2 to be string, array given in /srv/www/wordpress-
 default/public_html/wp-includes/class-wp-customize-manager.php on line
 1548

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45484#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list