Commit Graph

126 Commits

Author SHA1 Message Date
John Blackbourn
1a77bb81d8 Docs: Remove unnecessary variables names from @return tags.
See #49572.
Built from https://develop.svn.wordpress.org/trunk@48100


git-svn-id: http://core.svn.wordpress.org/trunk@47869 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-19 22:55:12 +00:00
Sergey Biryukov
de59ad23a4 Docs: Consistently include an empty line between @since tag and @see, @link, or @global, per the documentation standards.
See #49572.
Built from https://develop.svn.wordpress.org/trunk@48067


git-svn-id: http://core.svn.wordpress.org/trunk@47834 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-16 21:07:14 +00:00
Dominik Schilling
ed71319421 Role/Capability: Use meta caps edit_post, read_post, and delete_post directly.
Rather than consulting the post type object, let `map_meta_cap()` handle that for us.

Props peterwilsoncc, ocean90.
Fixes #50128.
See #23226.
Built from https://develop.svn.wordpress.org/trunk@47850


git-svn-id: http://core.svn.wordpress.org/trunk@47626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-05-23 15:24:07 +00:00
Sergey Biryukov
7932193708 Coding Standards: Use strict comparison where static strings are involved.
This reduces the number of `WordPress.PHP.StrictComparisons.LooseComparison` issues in half, from 1897 to 890.

Includes minor code layout fixes for better readability.

See #49542.
Built from https://develop.svn.wordpress.org/trunk@47808


git-svn-id: http://core.svn.wordpress.org/trunk@47584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-05-16 18:42:12 +00:00
whyisjake
62f6909480 Code standards: Drop a newline in the customizer to comply with WordPress Coding Standards
Extends [47763] and #46829.

Built from https://develop.svn.wordpress.org/trunk@47764


git-svn-id: http://core.svn.wordpress.org/trunk@47540 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-05-05 22:00:09 +00:00
whyisjake
7a48040e13 Menus: Denote the special pages in the Customizer menu editor.
The special pages here are the pages that are used for the Privacy Policy, Home, and the Posts page.

Fixes #46829.
Props garrett-eclipse, audrasjb.

Built from https://develop.svn.wordpress.org/trunk@47763


git-svn-id: http://core.svn.wordpress.org/trunk@47539 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-05-05 21:17:06 +00:00
John Blackbourn
1a27d51b48 Menus: Allow empty taxonomy terms to be surfaced when searching for items.
This brings the behaviour inline with that of browsing terms or using the All Items tab, which correctly shows empty terms.

Props birgire, audrasjb

Fixes #45298
Built from https://develop.svn.wordpress.org/trunk@47747


git-svn-id: http://core.svn.wordpress.org/trunk@47523 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-05-02 22:36:07 +00:00
Sergey Biryukov
ac9b6fcef8 Docs: Use a consistent description for the $manager parameter in various Customizer class constructions.
See #48303.
Built from https://develop.svn.wordpress.org/trunk@47383


git-svn-id: http://core.svn.wordpress.org/trunk@47170 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-26 15:33:05 +00:00
John Blackbourn
f93ee2ca76 Docs: Increase the specificity of various docblock parameter types and return types.
See #48303
Built from https://develop.svn.wordpress.org/trunk@46823


git-svn-id: http://core.svn.wordpress.org/trunk@46623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-12-06 22:43:04 +00:00
John Blackbourn
aa1fdcbd52 Docs: Correct various docblocks documentation.
See #48303
Built from https://develop.svn.wordpress.org/trunk@46821


git-svn-id: http://core.svn.wordpress.org/trunk@46621 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-12-06 22:23:04 +00:00
Sergey Biryukov
3d623995a8 Docs: In various @return tags, list the expected type first, instead of WP_Error.
See #48303.
Built from https://develop.svn.wordpress.org/trunk@46696


