Commit Graph

37276 Commits

Author SHA1 Message Date
westonruter
2f878162a1 Customize: Extend changesets to support autosave revisions with restoration notifications, and introduce a new default linear history mode for saved changesets (with a filter for opt-in to changeset branching).
* Autosaved changes made on top of `auto-draft` changesets get written on top of the `auto-draft` itself, similar to how autosaves for posts will overwrite post drafts.
* Autosaved changes made to saved changesets (e.g. `draft`, `future`) will be placed into an autosave revision for that changeset and that user.
* Opening the Customizer will now prompt the user to restore their most recent auto-draft changeset; if notification is dismissed or ignored then the auto-draft will be marked as dismissed and will not be prompted to user in a notification again.
* Customizer will no longer automatically supply the `changeset_uuid` param in the `customize.php` URL when branching changesets are not active.
* If user closes Customizer explicitly via clicking on X link, then autosave auto-draft/autosave will be dismissed so as to not be prompted again.
* If there is a changeset already saved as a `draft` or `future` (UI is forthcoming) then this changeset will now be autoloaded for the user to keep making additional changes. This is the linear model for changesets.
* To restore the previous behavior of the Customizer where each session started a new changeset, regardless of whether or not there was an existing changeset saved, there is now a `customize_changeset_branching` hook which can be filtered to return `true`.
* `wp.customize.requestChangesetUpdate()` now supports a second with options including `autosave`, `title`, and `date`.
* The window `blur` event for `customize.php` has been replaced with a `visibilitychange` event to reduce autosave requests when clicking into preview window.
* Adds `autosaved` and `branching` args to `WP_Customize_Manager`.
* The `changeset_uuid` param for `WP_Customize_Manager` is extended to recognize a `false` value which causes the Customizer to defer identifying the UUID until `after_setup_theme` in the new `WP_Customize_Manager::establish_loaded_changeset()` method.
* A new `customize_autosaved` query parameter can now be supplied which is passed into the `autosaved` arg in `WP_Customize_Manager`; this option is an opt-in to source data from the autosave revision, allowing a user to restore autosaved changes.

Props westonruter, dlh, sayedwp, JoshuaWold, melchoyce.
See #39896.


git-svn-id: https://develop.svn.wordpress.org/trunk@41597 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-26 07:37:02 +00:00
Felix Arntz
06c32bb17c Multisite: Fix documentation issues for domain_exists().
Props stevenlinx.
Fixes #41619.


git-svn-id: https://develop.svn.wordpress.org/trunk@41596 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-26 00:11:56 +00:00
Weston Ruter
d6a58eec48 Code Editors: Update the current file highlight to use notice styling.
Improves color contrast and readability, and reuses a core design pattern.

Props kekkakokkers, monopine, Travel_girl, afercia, melchoyce, karmatosed.
Fixes #31604.


git-svn-id: https://develop.svn.wordpress.org/trunk@41595 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-25 21:45:57 +00:00
Konstantin Obenland
d33ab87371 Widgets: Merge orphaned widgets on theme switch
Merges orphaned widgets into the inactive sidebar when switching themes.

Props bpayton.
See #39693.


git-svn-id: https://develop.svn.wordpress.org/trunk@41594 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-25 16:18:31 +00:00
Sergey Biryukov
db2f3a9b1a Twenty Seventeen: Add Docker Hub icon to supported social links.
Props xkon.
Fixes #41529.

git-svn-id: https://develop.svn.wordpress.org/trunk@41593 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-25 13:48:48 +00:00
Sergey Biryukov
97b8b37c04 Twenty Seventeen: Add Periscope icon to supported social links.
Props xkon.
Fixes #40959.

git-svn-id: https://develop.svn.wordpress.org/trunk@41592 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-25 13:13:17 +00:00
Sergey Biryukov
0ddcbb75aa I18N: Add translator comments for placeholders in WP_REST_Controller strings.
Props ramiy.
Fixes #41667.

