[wp-trac] [WordPress Trac] #39254: When in Customizer Preview, starter content posts are not displayed in the loop

WordPress Trac noreply at wordpress.org
Sun May 14 14:00:36 UTC 2017


#39254: When in Customizer Preview, starter content posts are not displayed in the
loop
-------------------------------------+-------------------------------------
 Reporter:  tiagonoronha             |       Owner:  westonruter
     Type:  defect (bug)             |      Status:  accepted
 Priority:  normal                   |   Milestone:  4.8
Component:  Customize                |     Version:  4.7
 Severity:  normal                   |  Resolution:
 Keywords:  needs-unit-tests has-    |     Focuses:  administration,
  patch needs-testing reporter-      |  template
  feedback                           |
-------------------------------------+-------------------------------------

Comment (by FlorianBrinkmann):

 @westonruter ah okay, misunderstood that. I tried it now with the
 following array, but I get the same result.

 {{{#!php
 'snowy-landscape' => [
         'post_type'  => 'post',
         'post_name'  => 'snowy-landscape',
         'post_title' => 'Snowy Landscape',
 ],
 }}}


 I looked into the `wp-includes/class-wp-customize-manager.php` and its
 `import_theme_starter_content()` function. For some reason, the
 `$existing_starter_content_posts` array is empty at the end of the
 function. I get the post name »snowy-landscape« from the `$post_name =
 $existing_post->post_name`
 (https://core.trac.wordpress.org/browser/tags/4.7.4/src/wp-includes/class-
 wp-customize-manager.php#L1016) but the array is not filled with data. So
 the check for existing auto draft posts seems not to work properly?

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


More information about the wp-trac mailing list