git-svn-id: http://core.svn.wordpress.org/trunk@46496 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-11-11 02:43:03 +00:00
whyisjake
c034f5b4c3 Menus: Replace http with https in placeholders.
Encourage the use of https with the placeholder text in menus.

Fixes #46312
Props aksl95, audrasjb, celloexpressions, SergeyBiryukov, jorbin.

Built from https://develop.svn.wordpress.org/trunk@46330


git-svn-id: http://core.svn.wordpress.org/trunk@46129 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-26 20:32:55 +00:00
Sergey Biryukov
e199663322 I18N: Capitalize translator comments consistently, add trailing punctuation.
Includes minor code layout fixes.

See #44360.
Built from https://develop.svn.wordpress.org/trunk@45932


git-svn-id: http://core.svn.wordpress.org/trunk@45743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-03 00:41:05 +00:00
Sergey Biryukov
16b8d91baa I18N: Improve translator comments.
* Add missing translator comments.
* Fix placement of some translator comments. Translator comments should be on the line directly above the line containing the translation function call for optimal compatibility with various `.pot` file generation tools. The CS auto-fixing, which changed some inconsistent function calls to multi-line function calls, is part of the reason why this was no longer the case for a select group of translator comments.

Includes minor code layout fixes.

Polyglots, rejoice! All WordPress core files now have translator comments for all strings with placeholders!

Props jrf, subrataemfluence, GaryJ, webdados, Dency, swissspidy, alvarogois, marcomartins, mihaiiceyro, vladwtz, niq1982, flipkeijzer, michielatyoast, chandrapatel, thrijith, joshuanoyce, FesoVik, tessak22, bhaktirajdev, cleancoded, dhavalkasvala, garrett-eclipse, bibliofille, socalchristina, priyankkpatel, 5hel2l2y, adamsilverstein, JeffPaul, pierlo, SergeyBiryukov.
Fixes #44360.
Built from https://develop.svn.wordpress.org/trunk@45926


git-svn-id: http://core.svn.wordpress.org/trunk@45737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-01 17:13:59 +00:00
Sergey Biryukov
c26f1c5d90 Taxonomy: Fix deprecated calls to get_terms().
The taxonomy should be passed as part of `$args`, rather than as its own argument.

Props sgastard, mukesh27, SergeyBiryukov.
Fixes #47819.
Built from https://develop.svn.wordpress.org/trunk@45723


git-svn-id: http://core.svn.wordpress.org/trunk@45534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-03 03:35:56 +00:00
Sergey Biryukov
b8b12b4946 I18N: Merge duplicate "Status is forbidden" strings.
Props ramiy.
Fixes #47037.
Built from https://develop.svn.wordpress.org/trunk@45442


git-svn-id: http://core.svn.wordpress.org/trunk@45253 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-05-26 18:47:53 +00:00
Drew Jaynes
4f35907147 Customizer: Remove a line of commented-out code in WP_Customize_Nav_Menus::customize_register().
Retains a more explicit future-compat version of the todo notation that used to accompany the commented-out code.

Props harsh175, dlh.
Fixes #44633.

Built from https://develop.svn.wordpress.org/trunk@44328


git-svn-id: http://core.svn.wordpress.org/trunk@44158 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-19 07:23:47 +00:00
Gary Pendergast
56c162fbc9 Coding Standards: Upgrade WPCS to 1.0.0
WPCS 1.0.0 includes a bunch of new auto-fixers, which drops the number of coding standards issues across WordPress significantly. Prior to running the auto-fixers, there were 15,312 issues detected. With this commit, we now drop to 4,769 issues.

This change includes three notable additions:
- Multiline function calls must now put each parameter on a new line.
- Auto-formatting files is now part of the `grunt precommit` script. 
- Auto-fixable coding standards issues will now cause Travis failures.

Fixes #44600.


Built from https://develop.svn.wordpress.org/trunk@43571


git-svn-id: http://core.svn.wordpress.org/trunk@43400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-08-17 01:51:36 +00:00
Andrew Ozz
01d8979bee Customize: Do not attempt to count uncountable value.
Props dlh.
Fixes #44104.
Built from https://develop.svn.wordpress.org/trunk@43480