git-svn-id: https://develop.svn.wordpress.org/trunk@41591 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-25 10:26:26 +00:00
Weston Ruter
666912edf9 Widgets: Introduce Gallery widget for displaying image galleries.
* Galleries are managed in the widget in the same way they are managed in the post editor, both using the media manager.
* Gallery widget is merged from the Core Media Widgets v0.2.0 feature plugin and it extends `WP_Widget_Media` in the same way as is done for image, audio, and video widgets.
* Model syncing logic is updated to support booleans and arrays (of integers).
* Placeholder areas in media widgets are now clickable shortcuts for selecting media.
* Image widget placeholder is updated to match gallery widget where clicking preview is shortcut for editing media.

Props westonruter, joemcgill, timmydcrawford, m1tk00, obenland, melchoyce.
See #32417.
Fixes #41914.


git-svn-id: https://develop.svn.wordpress.org/trunk@41590 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-25 06:27:32 +00:00
Sergey Biryukov
5c959aa5d8 Posts, Post Types: Pass the order parameter to get_{$adjacent}_post_sort filter.
Props manchumahara.
Fixes #41924.

git-svn-id: https://develop.svn.wordpress.org/trunk@41589 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-24 23:00:08 +00:00
Sergey Biryukov
b6c4a2309d I18N: Replace code fragments in translatable strings for rest_trash_not_supported errors with a placeholder.
Props ramiy.
Fixes #41643.

git-svn-id: https://develop.svn.wordpress.org/trunk@41588 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-24 22:28:56 +00:00
Sergey Biryukov
d3f791728f I18N: Replace method name in a translatable string in WP_REST_Controller::register_routes() with a placeholder.
Props ramiy.
Fixes #41667.

git-svn-id: https://develop.svn.wordpress.org/trunk@41587 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-24 22:03:01 +00:00
Andrea Fercia
8b16d8976f Accessibility: CodeMirror editing areas minor improvements.
- properly labels all the code editor areas (Theme/Plugin, Custom HTML widget, Additional CSS), whether CodeMirror is enabled or disabled
- adds `role="textbox"` and `aria-multiline="true"` to the CodeMirror editing area to allow assistive technologies properly identify it as a textarea
- standardizes the "keyboard trap" help text across the admin and keeps it as a list for better readability
- use the Help text elements as target for `aria-describedby`, to make screen readers read out the help text when focusing the editors
- fixes the `aria-expanded` attribute usage in the Customizer "Additional CSS" help toggle
- moves focus to the CodeMirror editing area when clicking on the associated label
- in the Plugin editor screen: changes a `<big>` element to `<h2>` for better semantics and consistency with the Theme editor screen
- also, removes a few textdomain leftovers, see `better-code-editing` and `default`

Props westonruter, melchoyce, afercia.
Fixes #41872.


git-svn-id: https://develop.svn.wordpress.org/trunk@41586 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-24 15:59:56 +00:00
Sergey Biryukov
be2166126d Plugins: Restore "Clear List" button functionality for recently active plugins.
Props obenland.
Fixes #41080.

git-svn-id: https://develop.svn.wordpress.org/trunk@41585 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-24 15:15:35 +00:00
Andrew Ozz
27f3b55999 Retire Press This and extract it to a plugin. First run.
Props kraftbj, azaozz.
See #41689.

git-svn-id: https://develop.svn.wordpress.org/trunk@41584 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-24 14:21:42 +00:00
Sergey Biryukov
97564616e1 I18N: Allow for post custom field name in the_meta() to be translated, e.g. to insert a non-breaking space before the colon.
Props audrasjb, johnbillion.
Fixes #41653.

git-svn-id: https://develop.svn.wordpress.org/trunk@41583 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-24 11:27:17 +00:00
Weston Ruter
5346347de7 Customize: Remove unnecessary call to refresh() a CodeMirror instance upon focus in Code Editor control.
This also fixes an issue with the cursor not being set in the expected location with an `inputStyle=contenteditable`.

Props afercia.
See #41897.
Fixes #41900.


git-svn-id: https://develop.svn.wordpress.org/trunk@41582 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-23 18:45:49 +00:00
Sergey Biryukov
81551b9e36 Posts, Post Types: Pass $post parameter to post_submitbox_start, attachment_submitbox_misc_actions, media_submitbox_misc_sections, audio_submitbox_misc_sections filters.
Props sebastian.pisula, SergeyBiryukov.
Fixes #36206.

