#39149 closed defect (bug) (worksforme)
starter-content options limited to some names?
Reported by: | Looimaster | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.7 |
Component: | Themes | Keywords: | |
Focuses: | Cc: |
Description
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', ) ), ), ) );
Change History (3)
Note: See
TracTickets for help on using
tickets.
Hi
I apologize for the very late reply.
The starter content preg_match that you mention was updated 6 months ago, so I will close this as resolved.
You may find this helpful: https://core.trac.wordpress.org/ticket/45484
If this did not solve the problem, you are welcome to post your question again in the support forums.