git-svn-id: http://core.svn.wordpress.org/trunk@43307 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-17 14:38:24 +00:00
John Blackbourn
b13e73d05c Docs: Document more parameters and properties using typed array notation.
See #41756

Built from https://develop.svn.wordpress.org/trunk@42875


git-svn-id: http://core.svn.wordpress.org/trunk@42705 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-03-25 18:10:32 +00:00
Sergey Biryukov
4848a09b35 I18N: Use the actual placeholder instead of a number in translator comments if the corresponding string does not use numbered placeholders.
Add missing translator comments in `WP_Theme_Install_List_Table` and `wp_notify_postauthor()`.
Add missing commas in some translator comments.

Fixes #43523.
Built from https://develop.svn.wordpress.org/trunk@42827


git-svn-id: http://core.svn.wordpress.org/trunk@42657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-03-11 16:44:34 +00:00
Sergey Biryukov
b170b60693 Docs: Correct erroneous class references in @see tags.
Props coffee2code.
Fixes #43158.
Built from https://develop.svn.wordpress.org/trunk@42630


git-svn-id: http://core.svn.wordpress.org/trunk@42459 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-02-01 01:20:30 +00:00
Weston Ruter
a8b77a1948 Customize: Include nav menu item for Home custom link in search results for "Home".
Props audrasjb, westonruter.
Fixes #42991.

Built from https://develop.svn.wordpress.org/trunk@42611


git-svn-id: http://core.svn.wordpress.org/trunk@42440 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-01-29 22:10:33 +00:00
Gary Pendergast
aaf99e6913 Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.


Built from https://develop.svn.wordpress.org/trunk@42343


git-svn-id: http://core.svn.wordpress.org/trunk@42172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-30 23:11:00 +00:00
Weston Ruter
016a3f9ecd Customize: Ensure customization drafts are published instead of trashed when scheduled changeset goes live while non-admin user is authenticated (such as during WP Cron).
Props designsimply for testing, dlh for testing, melchoyce for testing.
See #28721, #34923, #42220.
Fixes #42489 for trunk.

Built from https://develop.svn.wordpress.org/trunk@42148


git-svn-id: http://core.svn.wordpress.org/trunk@41979 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-10 22:44:52 +00:00
Konstantin Obenland
5aa45cd12e Customize: Allow previewed menus to be customized
Fixes a bug where menu assignements couldn't be changed when previewing a theme.
Also removes an unnecessary call to menu mapping after a theme switch from the customizer and makes sure the locations option is always written, for good measure.

Props westonruter.
See #39692.

Built from https://develop.svn.wordpress.org/trunk@41995


git-svn-id: http://core.svn.wordpress.org/trunk@41829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 18:35:48 +00:00
Sergey Biryukov
33012ad740 Customize: Use typographic quotation marks in the strings added in [41768].
Props audrasjb, tobifjellner.
Fixes #42290. See #40104.
Built from https://develop.svn.wordpress.org/trunk@41956


git-svn-id: http://core.svn.wordpress.org/trunk@41790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-20 14:07:47 +00:00
Mel Choyce
d31ab27d26 Customize Menus: Update capitalization of "next" to match case on the "Next" button.
Props hardeepasrani.
Fixes #42287.

Built from https://develop.svn.wordpress.org/trunk@41954


git-svn-id: http://core.svn.wordpress.org/trunk@41788 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-20 10:34:49 +00:00
Weston Ruter
bd9d1d9178 Customize: Allow post/page stubs to be edited in WP Admin as "customization drafts" when changeset is saved as draft or scheduled.
* Update stubs to have draft status when changeset is saved as draft, instead of preventing auto-draft garbage collection by giving them a far-future `post_date`.
* Show notice in publish metabox when editing a customization draft indicating that it will be published automatically with its changeset; a link to Customizer is included.
* Include a new "Customization Draft" display post state in the post list table.
* Disconnect stubs from their changesets when they are updated with a status other than "Draft".
* Trash customization drafts when their related changeset is trashed or deleted.
* Add a `_customize_changeset_uuid` postmeta to stubs to link them with their associated changeset.
* Include `customize_changeset_uuid` as context when requesting to insert a new auto-draft.