git-svn-id: https://develop.svn.wordpress.org/trunk@41581 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-23 17:06:40 +00:00
Sergey Biryukov
9fc9372d57 Twenty Sixteen: After [41343], add missing space to if condition in twentysixteen_content_image_sizes_attr().
Fixes #38468.

git-svn-id: https://develop.svn.wordpress.org/trunk@41580 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-23 12:24:13 +00:00
Sergey Biryukov
4994c77b28 I18N: Remove HTML tags from translatable strings in wp-activate.php.
Props ramiy.
Fixes #41645.

git-svn-id: https://develop.svn.wordpress.org/trunk@41579 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-23 12:20:39 +00:00
Sergey Biryukov
de9ab629eb Login and Registration: Replace home URL in password reset email with the site name to avoid confusing the user with multiple links.
Props Presskopp, code-monkey.
Fixes #38328.

git-svn-id: https://develop.svn.wordpress.org/trunk@41578 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-23 11:43:28 +00:00
Sergey Biryukov
338cb64a6a Customize: Tweak "New Custom HTML Widget" pointer text to be a bit less informal and more inclusive.
Props birgire, mrasharirfan, danieltj.
Fixes #41798.

git-svn-id: https://develop.svn.wordpress.org/trunk@41577 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-23 11:25:56 +00:00
Sergey Biryukov
bc23b8840d Quick/Bulk Edit: Remove duplicate inline-edit-{$screen->post_type} CSS class from Quick Edit table rows.
Props ibachal.
Fixes #41906.

git-svn-id: https://develop.svn.wordpress.org/trunk@41576 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-23 11:01:45 +00:00
Sergey Biryukov
784d983f59 XML-RPC: Update the string in test_parent_for_nonhierarchical() to match the string added in [41574].
Props netweb.
Fixes #41637.

git-svn-id: https://develop.svn.wordpress.org/trunk@41575 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-23 08:19:54 +00:00
Sergey Biryukov
5af4552f6d I18N: Merge two similar "Cannot set parent term" error strings.
Props ramiy.
Fixes #41637.

git-svn-id: https://develop.svn.wordpress.org/trunk@41574 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-22 22:07:35 +00:00
Sergey Biryukov
b9f3ed82d6 Docs: Add @access private entries for _get_component_from_parsed_url_array() and _wp_translate_php_url_constant_to_key().
Props ajayghaghretiya1.
Fixes #41282.

git-svn-id: https://develop.svn.wordpress.org/trunk@41573 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-22 21:59:55 +00:00
Sergey Biryukov
1d172096cc I18N: Merge two similar error strings.
Props ramiy.
Fixes #39172.

git-svn-id: https://develop.svn.wordpress.org/trunk@41572 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-22 20:54:25 +00:00
Andrew Ozz
5c14c97f9d Plupload: also delete plupload.full.min.js when updating.
See #41755.

git-svn-id: https://develop.svn.wordpress.org/trunk@41571 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-22 20:47:58 +00:00
Andrew Ozz
6971f7565e Plupload: minify and load plupload.js and moxie.js separately to make them easier to debug.
Props gmariani405, azaozz.
Fixes #41755.

git-svn-id: https://develop.svn.wordpress.org/trunk@41570 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-22 20:09:49 +00:00
Sergey Biryukov
b4e9d5a125 Media: Improve the preview of transparent images in Attachment Details modal by using CSS3 to show a checkered background.
Props powerzilly, stevepuddick.
Fixes #41948.

git-svn-id: https://develop.svn.wordpress.org/trunk@41569 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-22 19:56:14 +00:00
Sergey Biryukov
40d47b90cb Admin CSS: Autoprefixer for [41329].
See #39662.

git-svn-id: https://develop.svn.wordpress.org/trunk@41568 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-22 19:50:57 +00:00
Sergey Biryukov
c33e16661d Docs: Correct filename references in duplicate hook comments for post_password_required filter.
Props coffee2code.
Fixes #41959.

