[wp-trac] [WordPress Trac] #39149: starter-content options limited to some names?

WordPress Trac noreply at wordpress.org
Wed Dec 7 15:46:03 UTC 2016


#39149: starter-content options limited to some names?
--------------------------+-----------------------------
 Reporter:  Looimaster    |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.7
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 I just installed WordPress 4.7 and put this in the functions.php file:

 {{{
 function my_setup() {
         add_theme_support( 'starter-content', array(
                 'options' => array(
                         'show_on_front' => 'page',
                         'test123' => 'test',
                 ),
         ) );
 }
 add_action( 'after_setup_theme', 'my_setup' );
 }}}

 The `fresh_site` option was added to the database automatically with value
 of `1`.

 In footer.php when I run `echo get_theme_starter_content();` I get the
 correct result but when I run `echo get_option('test123');` right next to
 it I'm only getting `false`. With `echo get_option('show_on_front');` I
 get expected `page` instead of default `posts`.

 I tried to debug that but I can’t figure out what this is supposed to do
 `preg_match( '/^{{(?P.+)}}$/', $value, $matches )` in
 `import_theme_starter_content()`?

 I also noticed that all arrays need to be serialized which was kind of
 unexpected:

 {{{
 add_theme_support( 'starter-content', array(
         'options' => array(
                 'test123' => 'test',
                 'test1234' => maybe_serialize( array(
                         'something' => 'test',
                 ) ),
         ),
 ) );
 }}}

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


More information about the wp-trac mailing list