Props westonruter, melchoyce.
See #39896, #39752, #34923.
Fixes #42220.

Built from https://develop.svn.wordpress.org/trunk@41887


git-svn-id: http://core.svn.wordpress.org/trunk@41721 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-17 20:15:52 +00:00
Weston Ruter
12f647679b Widgets: Rename "Custom Menu" widget to "Navigation Menu".
Props gk.loveweb, ChrisHardie, ajayghaghretiya1, melchoyce.
Fixes #40442.

Built from https://develop.svn.wordpress.org/trunk@41868


git-svn-id: http://core.svn.wordpress.org/trunk@41702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-15 22:23:47 +00:00
Weston Ruter
c6f2ff7a8e Customize: Add notice for when there are no nav menus created yet, prompting user to create one.
Props bpayton, melchoyce, westonruter.
Fixes #42116.

Built from https://develop.svn.wordpress.org/trunk@41823


git-svn-id: http://core.svn.wordpress.org/trunk@41657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-11 05:28:52 +00:00
Weston Ruter
c1ede53374 Customize: Fix string translations for singular vs plural after [41812].
Props felipeelia, tobifjellner, SergeyBiryukov.
See #42112.
Fixes #42170.

Built from https://develop.svn.wordpress.org/trunk@41816


git-svn-id: http://core.svn.wordpress.org/trunk@41650 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-10 21:04:49 +00:00
Weston Ruter
b36fa8ce9c Customize: Adjust "Menu Locations" labels for singular/plural.
Props felipeelia.
Fixes #42112.

Built from https://develop.svn.wordpress.org/trunk@41812


git-svn-id: http://core.svn.wordpress.org/trunk@41646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-10 17:57:48 +00:00
Konstantin Obenland
a22bb4f3ad Customizer: Account for legacy menu data
Checks for menu location data from when a previewed theme was previously active.

See #39692.

Built from https://develop.svn.wordpress.org/trunk@41810


git-svn-id: http://core.svn.wordpress.org/trunk@41644 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-10 17:06:47 +00:00
Dominik Schilling
3dfe22a425 Customize: Add context to "View All Locations" string.
This is about navigation menu locations. Also updates the array alignment to use spaces.

See #40104.
Built from https://develop.svn.wordpress.org/trunk@41792


git-svn-id: http://core.svn.wordpress.org/trunk@41626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-08 16:34:49 +00:00
Weston Ruter
275f4713a5 Customize: Improve the menu creation flow.
Often, folks run into two issues when they create new menus: they click "Add a Menu" thinking it will add a new page to their menu, or they forget to assign their new menu to a location, and then wonder why it doesn't show up on their site.

This commit rearranges the order of items in the menu panel, and updates the flow for creating a menu by breaking it up into steps. Additionally, more help text has been added to guide people through the process of creating a menu.

Also adds default `type` lookups for Panel and Section instances. See #30741.

Props bpayton, obenland, westonruter, celloexpessions, afercia, melchoyce, zoonini, michelleweber.
Fixes #40104.

Built from https://develop.svn.wordpress.org/trunk@41768


git-svn-id: http://core.svn.wordpress.org/trunk@41602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-05 02:22:49 +00:00
Weston Ruter
a83e4eb40e Customize: Fix WP_Customize_Date_Time_Control to be re-usable for plugins and custom settings.
* Allow time fields to be omitted by constructing with `timeIncluded` as `false`.
* Ensure `reportValidity` is only called on a control when it is in an expanded section.
* Rename "ampm" to "meridian".
* Improve accessibility and fix HTML validation and style issues for both the date/time control and the preview link control.
* Fix styling of dropdowns and clean CSS.
* Improve accessibility of nav menus component.

