[wp-trac] [WordPress Trac] #38615: Round out and refine starter content
WordPress Trac
noreply at wordpress.org
Mon Nov 21 07:28:28 UTC 2016
#38615: Round out and refine starter content
--------------------------------------------------------+------------------
Reporter: helen | Owner:
Type: task (blessed) | Status: new
Priority: high | Milestone: 4.7
Component: Themes | Version:
Severity: normal | Resolution:
Keywords: needs-testing needs-unit-tests needs-patch | Focuses:
--------------------------------------------------------+------------------
Changes (by westonruter):
* keywords: has-patch needs-testing needs-unit-tests => needs-testing
needs-unit-tests needs-patch
Comment:
In [attachment:38615.10.diff] & [attachment:38615.11.diff]
([https://github.com/xwp/wordpress-develop/pull/201/files/30865c7..d400b0c
see changes]):
* Set auto-draft via 4th arg on `media_handle_sideload()` instead of an
additional call to `wp_update_post()`.
* Allow starter content to supply attachment args for title, description,
and excerpt; supply translatable titles for the images in Twenty
Seventeen.
* Sideload attachment from disk instead of downloading from URL when
possible.
* Prevent clobbering gathered attachment IDs when amending to existing
changeset.
Sideloading the 3 images by first fetching each via `download_url()`
causes the entire starter content import process to take about 2.05
seconds. When the files are already on the filesystem, as they have been
in our examples, it is ''much'' faster to copy the file to the temporary
location and then use temp file in the call to `media_handle_sideload()`.
This cuts the starter content import time down to 0.07 seconds (about 30×
faster).
I am noticing a probably defect with the attachment importing whereby once
images are imported and you reload the customizer, the images get re-
uploaded into the media library again even though they are already there
as auto-drafts. Likewise, the `nav_menus_created_posts` setting keeps
getting the new attachment IDs amended to it even though they aren't
actually used because posts are skipped from being inserted (and thus the
new `thumbnail` assigned) if there is already an `auto-draft` post with
the expected `post_name` in the DB among the `nav_menus_created_posts`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38615#comment:32>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list