git-svn-id: https://develop.svn.wordpress.org/trunk@41567 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-22 18:33:11 +00:00
Sergey Biryukov
3dff531717 Help/About: Tweak Help tabs on Users screen for consistency with Posts screen.
Props bnap00, Arena94.
Fixes #40553.

git-svn-id: https://develop.svn.wordpress.org/trunk@41566 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-22 18:30:10 +00:00
Sergey Biryukov
fa9892a8a3 Embeds: Introduce embed_thumbnail_id filter for thumbnail image ID in the embed template.
Props ketuchetan, Dency, jontyravi, Ov3rfly.
Fixes #39759.

git-svn-id: https://develop.svn.wordpress.org/trunk@41565 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-22 17:34:24 +00:00
Sergey Biryukov
af90dd0682 Docs: Correct description for insert_user_meta filter.
Props milana_cap, desrosj.
Fixes #41951.

git-svn-id: https://develop.svn.wordpress.org/trunk@41564 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-22 13:13:41 +00:00
Sergey Biryukov
0c66c82b7c Taxonomy: Convert tag cloud in Tags meta box to a list (<ul>) for better semantics and accessibility.
An unordered list allows screen reader users to know in advance how many tags are within the list.

Props audrasjb, afercia.
Fixes #40187.

git-svn-id: https://develop.svn.wordpress.org/trunk@41563 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-22 11:27:44 +00:00
Sergey Biryukov
8906b0cdf9 Docs: Change $args to $r in the DocBlock for http_api_debug filter to match the variable name.
Props bor0, ronakganatra.
Fixes #41379.

git-svn-id: https://develop.svn.wordpress.org/trunk@41562 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-22 09:32:30 +00:00
Weston Ruter
8412ff1f44 Plugin Editor: Use include_once instead of include in plugin_sandbox_scrape() to fix unit tests broken with [41560].
See #39766.


git-svn-id: https://develop.svn.wordpress.org/trunk@41561 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-22 02:00:33 +00:00
Weston Ruter
f07591d1fd Plugin Editor: Improve reliability of detecting PHP fatal errors when editing an active plugin.
* Invalidate PHP opcache after file is updated to ensure `include` will ''include'' the written changes.
* Define `WP_ADMIN` when activating plugin in sandbox so plugin code targeting admin will be loaded.
* Do actions that get triggered when loading the admin to ensure plugin code runs that could cause errors on plugin editor screen (and lock out access).
* Fix ability to re-activate a plugin after editing a PHP file other than the main plugin file, and ensure PHP fatal error will be displayed in such cases.
* Consolidate duplicated code into `plugin_sandbox_scrape()` and re-use in `activate_plugin()`.
* Show an error notice instead of a success notice when a file is updated but a plugin was deactivated due to a fatal error.
* Update style of warning when editing an active plugin to be styled as an actual warning notice.

See #12423, #21622.
Fixes #39766.


git-svn-id: https://develop.svn.wordpress.org/trunk@41560 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-22 01:35:09 +00:00
Adam Silverstein
e92db998d2 Revisions: correct a timezone display issue.
When preparing the data for the revisions screen, add ' +0000' to the gmt date string before passing it thru `strtotime`.

Props biranit, nacin, buley.
Fixes #25365.


git-svn-id: https://develop.svn.wordpress.org/trunk@41559 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-21 23:32:25 +00:00
Weston Ruter
a91d3980df Customize: Introduce extensible code editor Customizer control for CodeMirror.
* Adds `WP_Customize_Code_Editor_Control` and `wp.customize.CodeEditorControl()`.
* Control respects user preference for syntax highlighting, showing a textarea when user opts out.
* Code editor control takes the ad hoc code for Additional CSS and makes it reusable and extensible, for Additional CSS in core and plugins to use (such as Jetpack).
* Replace `settings` arg in `wp_enqueue_code_editor()` with separate args for `codemirror`, `csslint`, `jshint`, and `htmlhint`.
* Prefix `codemirror` script and style handles with `wp-` to prevent collisions, as also the object is exported as `wp.CodeMirror` in JS.
* Reduce indent size in Customizer code editor instances and Custom HTML widget to use tab size of 2 instead of 4 to save on space.