Props westonruter, afercia, sayedwp, melchoyce.
Amends [41626].
See #39896.
Fixes #42022.

Built from https://develop.svn.wordpress.org/trunk@41670


git-svn-id: http://core.svn.wordpress.org/trunk@41504 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 04:12:47 +00:00
Sergey Biryukov
c70492e5d1 Docs: Remove "in in", "this this", and "containing containing" dittography from inline comments.
Props Presskopp.
Fixes #41841.
Built from https://develop.svn.wordpress.org/trunk@41353


git-svn-id: http://core.svn.wordpress.org/trunk@41186 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-09 13:19:45 +00:00
Konstantin Obenland
e183d59acb Map nav menu locations on theme switch
This will send nav menu locations through three levels of mapping:
1. If both themes have only one location, that gets mapped.
2. If both themes have locations with the same slug, they get mapped.
3. Locations that (even partially) match slugs from a similar kind of menu location will get mapped.

Menu locations are mapped for Live Previews in the Customizer and during theme switches.

Props westonruter, obenland, welcher, melchoyce.
Fixes #39692.


Built from https://develop.svn.wordpress.org/trunk@41237


git-svn-id: http://core.svn.wordpress.org/trunk@41077 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-09 21:04:47 +00:00
Weston Ruter
a193916f46 Customize: Introduce settings_previewed arg and getter on WP_Customize_Manager which controls whether WP_Customize_Setting::preview() should be called on settings.
The `settings_previewed` property eliminates the need for the Customizer components from having to look at global `doing_ajax` state. This is in particular needed when saving settings, as some settings will short-circuit the update operation if they detect no changes are introduced. This is also needed for low-level integrations with the Customizer, such as in REST API endpoints under development.

Props stubgo, westonruter, utkarshpatel for testing.
See #38900.
Fixes #39221.

Built from https://develop.svn.wordpress.org/trunk@41205


git-svn-id: http://core.svn.wordpress.org/trunk@41045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-02 05:35:41 +00:00
Weston Ruter
eb658592df Customize: For selective refresh of nav menus, prevent preg_replace() from dropping backslashes in JSON replaced into the data-customize-partial-placement-context HTML attribute.
Props dlh, westonruter.
Fixes #41488.

Built from https://develop.svn.wordpress.org/trunk@41204


