[wp-trac] [WordPress Trac] #40146: Starter content can be silently published with other themes
WordPress Trac
noreply at wordpress.org
Mon Sep 11 17:41:47 UTC 2017
#40146: Starter content can be silently published with other themes
--------------------------+-----------------------------
Reporter: dlh | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Customize | Version: 4.7
Severity: normal | Resolution:
Keywords: needs-patch | Focuses:
--------------------------+-----------------------------
Comment (by westonruter):
Yeah, `nav_menus_created_posts` would be particularly difficult because it
contains post IDs that may have been created for starter content _or_ as
part of manually adding pages for nav menu items or the static homepage
/posts-page. Are there other cases of settings that get silently
published? If it is just a special case for `nav_menus_created_posts` then
one option could be to check if there are still nav menu items present
that reference these IDs. If there are no reference counts for these IDs,
then they could be skipped from being published.
Something else is that when a post gets created as starter content and
added to `nav_menus_created_posts`, each post could get its own dedicated
postmeta array of the themes that it is starter content for. For example,
if theme A and theme B both have a static front/homepage created, if you
preview A the auto-draft will be created and it could get `a` added to
this postmeta. Then when switching to preview theme B, the importer logic
should be skipping to insert another auto-draft for this homepage since it
already exists in `nav_menus_created_posts` and would be re-used, but when
it is re-used then it could get the theme `b` added to this postmeta. In
that way, this postmeta could serve as another way to do reference
counting.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40146#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list