See #12423, #38707, #35395.
Fixes #41897.


git-svn-id: https://develop.svn.wordpress.org/trunk@41558 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-21 23:03:06 +00:00
Adam Silverstein
7a5d0cc29b Customizer: retain aspect ration when cropping media w/ shift+click/drag.
Enforce a 1:1 ratio when holding the shift key and dragging in the image cropping tool in the customizer context.

Props melchoyce, mikeschroder.
Fixes #40211.


git-svn-id: https://develop.svn.wordpress.org/trunk@41557 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-21 22:44:38 +00:00
Adam Silverstein
52bdeee37d Login: Password reset - add hide icon & confirm weak password checkbox.
Extends the password features added in 4.3 to the password reset flow.

Props johnbillion, manolis09, umesh.nevase, Nikschavan.



git-svn-id: https://develop.svn.wordpress.org/trunk@41556 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-21 21:28:07 +00:00
Konstantin Obenland
9b7c97af26 Widgets: Improved sidebar mapping on theme switch
Builds on efforts brought forward in #17979.

This will send sidebars through three levels of mapping:

1. If both themes have only one sidebar, that gets mapped.
2. If both themes have sidebars with the same slug, they get mapped.
3. Sidebars that (even partially) match slugs from a similar kind of sidebar will get mapped.

Finally, if the theme has previously been active and we have a record of its 
sidebar configuration then, any unmapped sidebar will be restored to its 
previous state.

Props westonruter, obenland, alexvorn2, timmydcrawford.
See #39693.



git-svn-id: https://develop.svn.wordpress.org/trunk@41555 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-21 18:45:03 +00:00
Andrew Ozz
8436a4f117 Remove SWFUpload,
- Refactor swfupload.js to output a simple upload form, and handlers.js.
- Delete the SWFUpload plugins directory and swfupload.swf.
- Remove flash cookies "hack" from async-upload.php.

See #41752.

git-svn-id: https://develop.svn.wordpress.org/trunk@41554 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-21 16:34:31 +00:00
Adam Silverstein
80c424900e REST API JS Client: Improve nonce handling, refresh stale nonce on sync.
Keep the nonce used for cookie based authentication fresh by pulling in and using any new nonce supplied in the response headers.

* Enable passing nonce to init so each api/endpoint can use a unique nonce.
* Store nonce for endpoint on endpointModel.
* New model helper `nonce()` retrieves a model's routeModel nonce.
* When a response header contains a nonce that doesn't match the stored nonce, replace it.

Fixes #40422.


git-svn-id: https://develop.svn.wordpress.org/trunk@41553 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-21 12:57:16 +00:00
John Blackbourn
40088ea12a Multisite: Correct the docs for maybe_add_existing_user_to_blog().
See #41017


git-svn-id: https://develop.svn.wordpress.org/trunk@41552 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-21 12:27:30 +00:00
Sergey Biryukov
9ad6dab3db Docs: Use correct order of arguments in the DocBlock for WP_Hook::has_filter().
Props munyagu.
Fixes #41941.

git-svn-id: https://develop.svn.wordpress.org/trunk@41551 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-21 09:59:12 +00:00
Weston Ruter
d3c8a675ae Customize: Let media control button labels better automatically reflect the specified MIME type.
Props Christian1012, celloexpressions, westonruter.
Fixes #38796.


git-svn-id: https://develop.svn.wordpress.org/trunk@41550 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-20 21:23:51 +00:00
Weston Ruter
ebb578b2d9 Widgets: Omit attributes from an Image widget's link when they are empty.
Props subrataemfluence, Nenad Obradovic, westonruter.
See #39993.
Fixes #41919.


git-svn-id: https://develop.svn.wordpress.org/trunk@41549 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-20 19:44:13 +00:00
Sergey Biryukov
6d341ef5e5 Twenty Seventeen: Document the type of $item argument in twentyseventeen_dropdown_icon_to_menu_link() more accurately.
Props ndoublehwp.
Fixes #41923.

git-svn-id: https://develop.svn.wordpress.org/trunk@41548 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-20 18:14:13 +00:00