git-svn-id: http://core.svn.wordpress.org/trunk@41044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-02 05:11:44 +00:00
Drew Jaynes
0860bb2771 Docs: Remove @access notations from method DocBlocks in wp-includes/* classes.
Prior to about 2013, many class methods lacked even access modifiers which made the `@access` notations that much more useful. Now that we've gotten to a point where the codebase is more mature from a maintenance perspective and we can finally remove these notations. Notable exceptions to this change include standalone functions notated as private as well as some classes still considered to represent "private" APIs.

See #41452.

Built from https://develop.svn.wordpress.org/trunk@41162


git-svn-id: http://core.svn.wordpress.org/trunk@41002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-27 00:41:44 +00:00
Sergey Biryukov
98458cb6e3 Docs: Add a @global entry for $wp_post_statuses in WP_Customize_Nav_Menus::make_auto_draft_status_previewable().
Props afzalmultani.
See #41238.
Built from https://develop.svn.wordpress.org/trunk@41004


git-svn-id: http://core.svn.wordpress.org/trunk@40854 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-05 09:21:41 +00:00
Weston Ruter
a44f8db73d Customize: Always enqueue customize-preview stylesheet in the customizer preview to style selective refresh and visual edit shortcuts.
Enqueues the style along with the `customize-preview` script in the manager instead of via the `widgets` and `nav_menus` components, ensuring that the stylesheet is loaded for users who cannot manage widgets or nav menus.

Props dlh.
See #27403.
Fixes #39498.

Built from https://develop.svn.wordpress.org/trunk@39951


git-svn-id: http://core.svn.wordpress.org/trunk@39888 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-26 03:47:41 +00:00
Weston Ruter
3e6c892f89 Customize: Allow custom post types to be used in starter content.
Changes `WP_Customize_Nav_Menus::insert_auto_draft_post()` so it can be invoked for a `post_type` that is not registered (yet).

See #38615, #38114.
Fixes #39610.

Built from https://develop.svn.wordpress.org/trunk@39924


git-svn-id: http://core.svn.wordpress.org/trunk@39861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-19 00:01:46 +00:00
Sergey Biryukov
9234febe06 Posts, Post Types: Use an existing string for "Invalid post type" error message.
Props ramiy.
Fixes #39171.
Built from https://develop.svn.wordpress.org/trunk@39756


git-svn-id: http://core.svn.wordpress.org/trunk@39694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-10 02:40:42 +00:00
Weston Ruter
1b96e389c0 Customize: Fix inability to delete nav menus by preventing preview filters from being added during customize_save admin ajax request.
Also prevent setting `nav_menu_locations[...]` values to `NaN` which gets sent as `null`.

Amends [38810].
See #30937.
Fixes #39103.

Built from https://develop.svn.wordpress.org/trunk@39558


git-svn-id: http://core.svn.wordpress.org/trunk@39498 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-10 06:30:46 +00:00
Weston Ruter
3b37903106 Customize: Defer populating post_name for auto-draft posts in customized state until posts are published.
The ultimate `post_name` is stored in postmeta until the post is published. The `get_page_by_path()` function does not exclude `auto-draft` posts. Revert changes to `wp_unique_post_slug()` from [39411] which excluded `auto-draft` posts.

Props westonruter, dlh for testing, helen for testing.
See #38114, #38928.
Fixes #39078.

Built from https://develop.svn.wordpress.org/trunk@39506


git-svn-id: http://core.svn.wordpress.org/trunk@39446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-05 19:33:42 +00:00
Helen Hou-Sandí
70fc99e323 Theme starter content: Add support for featured images and page templates.
Featured image support means that attachments can now be imported. Media can be sideloaded from within theme or plugin directories. Like other posts, attachments are auto-drafts until customizer changes are published, and are not duplicated when they already exist in the customized state. Attachment IDs can be used for any number of purposes, much like post IDs. Twenty Seventeen now includes 3 images used as featured images to best showcase the multi-section homepage setup.

As featured image IDs are stored in post meta, it also made sense to add support for page templates. Twenty Seventeen does not include any such templates, but the functionality can be quite important for displaying themes to their best effect.

props westonruter, helen, flixos90.
fixes #38615.

Built from https://develop.svn.wordpress.org/trunk@39346


git-svn-id: http://core.svn.wordpress.org/trunk@39286 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-23 09:53:33 +00:00
Weston Ruter
8efc416f64 Customize: Allow starter content to apply in a new theme when switching from another theme containing changes.
* Ensure that starter content can apply from theme B after previewing starter content in theme A.
* Introduce new `starter_content` flag in changeset setting params which is used to capture whether a value is starter content and thus can be overridden.
* Create changeset up-front with `starter_content` flags instead of waiting for `AUTOSAVE_INTERVAL`.
* Eliminate instantiation of settings for widget instances in favor of directly calling `sanitize_widget_js_instance`. This eliminates issues with looking for widgets before they are registered.
* Ensure that non-placeholders (inline arrays instead of string references) can be supplied in starter content.
* Re-use auto-draft posts as starter content across theme switches.
* Introduce `starter_content` param for `WP_Customize_Manager::save_changeset_post()` which is `false` except when starter content is being loaded on a `fresh_site`.

See #38114.
Fixes #38541.

Built from https://develop.svn.wordpress.org/trunk@39241


git-svn-id: http://core.svn.wordpress.org/trunk@39181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-15 09:03:32 +00:00