Commit Graph

5472 Commits

Author SHA1 Message Date
Weston Ruter
1cff26c4b7 Customize: Add notice for when there are no nav menus created yet, prompting user to create one.
Props bpayton, melchoyce, westonruter.
Fixes #42116.


git-svn-id: https://develop.svn.wordpress.org/trunk@41823 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-11 05:27:05 +00:00
Dion Hulse
4b2b97a3b3 Upgrades: Remove the usage of each() from WP_Upgrader for PHP 7.2 compatibility.
Props chrisvendiadvertisingcom, dd32.
Fixes #41524


git-svn-id: https://develop.svn.wordpress.org/trunk@41821 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-11 04:23:49 +00:00
Weston Ruter
32e7a51a01 Plugin Editor: Revert superseded changes to activate_plugin() and plugin_sandbox_scrape().
Partially revert [41671], [41561], [41560].
See #21622.
Fixes #39766.


git-svn-id: https://develop.svn.wordpress.org/trunk@41819 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-11 00:02:30 +00:00
Weston Ruter
77c6dc7fd8 Customize: Fix vertical alignment of radio and checkbox inputs after [41740].
Props Shital Patel, subrataemfluence, sayedwp.
Amends [41740].
See #33085.
Fixes #42157.


git-svn-id: https://develop.svn.wordpress.org/trunk@41817 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-10 23:44:35 +00:00
Weston Ruter
89aef850c2 Widgets: Clear dirty flag on widgets admin screen when widget is deleted to prevent irrelevant confirmation prompt when leaving.
Props hazimayesh, felipeelia.
Amends [41352], [41813].
See #23120, #42127.
Fixes #41894.


git-svn-id: https://develop.svn.wordpress.org/trunk@41814 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-10 20:38:22 +00:00
Weston Ruter
6bbf13852b Widgets: Allow deletion even when widget form fails validity checks.
Props felipeelia.
Amends [41352].
See #23120.
Fixes #42127.


git-svn-id: https://develop.svn.wordpress.org/trunk@41813 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-10 18:06:24 +00:00
Mel Choyce
0bf42bf3b7 Customizer: Vertically center section arrows.
Props dualcube_subrata.
Fixes #42123.


git-svn-id: https://develop.svn.wordpress.org/trunk@41808 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-10 16:22:34 +00:00
Weston Ruter
f2f3a883d7 Customize: Improve behavior and extensibility of theme loading and searching.
* Introduce `WP_Customize_Themes_Section::$filter_type`, which has built-in functionality for `local` and `remote` filtering. When this set to `local`, all themes are assumed to be loaded from Ajax when the section is first loaded, and subsequent searching/filtering is applied to the loaded collection of themes within the section. This is how the core "Installed" section behaves - third-party sources with limited numbers of themes may consider leveraging this implementation. When this is set to `remote`, searching and filtering always triggers a new remote query via Ajax. The core "WordPress.org" section uses this approach, as it has over 5000 themes to search.
* Refactor `filterSearch()` to accept a raw term string as input. This enables a feature filter to be used on a section where `filter_type` is `local`.
* Refactor `filter()` on a theme control to check for an array of terms. Also sort the results by the number of matches. Rather than searching for an exact match, this will now search for each word in a search distinctly, allowing things like tags to rank in search results more accurately.
* Split `loadControls()` into two functions for themes section JS: `loadThemes()` to initiate and manage an Ajax request and `loadControls()` to create theme controls based on the results of the Ajax call. If third-party sections need to change the way controls are loaded, such as by using a custom control subclass of `WP_Customize_Theme_Control`, this allows them to use the core logic for managing the Ajax call and only override the actual control-creation process.
* Introduce `customize_load_themes` filter to facilitate loading themes from third-party sources (or modifying the results of the core sections).
* Bring significant improvements to the installed themes search filter.

Props celloexpressions.
Amends [41648].
See #37661.
Fixes #42049.


git-svn-id: https://develop.svn.wordpress.org/trunk@41807 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-10 07:08:51 +00:00
Gary Pendergast
33a0ff50b7 File Editor: Add support for more than one sub-directory level.
The theme and plugin editors now list all files in the selected theme or plugin, recursing through subdirectories as necessary.

Props WraithKenny, schlessera, chsxf, MikeHansenMe, Daedalon, valendesigns, westonruter, pento.
Fixes #6531.



git-svn-id: https://develop.svn.wordpress.org/trunk@41806 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-10 05:33:57 +00:00
Weston Ruter
5deddd9c62 File Editor: Increase robustness of fatal error checking when saving PHP file edits.
* Increase PHP execution time limit prior to issuing loopback requests where are themselves given timeouts to ensure PHP file can be reverted.
* Output scrape messages on success and failure so that absence of either can also be flagged as an error condition.
* Forward browser's HTTP Basic Auth credentials in loopback requests to admin and home URL.
* Display more helpful message when loopback request fails.

Amends [41721].
See #21622.
Fixes #42102.


git-svn-id: https://develop.svn.wordpress.org/trunk@41805 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-10 05:26:53 +00:00
Weston Ruter
52ef606823 Customize: Constrain focus when overlay notification is displayed.
* Restore previously-focused element when overlay notifications are dismissed.
* Allow notifications to be dismissed via keyboard.

Amends [41667].
See #42110, #35210, #39896.


git-svn-id: https://develop.svn.wordpress.org/trunk@41803 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-10 03:33:57 +00:00
Weston Ruter
a4dab604fb Customize: Improve keyboard accessibility for publish settings section.
Props sayedwp.
See #39896.
Fixes #42027.


git-svn-id: https://develop.svn.wordpress.org/trunk@41802 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-09 23:00:39 +00:00
Weston Ruter
0e91bb3610 Customize: Add jsdoc for api.panel, api.section, api.control, and api.notifications collections.
Props shramee, westonruter.
Fixes #39930.


git-svn-id: https://develop.svn.wordpress.org/trunk@41799 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-09 18:55:44 +00:00
Weston Ruter
153dd26c1f Customize: Eliminate use of customize-loader in core so Customizer is opened consistently in top window.
* Open the door for future browser history feature in #28536, which is currently not feasible when customize-loader is used.
* Remove customizer-loader from being used on admin screens for Dashboard, Themes, non-shiny theme install/update.
* Keep the customize-loader functionality available for plugins, for the time being. It may become deprecated.
* Ensure `return` param in customizer links in Themes screen update to reflect `search` updated by `pushState`.
* Persist `return` when reloading Customizer due to theme switch, autosave restoration, or changeset trashing.
* Use `location.replace()` instead of changing `location.href` when trashing.
* Hide theme browser while Themes screen is loading when there is a `search` to prevent flash of unfiltered themes.
* Use throttling instead of debouncing when searching themes to ensure that screen is updated immediately on page load.
* Fix encoding and decoding of `search` param between URL and search field.
* Add support for dismissing autosaves when closing customize-loader, when it is used by plugins.
* Skip sending changeset UUID to customize-loader for population in browser location if changeset branching is not enabled.

See #28536.
Fixes #40254.


git-svn-id: https://develop.svn.wordpress.org/trunk@41797 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-09 16:03:35 +00:00
John Blackbourn
6c1ec3088a Users: Remove some links to the dashboard from My Sites for users who cannot access it.
See #41453


git-svn-id: https://develop.svn.wordpress.org/trunk@41796 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-09 15:21:51 +00:00
John Blackbourn
c8a0c7f7d8 Press This: Use "installation" when referring to the act of installing Press This.
Props Presskopp
Fixes #41620


git-svn-id: https://develop.svn.wordpress.org/trunk@41794 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-09 14:07:42 +00:00
Weston Ruter
6f4866bada Customize: Fix confusion related to visibility of Themes panel with drafted/scheduled changesets.
* Prevent autoloading an existing draft/future changeset when theme not active.
* Add missing notifications container to Themes panel.
* Remove deactivation of themes panel when selected status is not publish.
* Show notification in Themes panel when themes cannot be previewed and disable preview buttons.
* Reject installTheme call when theme preview not available.
* Return promise from installTheme and eliminate use of global events in favor of promises.

Props westonruter, melchoyce, zoonini.
See #37661, #39896.
Fixes #42126.



git-svn-id: https://develop.svn.wordpress.org/trunk@41788 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-07 05:59:45 +00:00
Sergey Biryukov
944d28b6e4 Editor: Fix JSHint errors after [41783].
See #42059.

git-svn-id: https://develop.svn.wordpress.org/trunk@41785 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-06 19:11:35 +00:00
Andrew Ozz
ef701b01e9 Editor:
- Fix keeping text selection and scroll position when there are embeds from URL.
- Add editor setting to disable keeping selection and scroll position.
- Remove dependency on Underscore.js.
- Fix error in the Text widget editor.

Props biskobe.
Fixes #42059, see #40854.

git-svn-id: https://develop.svn.wordpress.org/trunk@41783 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-06 17:43:11 +00:00
Weston Ruter
b7eac77fde Customize: Prevent color default control type from overriding template for ColorControl.
Amends [41771].
See #30738.


git-svn-id: https://develop.svn.wordpress.org/trunk@41778 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-05 14:35:30 +00:00
Weston Ruter
92a4302940 File Editors: Fix JSHint error after [41774].
See #31779.


git-svn-id: https://develop.svn.wordpress.org/trunk@41775 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-05 04:42:58 +00:00
Helen Hou-Sandi
fcf8dfd376 File Editors: Introduce an interstitial warning upon first visit.
This is an effort to provide a speed bump before heading into something potentially destructive and some education for users on better alternatives, even as we make the file editors safer to use. Each user, including existing users, will be shown a one-time dismissible modal warning on their first visit to each of the theme and plugin file editors.

Copy tweaks to come.

props michelleweber, Ipstenu, melchoyce, adamsilverstein, westonruter, toddnestor, aryamaaru, ZaneMatthew, cliffseal, helen.
fixes #31779.


git-svn-id: https://develop.svn.wordpress.org/trunk@41774 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-05 04:24:52 +00:00
Weston Ruter
f23be16bd2 Customize: Add default control template for standard input types.
Re-use default template instead of introducing custom one for the Discard Changes button.

See #30738.


git-svn-id: https://develop.svn.wordpress.org/trunk@41771 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-05 02:55:11 +00:00
Sergey Biryukov
eb4f4bc87e Administration: Add .protected-post-excerpt class to password-protected post excerpts in the posts list.
Props Soean, mp518, slaFFik, SergeyBiryukov.
Fixes #41426.

git-svn-id: https://develop.svn.wordpress.org/trunk@41770 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-05 02:49:15 +00:00
Weston Ruter
fb28cd4663 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@41768 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-05 02:21:22 +00:00
K. Adam White
e4726752ab Widgets: Fix jshint error in media widget.
git-svn-id: https://develop.svn.wordpress.org/trunk@41764 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-05 00:57:08 +00:00
Sergey Biryukov
c5d9fa67a2 Posts, Post Types: Introduce page_attributes_misc_attributes action that fires before the help hint text in the 'Page Attributes' meta box.
Props markcallen, MikeHansenMe.
Fixes #34034.

git-svn-id: https://develop.svn.wordpress.org/trunk@41763 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-05 00:54:22 +00:00
Konstantin Obenland
75ce48ef70 Widgets: Allow oEmbeds in video widget.
Opens up video embeds to all supported video oEmbed providers.

Props westonruter.
See #42039.


git-svn-id: https://develop.svn.wordpress.org/trunk@41759 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-05 00:21:27 +00:00
Gary Pendergast
5c2609bbdb Plugins: Tweak the plugin icons added in [41695].
- Remove plugins icons from the plugin list table, as there were performance issues loading the icons when the site had lots of plugins.
- Depending on which icons the plugin has uploaded, prefer them in this order: `svg`, `128x128`, `256x256`.
- Improve the style of the fallback icon for plugins that don't have an icon defined.

Props Travel_girl, danieltj, afercia, karmatosed,hugobaeta, empireoflight, brentjett, melchoyce, pento.
Fixes #30186.



git-svn-id: https://develop.svn.wordpress.org/trunk@41755 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-04 23:42:55 +00:00
John Blackbourn
645a550129 Users: Revert [41613], [41614], and [41623] as this feature needs some more work.
See #38741


git-svn-id: https://develop.svn.wordpress.org/trunk@41753 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-04 22:16:21 +00:00
westonruter
0cc238c7c7 Customize: Allow controls to be created with pre-instantiated Setting object(s), or even with plain Value object(s).
* Allow passing settings in keyed object (e.g. `settings: { default: 'id' }  ), or as an array (e.g. `settings: [ 'id' ]`) with first being default; again, `Setting`/`Value` objects may be supplied instead of IDs.
* Allow a single setting to be supplied with just a single `setting` param, either a string or a `Setting`/`Value` object.
* Update `changeset_status` and `scheduled_changeset_date` to be added dynamically with JS and simply passing of `api.state()` instances as `setting`.
* Introduce a `data-customize-setting-key-link` attribute which, unlike `data-customize-setting-link`, allows passing the setting key (e.g. `default`) as opposed to the setting ID.
* Allow `WP_Customize_Control::get_link()` to return `data-customize-setting-key-link` when setting is not registered.
* Eliminate `default_value` from `WP_Customize_Date_Time_Control` since now comes from supplied `Value`.
* Export status choices as `wp.customize.settings.changeset.statusChoices`.
* Export date and time formats as `wp.customize.settings.dateFormat` and `wp.customize.settings.timeFormat` respectively.

Props westonruter, sayedwp.
See #39896, #30738, #30741, #42083.
Fixes #37964, #36167.


git-svn-id: https://develop.svn.wordpress.org/trunk@41750 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-04 20:01:12 +00:00
Mike Schroder
0cf7fbf654 Media: Store video creation date in meta.
When able to be parsed, store the created date for a video file from meta,
since this is useful separately from the dates on the file itself.

Introduces `wp_get_media_creation_timestamp()` to read the timestamp from
getID3 and a `wp_read_video_metadata` filter analogous to
`wp_read_image_metadata`.

Fixes #35218.
Props stevegrunwell, joemcgill, desrosj, blobfolio, mikeschroder.

git-svn-id: https://develop.svn.wordpress.org/trunk@41746 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-04 19:31:51 +00:00
Sergey Biryukov
5c928c9c0e Media: Improve the preview of transparent images in Edit Image modal by using CSS3 to show a checkered background.
Props powerzilly, stevepuddick.
Fixes #41966. See #41948.

git-svn-id: https://develop.svn.wordpress.org/trunk@41742 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-04 18:34:44 +00:00
John Blackbourn
bd6ee706d0 Security: Add a referrer policy header to the admin and login screens.
This sets a referrer policy of `same-origin` which adds hardening by preventing a referrer being sent from the admin area or login screens to other origins. This helps prevent unwanted exposure of potentially sensitive information that may be contained within URLs.

This change introduces a new filter, `admin_referrer_policy`, for filtering the referrer policy header value. The header can be disabled if necessary by removing the `wp_admin_headers` action from the `admin_init` and `login_init` hooks.

Props joostdevalk
Fixes #42036


git-svn-id: https://develop.svn.wordpress.org/trunk@41741 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-04 18:24:17 +00:00
westonruter
b1faca5ca8 Customize: Improve accessibility of markup for base WP_Customize_Control and WP_Customize_Nav_Menu_Control with proper use of label elements and inclusion of aria-describedby.
See #33085.
Props valendesigns, afercia, westonruter.


git-svn-id: https://develop.svn.wordpress.org/trunk@41740 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-04 18:11:08 +00:00
Weston Ruter
a0a2a4a105 Customize: Fix theme details modal by updating logic in getPreviousTheme and getNextTheme to not rely on DOM traversal and manually constructing control IDs.
Amends [41726].
See #42083, #37661.


git-svn-id: https://develop.svn.wordpress.org/trunk@41739 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-04 16:48:50 +00:00
Joe McGill
59c0329461 Customizer: Minimize duplicate header crops in the media library.
This adds `Custom_Image_Header::get_previous_crop()`, which finds any
previously cropped headers created from the same base image and replaces
that attachment rather than creating a new attachment.

After updating a crop, the replaced images is also removed from the list
of previous header images in the Customizer.

See #21819.


git-svn-id: https://develop.svn.wordpress.org/trunk@41732 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-04 14:58:07 +00:00
Weston Ruter
3f1de03834 Customize: Improve usability of Customize JS API.
* Eliminate need to pass both ID and instance in calls to `Values#add()` for panels, sections, controls, settings, partials, and notifications.
* Eliminate need to supply `content` param when constructing a `Control`.
* Unwrap the `options.params` object passed in constructors to just pass a flat `options`. (Back-compat is maintained.)
* Add support for `templateId` param for `Control` to override which template is used for the content.
* Remove unused `previewer` being supplied in `Control` instances.
* Rename `classes` to `containerClasses` on `Notification`.
* Automatically supply `instanceNumber` to improve stable sorting.
* Use `api.Notifications` for notifications in settings instead of `api.Value`.

See #30741.
Fixes #42083.


git-svn-id: https://develop.svn.wordpress.org/trunk@41726 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-04 06:47:37 +00:00
Weston Ruter
3fcfefd05c File Editors: Introduce sandboxed live editing of PHP files with rollbacks for both themes and plugins.
* Edits to active plugins which cause PHP fatal errors will no longer auto-deactivate the plugin. Supersedes #39766.
* Introduce sandboxed PHP file edits for active themes, preventing accidental whitescreening of a user's site when introducing a fatal error.
* After writing a change to a PHP file for an active theme or plugin, perform loopback requests on the file editor admin screens and the homepage to check for fatal errors. If a fatal error is encountered, roll back the edited file and display the error to the user to fix and try again.
* Introduce a secure way to scrape PHP fatal errors from a site via `wp_start_scraping_edited_file_errors()` and `wp_finalize_scraping_edited_file_errors()`.
* Moves file modifications from `theme-editor.php` and `plugin-editor.php` to common `wp_edit_theme_plugin_file()` function.
* Refactor themes and plugin editors to submit file changes via Ajax instead of doing full page refreshes when JS is available.
* Use `get` method for theme/plugin dropdowns.
* Improve styling of plugin editors, including width of plugin/theme dropdowns.
* Improve notices API for theme/plugin editor JS component.
* Strip common base directory from plugin file list. See #24048.
* Factor out functions to list editable file types in `wp_get_theme_file_editable_extensions()` and `wp_get_plugin_file_editable_extensions()`.
* Scroll to line in editor that has linting error when attempting to save. See #41886.
* Add checkbox to dismiss lint errors to proceed with saving. See #41887.
* Only style the Update File button as disabled instead of actually disabling it for accessibility reasons.
* Ensure that value from CodeMirror is used instead of `textarea` when CodeMirror is present.
* Add "Are you sure?" check when leaving editor when there are unsaved changes.

Supersedes [41560].
See #39766, #24048, #41886.
Props westonruter, Clorith, melchoyce, johnbillion, jjj, jdgrimes, azaozz.
Fixes #21622, #41887.


git-svn-id: https://develop.svn.wordpress.org/trunk@41721 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-04 00:19:16 +00:00
Felix Arntz
d54e80111a Multisite: Replace calls to refresh_blog_details() with clean_blog_cache().
Fixes #42077. See #40201.


git-svn-id: https://develop.svn.wordpress.org/trunk@41717 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-03 19:04:57 +00:00
John Blackbourn
d72e4fd9aa Plugins: Introduce a singular and plural form for the plugin deletion error message.
Props eddhurst, SergeyBiryukov

Fixes #38918


git-svn-id: https://develop.svn.wordpress.org/trunk@41713 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-03 17:12:41 +00:00
Andrea Fercia
d3f5e2b5dc Accessibility: Change all the #f00 and red to the official WordPress accent red.
WordPress should exclusively use colors from the official colors palette, see
https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
Partially addresses accessibility color contrast ratio issues.

See #35622.


git-svn-id: https://develop.svn.wordpress.org/trunk@41711 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-03 16:01:57 +00:00
Andrea Fercia
679f45c906 Customize: Fix invalid HTML and aria-describedby values.
- fixes invalid HTML and duplicate IDs
- as per the Accessibility coding standards, all new code must use explicitly associated form labels
- properly escapes a few HTML attributes

Props celloexpressions, afercia.
Fixes #42054.


git-svn-id: https://develop.svn.wordpress.org/trunk@41709 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-03 15:43:22 +00:00
Sergey Biryukov
fb06fab2e8 Posts, Post Types: Simplify the wording in post locking notice.
Props munyagu.
Fixes #42023.

git-svn-id: https://develop.svn.wordpress.org/trunk@41706 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-03 15:10:38 +00:00
Sergey Biryukov
609318a22d Comments: Change IP references in moderation option labels and email notifications to IP address for clarity.
Props mako09, gk.loveweb, bradparbs.
Fixes #40382.

git-svn-id: https://develop.svn.wordpress.org/trunk@41704 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-03 13:08:48 +00:00
Weston Ruter
bebc4cde6f Customize: Update dashboard welcome link to point to themes panel in the customizer instead of themes admin screen.
Props celloexpressions.
Fixes #42050.


git-svn-id: https://develop.svn.wordpress.org/trunk@41699 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-03 04:12:51 +00:00
Weston Ruter
2e5f329cc9 Customize: Provide validation feedback for invalid Custom Link URLs in nav menu items.
Props RMarks, EGregor, umangvaghela123, andrew.taylor, celloexpressions, westonruter, voldemortensen.
Fixes #32816.


git-svn-id: https://develop.svn.wordpress.org/trunk@41697 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-03 03:43:01 +00:00
Gary Pendergast
942482993d Plugins: Add plugin icons to the plugin list tables.
To mirror theme list table behaviour, the plugin icon now appears next to plugins in the plugin list tables. For plugins that don't have an icon, or non-W.org plugins, a fallback dashicon is shown.

Props melchoyce, afercia, paulwilde, pento, obenland.
Fixes #30186.



git-svn-id: https://develop.svn.wordpress.org/trunk@41695 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-03 00:24:31 +00:00
Weston Ruter
88db798f62 Customize: Add button in Publish Settings to discard unsaved changes (including drafted and scheduled), reverting Customizer to the last published state.
Props westonruter, melchoyce.
Amends [41667].
See #39896, #21666.


git-svn-id: https://develop.svn.wordpress.org/trunk@41694 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-03 00:21:06 +00:00
John Blackbourn
19c0a55711 Docs: Standardise the format used for documenting parameters passed by reference.
See #35974, #41017


git-svn-id: https://develop.svn.wordpress.org/trunk@41688 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 22:13:04 +00:00
John Blackbourn
dd33fc9301 Docs: Remove & prefixes from parameter documentation to avoid doc parsing errors.
Props sudar for the original patch.

See #35974


git-svn-id: https://develop.svn.wordpress.org/trunk@41686 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 22:01:23 +00:00
Andrea Fercia
e2c4ae805f Quick/Bulk Edit: Improve the inline error messages styling.
- uses the core `notice` styles for the Quick Edit form inline error messages
- adds missing periods at the end of a few error messages

Props ocean90, karmatosed, melchoyce, afercia.
Fixes #35496.


git-svn-id: https://develop.svn.wordpress.org/trunk@41684 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 21:51:09 +00:00
Andrea Fercia
02588452f7 Accessibility: List Tables: use aria-current for the views current link.
The `aria-current` attribute is a simple, effective way to help assistive
technologies users orientate themselves within a list of items. Continues the 
introduction in core of the `aria-current` attribute after [41359] and [41371].

Props joedolson, flixos90, afercia.
Fixes #32399.


git-svn-id: https://develop.svn.wordpress.org/trunk@41683 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 19:43:02 +00:00
Andrea Fercia
54153520f2 Accessibility: Improve the Dashboard Nearby Events widget wp.a11y.speak() messages.
Avoids to announce the "city updated" message on page load.

Fixes #42037.


git-svn-id: https://develop.svn.wordpress.org/trunk@41682 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 19:24:24 +00:00
Weston Ruter
64f0d4a544 Customize: Fix jumping behavior upon scrolling up when a sticky header has its description expanded.
Props delawski.
See #34343, #41879.
Fixes #41850.


git-svn-id: https://develop.svn.wordpress.org/trunk@41679 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 18:54:22 +00:00
Weston Ruter
ba07b22cb5 Customize: Fix positioning of outer section (e.g. publish settings) on large screen sizes.
Also fix preview link CSS for desktop and mobile.

Props sayedwp, bduclos.
See #39896.
Fixes #42051.


git-svn-id: https://develop.svn.wordpress.org/trunk@41677 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 18:39:10 +00:00
Weston Ruter
32a6ac3918 Customize: Improve styling of date/time Customizer control.
* Let date `legend` be screen reader text when time is not included.
* Skip rendering containers for label (title) and description when not supplied in registered control.
* Fix margins and padding.

Amends [41670].
Props westonruter, afercia, sayedwp.
Fixes #42022.


git-svn-id: https://develop.svn.wordpress.org/trunk@41672 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 17:33:10 +00:00
Weston Ruter
e8e027e7a6 Plugin Editor: Remove plugins_loaded from being re-triggered in plugin_sandbox_scrape().
Props jdgrimes.
Amends [41560].
Fixes #39766.


git-svn-id: https://develop.svn.wordpress.org/trunk@41671 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 17:06:46 +00:00
Weston Ruter
ef14cd1952 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@41670 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 04:11:50 +00:00
Weston Ruter
3fbb8ed287 Customize: Add infrastructure for trashing/reverting of unpublished changes; introduce full-screen OverlayNotification for trashing and theme install/preview.
* Introduce a new `wp.customize.previewer.trash()` JS API to trash the current changeset, along with logic to `WP_Customize_Manager` to handle deleting changeset drafts.
* Add `trashing` to `wp.customize.state` which is then used to update the UI.
* UI for trashing is pending design feedback. One possibility is to add a new trash button to Publish Settings section that invokes `wp.customize.previewer.trash()`.
* Improve logic for managing the visibility and disabled states for publish buttons.
* Prevent attempting `requestChangesetUpdate` while processing and bump processing while doing `save`.
* Update `changeset_date` state only if sent in save response.
* Merge `ThemesSection#loadThemePreview()` into `ThemesPanel#loadThemePreview()`.
* Remove unused `autosaved` state.
* Start autosaving and prompting at beforeunload after a change first happens. This is key for theme previews since even if a user did not make any changes, there were still dirty settings which would get stored in an auto-draft unexpectedly.
* Allow `Notification` to accept additional `classes` to be added to `container`.
* Introduce `OverlayNotification` and use for theme installing, previewing, and trashing. Such overlay notifications take over the entire window.

Props westonruter, celloexpressions.
See #37661, #39896, #21666, #35210.


git-svn-id: https://develop.svn.wordpress.org/trunk@41667 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 03:36:18 +00:00
Jeremy Felt
e02c481487 Multisite: Use get_current_blog_id() instead of $wpdb->blogid.
`get_current_blog_id()` is more appropriate for determining the ID of the current site in most cases. This eliminates the need for the global `$wpdb` in several functions and is better than the implicit global used in admin pages.

Props bnap00, spacedmonkey.
Fixes #41684.


git-svn-id: https://develop.svn.wordpress.org/trunk@41661 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 01:43:48 +00:00
Andrea Fercia
7a414342df Accessibility: Improve the Theme Details modal accessibility.
- sets the modal content to `role="document"` to make screen readers switch back to browse mode
- standardizes the Themes screen and Customizer modals interaction
- Themes screen modal: sets initial focus on the modal overlay instead of the primary button, avoiding to "skip" content for keyboard and screen reader users

Fixes #42055.


git-svn-id: https://develop.svn.wordpress.org/trunk@41658 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-01 13:47:29 +00:00
Andrew Ozz
a0692f9597 Editor: Use editor.$ to improve removeSelectionMarker().
See #42029

git-svn-id: https://develop.svn.wordpress.org/trunk@41656 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-01 10:32:58 +00:00
Andrew Ozz
d36c32e299 Editor: pass the DOM library instance instead of a (fake) editor instance to getCursorMarkerSpan().
See #42029

git-svn-id: https://develop.svn.wordpress.org/trunk@41655 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-01 09:41:23 +00:00
Felix Arntz
75c4cb98f4 Multisite: Display correct roles in Network > Site Users screen for sites other than the main site.
Props jeremyfelt.
Fixes #42013.


git-svn-id: https://develop.svn.wordpress.org/trunk@41652 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-30 03:19:26 +00:00
Weston Ruter
743494b654 Customize: Remove unused JS variables to fix JSHint.
Amends [41649].
See #37661, #39896.


git-svn-id: https://develop.svn.wordpress.org/trunk@41650 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-29 22:03:15 +00:00
Weston Ruter
d2540cfa06 Customize: Improve interactions between the Themes panel and Publish Settings section.
* Deactivate the Themes panel immediately after changing selected status to non-publish.
* Animate publish settings button into view with publish button when collapsing Themes panel.
* Deactivate publish settings section and hide publish settings button entirely when customizer state is clean.
* Harden access of Themes panel in case it was removed by plugin.
* Fix throttling of `renderScreenshots` calls in `ThemesSection`.

Amends [41648], [41626].
See #37661, #39896, #34843.


git-svn-id: https://develop.svn.wordpress.org/trunk@41649 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-29 21:51:42 +00:00
Weston Ruter
c35fe07703 Customize: Introduce a new experience for discovering, installing, and previewing themes within the customizer.
Unify the theme-browsing and theme-customization experiences by introducing a comprehensive theme browser and installer directly accessible in the customizer. Replaces the customizer theme switcher with a full-screen panel for discovering/browsing and installing themes available on WordPress.org. Themes can now be installed and previewed directly in the customizer without entering the wp-admin context. Also includes an extensible framework for browsing and installing themes from other sources.

Also includes CSS auto-prefixing added via `grunt precommit:css`.

For details, see: https://make.wordpress.org/core/2016/10/03/feature-proposal-a-new-experience-for-discovering-installing-and-previewing-themes-in-the-customizer/

Previously [38813] but reverted in [39140].
Fixes #37661, #34843, #38666.
Props celloexpressions, folletto, westonruter, karmatosed, melchoyce, afercia.


git-svn-id: https://develop.svn.wordpress.org/trunk@41648 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-29 20:12:19 +00:00
Andrew Ozz
b076026362 Editor: improve attaching a callback on editor init.
See #42029

git-svn-id: https://develop.svn.wordpress.org/trunk@41646 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-29 19:11:08 +00:00
Andrew Ozz
6b72687e10 Editor: Improve keeping text selection when switching between Visual and Text modes.
Props biskobe.
See #42029.

git-svn-id: https://develop.svn.wordpress.org/trunk@41645 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-29 17:49:43 +00:00
Sergey Biryukov
3edd5dac38 I18N: Use a consistent pattern for translator comments for placeholders in wp-admin/includes/dashboard.php.
See #41974.

git-svn-id: https://develop.svn.wordpress.org/trunk@41641 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-29 11:43:27 +00:00
Sergey Biryukov
13b5f8272a I18N: Use a consistent pattern for translator comments for placeholders in Customizer and widget strings.
Props danieltj, Rahmohn.
Fixes #41974.

git-svn-id: https://develop.svn.wordpress.org/trunk@41640 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-29 11:41:06 +00:00
Gary Pendergast
d93dcaf75f Setup: Hide database errors while testing the table prefix.
If DB errors are shown during installation, the table prefix test will also show an error, even though we're deliberately trying to generate that error.

Fixes #40655.



git-svn-id: https://develop.svn.wordpress.org/trunk@41631 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-28 07:57:22 +00:00
Gary Pendergast
98cdd162b2 Post Editor: Keep text selection between Visual and Text modes
When switching between post editor modes, the current cursor position and selection is now preserved. This allows authors to switch modes without losing the context of where they were in the document.

Props biskobe.
Fixes #41962.



git-svn-id: https://develop.svn.wordpress.org/trunk@41630 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-28 06:44:09 +00:00
Gary Pendergast
f5c4c69bf1 Database: Don't quote placeholders in queries going through $wpdb->prepare()
To bring Core into line with the changes to `$wpdb->prepare()` in WordPress 4.8.2, query placeholders shouldn't be quoted.

Props jrf, johnjamesjacoby.
Fixes #41983.



git-svn-id: https://develop.svn.wordpress.org/trunk@41628 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-28 04:31:05 +00:00
Weston Ruter
a92bb89f4f Customize: Introduce drafting and scheduling for Customizer changesets.
* Incorporates code from the Customize Snapshots and Customize Posts feature plugins.
* Adds a new Publish Settings section for managing the changeset status, scheduled date, and frontend preview link.
* Updates Publish button to reflect the status selected in the Publish Settings (including Save Draft and Schedule).
* Deactivates the Themes section when a non-publish status selected, and deactivates the Publish Settings section when previewing a theme switch.
* Introduces an `outer` section type (`wp.customize.OuterSection` in JS) for the Publish Settings section to use and for available widgets and available nav menu panels to use in the future. These sections can be expanded while other sections are expanded.
* Introduces `WP_Customize_Date_Time_Control` in PHP and `wp.customize.DateTimeControl` in JS for managing a date/time value.
* Keeps track of scheduled time and proactively publish from the client when the time arrives, as opposed to waiting for WP Cron.
* Auto-publishes a scheduled changeset when attempting to access one that missed its schedule.
* Starts a new changeset if attempting to save a changeset that was previously publish.
* Adds `force` arg to `requestChangesetUpdate()` to force an update request even when there are no pending changes.
* Adds utils methods for `getCurrentTimestamp` and `getRemainingTime`.
* Adds new state values for `selectedChangesetStatus`, `changesetDate`, `selectedChangesetDate`.
* Fixes logic for when to short-circuit check to close Customizer when there are unsaved changes.
* Adds getter methods for `autosaved` and `branching` parameters, with the latter applying the `customize_changeset_branching` filter.
* Call to `establish_loaded_changeset` on the fly when `changeset_uuid()` is called if no changeset UUID was specififed.
* De-duplicates logic for dismissing auto-draft changesets.
* Includes unit tests.

Builds on [41597].
Props sayedwp, westonruter, melchoyce, JoshuaWold, folletto, stubgo, karmatosed, dlh, paaljoachim, afercia, johnregan3, utkarshpatel, valendesigns.
See #30937.
Fixes #39896, #28721, #39275.


git-svn-id: https://develop.svn.wordpress.org/trunk@41626 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-27 22:24:37 +00:00
Andrea Fercia
def5c946f5 Accessibility: Update and standardize the admin screen-reader-text CSS class.
Given the new WordPress browsers support policy, the `screen-reader-text` css
class used in the admin can be updated to use modern CSS and correct syntax. See
https://github.com/wpaccessibility/a11ythemepatterns/blob/master/read-more-links/style.css

Worth noting the `clip` property is deprecated and kept for IE11 and Edge.

- uses `clip-path` for modern browsers
- keeps `clip` for old browsers and update its value to a correct syntax
- resets `clip-path` to `none` where the class is used to dynamically reveal elements
- removes an old rule that made `screen-reader-text` completely invisible in the help tabs `#screen-meta`
- standardizes the rule across CSS files

Fixes #40970.


git-svn-id: https://develop.svn.wordpress.org/trunk@41622 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-27 17:26:58 +00:00
Andrea Fercia
3e27644b97 Accessibility: Improve the sidebar toggles in the Widgets screen.
- uses button elements for the toggles
- uses `aria-expanded` on the toggles to communicate to assistive technologies the panels expanded/collapsed state
- adds the "circular focus" style to the toggles to give users a clear indication of the currently focused element
- standardizes CSS class names to `.toggle-indicator` and `.handlediv` as these names are already used across the admin for similar controls

Props monikarao, xavortm, mihai2u, Kopepasah.
Fixes #37013.


git-svn-id: https://develop.svn.wordpress.org/trunk@41621 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-27 16:28:59 +00:00
John Blackbourn
e5e17a4eff Taxonomy: Introduce a back_to_items taxonomy label.
This is used after updating a taxonomy term in the link to return to the term listing screen.

Props benoitchantre

Fixes #41898


git-svn-id: https://develop.svn.wordpress.org/trunk@41618 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-27 14:38:40 +00:00
John Blackbourn
301ecdabe4 Options, Meta APIs: Require a confirmation link in an email to be clicked when a user attempts to change the network
admin email address on Multisite.

This mirrors the same functionality for the site admin email address and user profile email address.

Fixes #41254


git-svn-id: https://develop.svn.wordpress.org/trunk@41617 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-27 14:16:21 +00:00
John Blackbourn
1507df9d59 Users: Introduce the concept of a large site in order to speed up the Users screen when there are many users.
Calling the `count_users()` function is expensive, regardless of the counting strategy that's used, and it gets
slower the more users there are on a site. In order to speed up the Users screen in the admin area, calling
`count_users()` can be avoided entirely while still displaying the total count for users.

This introduces some new functions:

* `wp_is_large_user_count()`
* `wp_get_active_user_count()`
* `wp_update_active_user_count()`

A corresponding `wp_is_large_user_count` filter is also introduced.

Props tharsheblows, johnbillion

Fixes #38741


git-svn-id: https://develop.svn.wordpress.org/trunk@41613 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-27 13:03:03 +00:00
Pascal Birchler
0c1d3f62f3 Upgrade/Install: Fix updating plugins on the Add Plugins screen.
Props imath.
Fixes #41407.


git-svn-id: https://develop.svn.wordpress.org/trunk@41612 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-27 11:59:01 +00:00
Pascal Birchler
135ca36a69 Upgrade/Install: Show new version number when updating a theme on Multisite.
Props afragen.
Fixes #40764.


git-svn-id: https://develop.svn.wordpress.org/trunk@41611 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-27 09:43:07 +00:00
Pascal Birchler
0becc4b8db Plugins: Fix version number in docblock after [41608].
Props ocean90.
See #37430.


git-svn-id: https://develop.svn.wordpress.org/trunk@41609 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-27 08:51:25 +00:00
Pascal Birchler
dfaa7de8fb Plugins: Improve error messages on plugins screen.
This unifies the layout and wording of error messages on both the plugins screen and the themes screen.

Props tinkerbelly, juhise, Ankit K Gupta, m1tk00, swissspidy, mrahmadawais, danieltj.
Fixes #37430.


git-svn-id: https://develop.svn.wordpress.org/trunk@41608 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-27 08:45:46 +00:00
Dion Hulse
2ff224a044 Standardise on performing api.WordPress.org requests over SSL when possible, falling back to non-SSL when appropriate.
This also standardises the `User-Agent` used when communicating with WordPress.org, allowing for more consistent version detection.

Fixes #42004.


git-svn-id: https://develop.svn.wordpress.org/trunk@41605 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-27 07:59:14 +00:00
Weston Ruter
9cbcab9457 Customize: Dismiss all autosaved auto-drafts for user and not just the one suggested when dismissing restoration notification.
Amends [41597].
See #39896.


git-svn-id: https://develop.svn.wordpress.org/trunk@41603 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-26 20:32:46 +00:00
Mel Choyce
6cf89abee8 Customizer: Improve small-screen styles in Widgets panel.
Props mrasharirfan, mrahmadawais.
Fixes #41614.


git-svn-id: https://develop.svn.wordpress.org/trunk@41602 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-26 19:04:47 +00:00
Pascal Birchler
f8f263cdb9 Permalinks: Change structure tag button state more reliably.
Changes the highlighted tag buttons accordingly when selecting one of the commong permalink settings.

Deprecates `options_permalink_add_js()` as that JavaScript isn't added inline anymore.

Fixes #29872.


git-svn-id: https://develop.svn.wordpress.org/trunk@41598 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-26 08:23:07 +00:00
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
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
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
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
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
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
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
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
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
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
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
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
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
Dominik Schilling (ocean90)
187f352e9d Taxonomy/Users: Use correct escaping function for URLs.
git-svn-id: https://develop.svn.wordpress.org/trunk@41522 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-19 21:13:32 +00:00
John Blackbourn
64e8c4952a Filesystem API: Ensure filenames are valid before attempting to unzip them to ensure malformed file paths don't cause issues.
git-svn-id: https://develop.svn.wordpress.org/trunk@41457 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-19 14:35:09 +00:00
John Blackbourn
fa4713e898 General: Add missing URL-encoding and add extra hardening to plugin and template names when they're displayed in the admin area.
Props kawauso, Mte90 for initial patches

Fixes #13377


git-svn-id: https://develop.svn.wordpress.org/trunk@41399 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-19 10:10:35 +00:00
Dominik Schilling (ocean90)
7be5b80976 Taxonomy/Users: Provide a fallback for incorrect HTTP referrers.
git-svn-id: https://develop.svn.wordpress.org/trunk@41398 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-19 09:12:27 +00:00
Weston Ruter
ce69e660bd Customize: Add notifications API to sections and panels.
* Adds a `notifications` property to instances of `wp.customize.Panel` and `wp.customize.Section`.
* Adds a `setupNotifications()` method to `Panel`, `Section`, and `Control`.
* Adds a `getNotificationsContainerElement()` method to the `Panel` and `Section` classes, like `Control` has.
* Replace hard-coded notification in header media section with a notification.
* Limit rendering notifications to panels and sections that are expanded, and to controls that have an expanded section.

See #34893, #35210, #38778.
Fixes #38794.


git-svn-id: https://develop.svn.wordpress.org/trunk@41390 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-19 05:39:37 +00:00
Weston Ruter
eab65862b0 Customize: Show notification error with "Your homepage displays" control when homepage and posts page are set to be the same (but not empty).
* Show global error notiafication when saving is blocked due to client-side setting invalidity.
* Refactor `wp.customize.Notifications#render()` to ensure a notification re-renders if its `message` or data changes but its `code` does not.

Props MatheusGimenez, sixhours, westonruter, karmatosed, aocean90, zoonini, michelleweber, melchoyce.
See #35210.
Fixes #21492.


git-svn-id: https://develop.svn.wordpress.org/trunk@41389 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-19 00:45:23 +00:00
Weston Ruter
2d1ac710e2 Code Editor: Remove scrollIntoView of editor's cursor line upon focus to prevent jumping issues for editor scroll position.
See #41850, #41879.


git-svn-id: https://develop.svn.wordpress.org/trunk@41385 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-17 03:57:09 +00:00
Weston Ruter
dced797c3f Code Editor: Scroll the cursor line into view instead of the entire editor when focused.
See #41850.
Fixes #41879.


git-svn-id: https://develop.svn.wordpress.org/trunk@41384 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-17 03:34:47 +00:00
Sergey Biryukov
9bdad8906a Taxonomy: Allow for adding custom list table views to taxonomy screens.
Props eventualo, mariovalney, riddhiehta02, llemurya.
Fixes #30829.

git-svn-id: https://develop.svn.wordpress.org/trunk@41378 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-13 15:19:02 +00:00
Weston Ruter
dbace684e2 Editor: Add CodeMirror-powered code editor with syntax highlighting, linting, and auto-completion.
* Code editor is integrated into the Theme/Plugin Editor, Additional CSS in Customizer, and Custom HTML widget. Code editor is not yet integrated into the post editor, and it may not be until accessibility concerns are addressed.
* The CodeMirror component in the Custom HTML widget is integrated in a similar way to TinyMCE being integrated into the Text widget, adopting the same approach for integrating dynamic JavaScript-initialized fields.
* Linting is performed for JS, CSS, HTML, and JSON via JSHint, CSSLint, HTMLHint, and JSONLint respectively. Linting is not yet supported for PHP.
* When user lacks `unfiltered_html` the capability, the Custom HTML widget will report any Kses-invalid elements and attributes as errors via a custom Kses rule for HTMLHint.
* When linting errors are detected, the user will be prevented from saving the code until the errors are fixed, reducing instances of broken websites.
* The placeholder value is removed from Custom CSS in favor of a fleshed-out section description which now auto-expands when the CSS field is empty. See #39892.
* The CodeMirror library is included as `wp.CodeMirror` to prevent conflicts with any existing `CodeMirror` global.
* An `wp.codeEditor.initialize()` API in JS is provided to convert a `textarea` into CodeMirror, with a `wp_enqueue_code_editor()` function in PHP to manage enqueueing the assets and settings needed to edit a given type of code.
* A user preference is added to manage whether or not "syntax highlighting" is enabled. The feature is opt-out, being enabled by default.
* Allowed file extensions in the theme and plugin editors have been updated to include formats which CodeMirror has modes for: `conf`, `css`, `diff`, `patch`, `html`, `htm`, `http`, `js`, `json`, `jsx`, `less`, `md`, `php`, `phtml`, `php3`, `php4`, `php5`, `php7`, `phps`, `scss`, `sass`, `sh`, `bash`, `sql`, `svg`, `xml`, `yml`, `yaml`, `txt`.

Props westonruter, georgestephanis, obenland, melchoyce, pixolin, mizejewski, michelleweber, afercia, grahamarmfield, samikeijonen, rianrietveld, iseulde.
See #38707.
Fixes #12423, #39892.


git-svn-id: https://develop.svn.wordpress.org/trunk@41376 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-13 06:07:48 +00:00
Weston Ruter
594a41666b Customize: Add global notifications area.
* Displays an error notification in the global area when a save attempt is rejected due to invalid settings. An error notification is also displayed when saving fails due to a network error or server error.
* Introduces `wp.customize.Notifications` subclass of `wp.customize.Values` to contain instances of `wp.customize.Notification` and manage their rendering into a container.
* Exposes the global notification area as `wp.customize.notifications` collection instance.
* Updates the `notifications` object on `Control` to use `Notifications` rather than `Values` and to re-use the rendering logic from the former. The old `Control#renderNotifications` method is deprecated.
* Allows notifications to be dismissed by instantiating them with a `dismissible` property.
* Allows `wp.customize.Notification` to be extended with custom templates and `render` functions.
* Triggers a `removed` event on `wp.customize.Values` instances _after_ a value has been removed from the collection.

Props delawski, westonruter, karmatosed, celloexpressions, Fab1en, melchoyce, Kelderic, afercia, adamsilverstein.
See #34893, #39896.
Fixes #35210, #31582, #37727, #37269.


git-svn-id: https://develop.svn.wordpress.org/trunk@41374 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-12 07:02:49 +00:00
Weston Ruter
6406fb561a Customize: Add rightward-facing back button to Themes section header to improve navigation (since the section slides in from the left).
Also serves to prototype for an upward-facing arrow in this location for a Publish Settings section.

Props melchoyce, westonruter.
See #39896, #40278, #21666.


git-svn-id: https://develop.svn.wordpress.org/trunk@41368 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-11 05:22:22 +00:00
Weston Ruter
7aa34b77e9 Customize: Re-use homepage settings help tab text from Reading Options admin screen in description for corresponding Customizer section.
Also remove "Static" reference in template name, missed in [41363].

See #41829.


git-svn-id: https://develop.svn.wordpress.org/trunk@41364 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-10 17:07:50 +00:00
Weston Ruter
d0dbcf5913 Customize: Rename "Static front page" to just "Homepage".
Props danieltj, melchoyce.
Fixes #41828.


git-svn-id: https://develop.svn.wordpress.org/trunk@41363 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-10 16:19:53 +00:00
Andrea Fercia
3d04cc37a5 Administration: Admin menu: Improve vertical spacing and alignment of menu items with counters.
Props pauldechov, JDTrower.

Fixes #41317.


git-svn-id: https://develop.svn.wordpress.org/trunk@41362 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-10 13:39:13 +00:00
Andrea Fercia
798c1894f4 Administration: Admin menu: Use aria-current for the current active page.
The `aria-current` attribute is a simple, effective way to communicate to assistive
technologies which the current item within a set of items is. While the admin menu
structure isn't 100% ideal (the top-level item is repeated also as a sub-item)
adding `aria-current="page"` to the sub-items gives an important feedback to
assistive technologies users.

This change introduces `aria-current` for the first time in core. Worth noting
there are other places where it can be used to improve accessibility. These should
be addressed in separate tickets and patches.

Fixes #41589.


git-svn-id: https://develop.svn.wordpress.org/trunk@41359 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-09 14:49:53 +00:00
Andrea Fercia
c997d1283f Administration: Thickbox: Fix conflicts with the Plugin details and native Thickbox modals.
The Plugin details modal custom implementation in the Plugins page conflicts with
other Thickbox instances added by plugins. Thickbox shows its age and has been
modified over time to suit core needs. However, WordPress should do its best to
not create conflicts with the native Thickbox styles and functionalities. Plugin
authors should be able to use `add_thickbox()` in any admin page as documented, 
without having to worry about potential errors.

- fixes a JavaScript error when closing a native Thickbox modal in the Plugins page
- avoids to override the native Thickbox modal styles
- uses a CSS class to target the Plugin details modal and remove a pile of overqualified CSS selectors

Fixes #41417.


git-svn-id: https://develop.svn.wordpress.org/trunk@41356 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-09 14:13:28 +00:00
Sergey Biryukov
50ddbc9946 Docs: Remove "to to" dittography from inline comments.
Props birgire.
See #41841.

git-svn-id: https://develop.svn.wordpress.org/trunk@41354 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-09 13:48:47 +00:00
Weston Ruter
f5c342ce76 Widgets: Add dirty state tracking for widgets on admin screen.
* Mark a widget as dirty when a field input triggers a `change` or `input` event; clear dirty state when widget is successfully saved.
* Disable Save button and re-label "Saved" when widget not dirty.
* Show AYS dialog when leaving widgets admin screen with unsaved changes.
* When widgets are dirty, expand all unsaved widgets at AYS check and focus on first one.
* Change "Close" link to "Done"; hide link when widget is dirty and reveal when saved.
* The "Done" link persistently appears in the Customizer even after making a change (when the widget is dirty) because changes are autosaved into the changeset.
* Prevent saving widget when form fails `checkValidity`.
* Fix frequency of triggering of `change` event on the rich Text widget's `textarea` limited now to when there are actual changes.
* Add a class of `widget-dirty` to widget containers when the widget has unsaved changes.

Props westonruter, timmydcrawford, melchoyce.
Fixes #41610, #23120.


git-svn-id: https://develop.svn.wordpress.org/trunk@41352 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-08 19:10:59 +00:00
Sergey Biryukov
357532ab64 Docs: Remove "the the" dittography from inline comments.
Props Presskopp.
Fixes #41835.

git-svn-id: https://develop.svn.wordpress.org/trunk@41350 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-08 18:20:22 +00:00
Felix Arntz
4705b3f27e Multisite: Use get_network() in populate_network() to check whether a network with the given ID already exists.
When multisite is setup already, e.g. in a multi network environment, this change gives a performance benefit over the direct SQL query that was previously used. The SQL query remains in place for when setting up multisite initially as the network API is not available at that point.

Props spacedmonkey.
Fixes #41805.


git-svn-id: https://develop.svn.wordpress.org/trunk@41348 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-08 16:32:39 +00:00
John Blackbourn
7f3deb9988 Embeds: Remove support for oEmbedded videos from Vine.
* Vine effectively shut down in December 2016.
* The oEmbed endpoint no longer works and returns a 404.
* Developer documentation for Vine has been removed.

Fixes #41817


git-svn-id: https://develop.svn.wordpress.org/trunk@41347 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-08 15:00:33 +00:00
Andrew Ozz
085b1411bd Text widget: add the Add Media button and enable the wpview plugin to show embedded media previews in the editor.
Props westonruter, azaozz.
See #40854.

git-svn-id: https://develop.svn.wordpress.org/trunk@41344 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-08 10:56:10 +00:00
Weston Ruter
dd7ffeb4de Widgets: Use word-wrap: break-word for available widget descriptions.
Props metodiew.
Fixes #36207.


git-svn-id: https://develop.svn.wordpress.org/trunk@41339 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-06 18:27:51 +00:00
Andrea Fercia
849cf3efb7 Themes: Prevent the Themes search field default action after [40572].
Props boonebgorges.
Fixes #41803.


git-svn-id: https://develop.svn.wordpress.org/trunk@41337 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-05 17:25:23 +00:00
Dominik Schilling (ocean90)
5f06aaca1c I18N: Allow numbers in locales during installation.
The current regex was a bit to strict for locales like `pt_PT_ao90` which were already supported by `wp_get_installed_translations()`.

Fixes #41794.

git-svn-id: https://develop.svn.wordpress.org/trunk@41335 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-04 19:29:50 +00:00
Andrew Ozz
b1d9cac1fc Plupload: remove the reinstated plupload.js from the list of old files.
Props afercia.
See #41755.

git-svn-id: https://develop.svn.wordpress.org/trunk@41332 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-04 10:21:33 +00:00
Andrea Fercia
207d79af50 Accessibility: Improve the color picker UI accessibility, interaction, and generated markup.
- Refactors the UI controls around the Iris color picker to output valid and semantic markup
- Simplifies the way elements visibility gets toggled
- Properly associates the visually hidden label with the color input field
- Makes the toggle button a real button
- Adds `aria-expanded` to the toggle button
- Keeps focus on the toggle button instead of moving it to the color input field
- Adds `aria-label` attributes to give better context to some controls
- Removes a redundant title attribute
- Keeps the toggle button text to "Select Color" instead of changing it to "Current Color" when a color is selected
- Slightly improves the responsive view
- CSS clean-up

Fixes #39662.


git-svn-id: https://develop.svn.wordpress.org/trunk@41329 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-03 16:01:18 +00:00
Andrew Ozz
55938f0664 Plupload:
- Update to 2.1.9.
- Include the non-minified plupload.js and moxie.js.
- Remove support for Flash and Silverlight, the available runtime options are `html5` and `html4`.
- Delete plupload.flash.swf and plupload.silverlight.xap.

Fixes #41755.

git-svn-id: https://develop.svn.wordpress.org/trunk@41328 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-01 12:27:49 +00:00
Joe McGill
06329dc35e Media: Ensure 'media_handle_upload()' returns 'WP_Error' on failure.
This fixes an issue where failures when inserting the attachment post via
`wp_insert_attachment()` would result in a return value of `0` instead of a
`WP_Error` object, as documented. This is addressed by passing `true` as the 
fourth param (added in WP 4.7.0) when calling `wp_insert_attachment()`.

Props mrasharirfan, flixos90.
Fixes #41726.


git-svn-id: https://develop.svn.wordpress.org/trunk@41323 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-30 15:03:08 +00:00
Sergey Biryukov
481e055db2 Docs: Correct description for view_mode_post_types filter added in [35357].
Props birgire.
Fixes #41730.

git-svn-id: https://develop.svn.wordpress.org/trunk@41317 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-25 19:26:03 +00:00
Ian Dunn
a794678af4 Dashboard: Discontinue nonessential logging of Events API requests.
These log entries are only useful when troubleshooting unexpected results from the API, which is not common. The vast majority of users are better served by not having their logs cluttered with noise.

For the rare situations where troubleshooting is necessary, it can be achieved by a plugin (see #41217 for an example).

Props Howdy_McGee, dd32.
Fixes #41217.


git-svn-id: https://develop.svn.wordpress.org/trunk@41316 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-25 18:11:04 +00:00
Scott Taylor
1d4fa31a99 Docs: improve JS docs for bookmarklet.js
Props andizer, ireneyoast.
Fixes #41547.


git-svn-id: https://develop.svn.wordpress.org/trunk@41313 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-24 17:54:22 +00:00
Scott Taylor
eda1561563 Docs: improve JS docs for tags.js
Props atimmer, jipmoors.
Fixes #41069.


git-svn-id: https://develop.svn.wordpress.org/trunk@41311 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-24 17:51:19 +00:00
Scott Taylor
aec50e2859 Docs: improve JS docs for editor-expand.js
Props IreneYoast, terwdan.
Fixes #41068.


git-svn-id: https://develop.svn.wordpress.org/trunk@41310 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-24 17:47:58 +00:00
Mel Choyce
f3363250d7 Widgets: Add grey background behind image widgets.
When an image in the image widget isn't full-width, it looks like it's floating. This adds a grey background behind images to help ground them in the widget.

Props mrasharirfan.
Fixes #41630.


git-svn-id: https://develop.svn.wordpress.org/trunk@41309 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-23 17:14:25 +00:00
John Blackbourn
3eff05cb88 Widgets: Correctly strip slashes from widget and sidebar names to allow namespaced widgets to function correctly.
Fixes #27770

Props jdgrimes


git-svn-id: https://develop.svn.wordpress.org/trunk@41292 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-22 14:51:47 +00:00
John Blackbourn
9990abec14 Plugins: Introduce singular capabilities for activating and deactivating individual plugins.
This introduces the following meta capabilities:

* `activate_plugin`
* `deactivate_plugin`
* `deactivate_plugins`

The singular `activate_plugin` and `deactivate_plugin` capabilities are used along with the corresponding plugin name when
determining whether or not a user can activate or deactivate an individual plugin.

The plural `deactivate_plugins` capability is used in place of the existing `activate_plugins` capability when determining
whether a user can deactivate plugins.

Each of these new meta capabilities map to the existing `activate_plugins` primitive capability, which means there is no
change in existing behaviour, but plugins can now filter the capabilities required to activate and deactivate individual
plugins.

Fixes #38652 


git-svn-id: https://develop.svn.wordpress.org/trunk@41290 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-22 14:01:36 +00:00
John Blackbourn
8df2151660 General: Improve terminology used when referring to installations of WordPress and its extensions.
"Install" is not a noun, and while it might be acceptable to use the verb as a noun, it is not correct. Using the correct
noun, "installation", increases clarity, especially for non-native English speakers.

This change fixes the usage in user-facing text and in developer documentation.

Fixes #41620


git-svn-id: https://develop.svn.wordpress.org/trunk@41289 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-22 11:51:11 +00:00
John Blackbourn
0613540ea2 Media: Rename several attachment related parameters from $post_id to $attachment_id for clarity, and improve related
documentation.

See #41017


git-svn-id: https://develop.svn.wordpress.org/trunk@41288 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-22 11:11:23 +00:00
Drew Jaynes
8ceaf1e3a4 Docs: Add a missing return description for the deprecated get_screen_icon() function.
See #41017.


git-svn-id: https://develop.svn.wordpress.org/trunk@41275 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-20 04:03:55 +00:00
Drew Jaynes
9bf29bd7a0 Administration: Explicitly deprecate screen_icon() and get_screen_icon(), which were soft-deprecated in [26537] for 3.8.0.
Props ippei-sumida for the initial patch.
Fixes #41153.


git-svn-id: https://develop.svn.wordpress.org/trunk@41274 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-20 04:02:16 +00:00
John Blackbourn
60a3676581 Media: bring the capability check in wp_ajax_crop_image() inline with those in wp_ajax_imgedit_preview() and wp_ajax_image_editor().
This change means that a user can crop an image if they have the ability to edit its attachment post, without requiring the ability to access the Customizer.

Fixes #40193


git-svn-id: https://develop.svn.wordpress.org/trunk@41270 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-19 13:29:03 +00:00
Felix Arntz
5c12afb4e1 Multisite: Use correct capability for the Updates page in the network admin.
A user should not be required to have the `update_core` capability to access the Updates page. Having one of the update capabilities for core, plugins, themes and languages should be sufficient.

Fixes #41538.


git-svn-id: https://develop.svn.wordpress.org/trunk@41269 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-19 10:38:50 +00:00
Felix Arntz
f16b2a650e Role/Capability: Introduce capabilities dedicated to installing and updating language files.
The new meta capabilities are called `install_languages` and `update_languages`. Prior to this change, there were no proper capability checks applied. Instead only the filesystem and related constants were checked, and for actual permissions a rather vague fallback was used where a user needed to have at least one of the other updating capabilities. In addition to being generally more verbose, the new capabilities make it possible for example to allow a user to update languages, but nothing else. By default they fall back to the original way of how they were handled.

Props johnbillion, flixos90.
Fixes #39677.


git-svn-id: https://develop.svn.wordpress.org/trunk@41268 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-18 18:30:28 +00:00
Adam Silverstein
427cec893e Docs: Improve JavaScript documentation in color-picker.js.
Add and improve JSDOC blocks.

Props carolinegeven, jjcomack, jipmoors.
Fixes #41063.




git-svn-id: https://develop.svn.wordpress.org/trunk@41264 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-18 13:09:45 +00:00
Weston Ruter
66ee109e0a Widgets: Prevent visual Text widget from decoding encoded HTML.
Also apply `the_editor_content` filters on widget `text` with `format_for_editor()` as is done for the post editor.

Amends [40631].
Props westonruter, azaozz.
See #35243.
Fixes #41596.


git-svn-id: https://develop.svn.wordpress.org/trunk@41260 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-17 23:36:53 +00:00
Drew Jaynes
0fb490ee1a Filesystem: Introduce the pre_move_uploaded_file filter.
Passing a non-null value to the filter will prevent the uploaded file from being moved to the uploads directory for any of the functions leveraging `_wp_handle_upload()`, such as `wp_handle_upload()` or `wp_handle_sideload()`.

Error reporting related to the file being moved will also be skipped.

Props ryan, Mte90.
Fixes #24603.


git-svn-id: https://develop.svn.wordpress.org/trunk@41258 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-16 21:58:12 +00:00
John Blackbourn
dad257233c Options, Meta APIs: Require a confirmation link in an email to be clicked when an admin attempts to change the site admin email address.
This adds this previously Multisite-only functionality to single site installations too. This change prevents accidental or erroneous email address changes from potentially locking users out of their site.

Props MatheusGimenez, johnbillion

Fixes #39118


git-svn-id: https://develop.svn.wordpress.org/trunk@41254 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-14 20:12:23 +00:00
John Blackbourn
f585095db4 Users: Display the "Your email address has not been updated yet" message when a user changes their profile email address from within network admin.
This ensures continuity with the regular profile editing screen and the user admin profile editing screen.

Fixes #41635


git-svn-id: https://develop.svn.wordpress.org/trunk@41253 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-14 19:41:35 +00:00
Weston Ruter
b0d06b1222 Widgets: Expose link URL input field in Image widget to avoid having to open media modal to discover.
Props timmydcrawford, westonruter.
See #39993.
Fixes #41274.


git-svn-id: https://develop.svn.wordpress.org/trunk@41252 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-14 17:55:24 +00:00
Weston Ruter
21f8256a27 Widgets: Add missing open class for expanded widgets in Customizer; utilize open class for expansion detection in Text and Media widgets.
Fixes #41625.


git-svn-id: https://develop.svn.wordpress.org/trunk@41249 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-13 06:24:28 +00:00
Weston Ruter
8b6b45c96b Customize: Prevent attachment deletions from silently failing in media modals opened for Media widgets.
Amends [40640].
See #32417.
Fixes #41609.


git-svn-id: https://develop.svn.wordpress.org/trunk@41248 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-13 06:10:11 +00:00
Weston Ruter
a29068cb00 Customize: Prevent wide widgets from being displayed as wide when Customizer is displayed in mobile breakpoint.
Fixes #41624.


git-svn-id: https://develop.svn.wordpress.org/trunk@41247 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-13 05:54:07 +00:00
Weston Ruter
cc8cbb38c9 Customize: Update selector to add max-height/max-width for wide widgets to account for JS-driven Text widget and Media widgets.
Fixes #41623.


git-svn-id: https://develop.svn.wordpress.org/trunk@41246 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-13 05:41:34 +00:00
Weston Ruter
3c8584e87f Widgets: Fix extensibility of Text widgets so that JS logic will initialize on subclassed widgets.
Amends [40631].
See #35243.
Fixes #41540.


git-svn-id: https://develop.svn.wordpress.org/trunk@41245 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-13 05:24:14 +00:00
Felix Arntz
440c8692e3 Multisite: Remove references to $wpdb->siteid and use get_current_network_id() instead.
Props sathyapulse, spacedmonkey.
Fixes #41507.


git-svn-id: https://develop.svn.wordpress.org/trunk@41242 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-12 13:10:24 +00:00
Felix Arntz
9595e6c38b Multisite: Rename internal $site_id variables referencing networks to $network_id.
This change improves code clarity by using the current naming conventions for networks.

Props lemacarl.
Fixes #41510.


git-svn-id: https://develop.svn.wordpress.org/trunk@41241 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-12 12:47:38 +00:00
John Blackbourn
db49a16f00 Plugins: Correct and improve docblocks for the various plugin_action_links filters on the Plugins screen.
This also adds a changelog for the removal of the Edit links in [41160].

See #41017
Fixes #38169


git-svn-id: https://develop.svn.wordpress.org/trunk@41231 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-04 22:14:37 +00:00
Andrea Fercia
babec6d399 Menus: Visually hide the menu item edit link text in a consistent way.
Fixes a visual glitch visible on Ubuntu. WordPress uses system fonts and they have
different metrics across operating systems. Uses screen-reader-text as a more
solid way to visually hide text.

Props punit5658, afercia.
Fixes #41497.


git-svn-id: https://develop.svn.wordpress.org/trunk@41227 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 22:12:01 +00:00
flixos90
0dc1e0633b Multisite: Introduce a can_add_user_to_blog filter to prevent adding a user to a site.
Under certain circumstances, it can be necessary that a user should not be added to a site, beyond the restrictions that WordPress core applies. With the new `can_add_user_to_blog` filter, plugin developers can run custom checks and return an error in case of a failure, that will prevent the user from being added.

The user-facing parts and the REST API route that interact with `add_user_to_blog()` have been adjusted accordingly to provide appropriate error feedback when a user could not be added to a site. Furthermore, two existing error feedback messages in the site admin's "New User" screen have been adjusted to properly show inside an error notice instead of a success notice.

Props jmdodd.
Fixes #41101.


git-svn-id: https://develop.svn.wordpress.org/trunk@41225 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 21:40:02 +00:00
John Blackbourn
17fe24286d General: Fix more instances of inconsistent parameters passed to various filters, plus fix some filter docs.
See #38462, #41017


git-svn-id: https://develop.svn.wordpress.org/trunk@41221 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 16:12:25 +00:00
John Blackbourn
a3dec5dd51 General: Fix a typo introduced in [41219].
See #38462


git-svn-id: https://develop.svn.wordpress.org/trunk@41220 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 15:45:14 +00:00
John Blackbourn
3aadc71579 General: Fix various instances of incorrect filter docs and incorrect filter and action parameters.
Props keesiemeijer for identifying the issues

See #38462


git-svn-id: https://develop.svn.wordpress.org/trunk@41219 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 15:42:45 +00:00
John Blackbourn
9f180065d6 Docs: Fix various filter documentation.
See #38462, #41017


git-svn-id: https://develop.svn.wordpress.org/trunk@41215 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 14:33:19 +00:00
John Blackbourn
9296c9025a Networks and Sites: Display an indicator for the active theme or child theme when viewing a site's themes within Network Admin.
Props palmiak, euthelup

Fixes #41168


git-svn-id: https://develop.svn.wordpress.org/trunk@41214 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 13:49:01 +00:00
John Blackbourn
43d241f0c4 Docs: Correct and improve the documentation for the update_option_new_admin_email() function and the new_admin_email_content filter.
See #41017


git-svn-id: https://develop.svn.wordpress.org/trunk@41208 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-02 20:03:29 +00:00
James Nylen
1c28b4a3c8 REST API: Allow overriding jQuery.ajax calls from within wp-admin
There are now 3 places where we call out to the REST API from within wp-admin.  This commit introduces a small library to allow overriding these calls, centralize nonce-passing logic, and eliminate the need to pass a full REST URL down to client code (this last feature is not yet used and will be explored in a separate ticket).

Fixes #40919.


git-svn-id: https://develop.svn.wordpress.org/trunk@41206 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-02 16:44:05 +00:00
Drew Jaynes
bce1b14c9a Docs: Reduce confusion in @since MU notationss by indicating the WP version (3.0.0) the code was merged into core while retaining the original context.
Props sathyapulse.
Fixes #41509.


git-svn-id: https://develop.svn.wordpress.org/trunk@41200 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-01 20:43:25 +00:00
Weston Ruter
a0748817c6 Media: Upgrade MediaElement.js from 2.22.0 to 4.2.3.
Props rafa8626, grosbouff, westonruter, azaozz, Plastikschnitzer for testing.
See #39686.


git-svn-id: https://develop.svn.wordpress.org/trunk@41198 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-01 04:42:58 +00:00
Andrea Fercia
0ac2a97aad Menus: Improve the responsive view for the Menu Name field and Save button.
Props punit5658.
Fixes #41499.


git-svn-id: https://develop.svn.wordpress.org/trunk@41197 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-31 21:21:02 +00:00
Drew Jaynes
83abe4dbfc Docs: Use a third-person singular verb in the DocBlock summary for WP_Importer::stop_the_insanity().
Also add a missing `@since` tag. Introduced in 3.0.0, see [14760].

See #41017.


git-svn-id: https://develop.svn.wordpress.org/trunk@41195 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-30 15:45:50 +00:00
Drew Jaynes
8e453de898 Docs: Add a missing description for the $wpdb global notation in the DocBlock for WP_Importer::stop_the_insanity().
Props tejas5989.
Fixes #41447.


git-svn-id: https://develop.svn.wordpress.org/trunk@41194 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-30 15:42:17 +00:00
Sergey Biryukov
56ba8d18f9 Docs: Replace HTTP links to stackoverflow.com in DocBlocks with HTTPS.
Update the Nginx "Missing (disappearing) HTTP Headers" link.

Props johnpgreen.
Fixes #41331.

git-svn-id: https://develop.svn.wordpress.org/trunk@41189 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-30 14:51:44 +00:00
Sergey Biryukov
ddc6fafd06 Post Formats: In bulk_edit_posts(), set post format before the post is updated, for consistency with edit_post().
This makes sure that plugins hooked to `save_post` get the right post format.

Props Chouby, SergeyBiryukov.
Fixes #41396.

git-svn-id: https://develop.svn.wordpress.org/trunk@41187 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-30 14:40:42 +00:00
Sergey Biryukov
bf39951441 Plugins: In wp_star_rating(), use explicit type casting for $rating to avoid a "non-numeric value encountered" warning in PHP 7.1.
Clarify in the function DocBlock that `$rating` can be a float.

Props afragen.
Fixes #41484.

git-svn-id: https://develop.svn.wordpress.org/trunk@41184 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-29 20:34:26 +00:00
Pascal Birchler
5cb91857ab Permalinks: Remove unnecessary semicolon after [41182].
See #29872.


git-svn-id: https://develop.svn.wordpress.org/trunk@41183 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-28 17:54:11 +00:00
Pascal Birchler
bc2d1f044f Permalinks: Add buttons for the available structure tags to the admin UI.
Often times, it can be confusing to set a custom permalink structure. One has to double-check the documentation, make 
sure to correctly insert the structure tag, and hope not to break their site.

With this addition, the available structure tags are being displayed as a list of easily clickable buttons that can be 
used to insert tags to the custom structure input field and to remove them again.

Props kpdesign, swissspidy, joedolson, afercia.
Fixes #29872.


git-svn-id: https://develop.svn.wordpress.org/trunk@41182 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-28 17:43:00 +00:00
Sergey Biryukov
96d944bcfc Users: After [41027], assign $author_posts_url outside of the condition to simplify the logic.
See #38085.

git-svn-id: https://develop.svn.wordpress.org/trunk@41180 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-28 14:20:22 +00:00
Weston Ruter
43fc92e4a9 Media: Improve acceptance of YouTube /embed/ URLs when inserting in media modal.
Props timmydcrawford.
Fixes #41201.


git-svn-id: https://develop.svn.wordpress.org/trunk@41179 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-28 02:35:56 +00:00
Drew Jaynes
a91dd56c22 Docs: Remove some more top-level @aacess tags from function DocBlocks.
See #414532.


git-svn-id: https://develop.svn.wordpress.org/trunk@41168 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-27 08:18:25 +00:00
John Blackbourn
620eed0cc2 Options, Meta APIs: Send a notification to the old admin email address when the site admin email or network admin email address is changed.
This reduces the chances of a site compromise going unnoticed, in the same way that the same notifications for user account email address changes reduces the chances of a user account compromise going unnoticed.

Props MatheusGimenez, johnbillion

Fixes #39117


git-svn-id: https://develop.svn.wordpress.org/trunk@41164 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-27 02:23:26 +00:00
John Blackbourn
34ee8c9d28 Users: Require a confirmation link in an email to be clicked when a user attempts to change their email address.
This adds this previously Multisite-only functionality to single site installations too. This change prevents accidental or erroneous email address changes from potentially locking users out of their account.

Props rodrigosprimo, tharsheblows, johnbillion

Fixes #16470


git-svn-id: https://develop.svn.wordpress.org/trunk@41163 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-27 02:09:51 +00:00
Drew Jaynes
829139ba1a Docs: Remove @access notations from method DocBlocks in wp-admin/* 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@41161 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-27 00:39:34 +00:00
John Blackbourn
609aaef919 Administration: Remove Edit links from all plugin listing screens and the remaining theme listing screens.
This simplifies these list tables, reducing user confusion, without removing functionality.

Fixes #38169


git-svn-id: https://develop.svn.wordpress.org/trunk@41160 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-26 23:27:47 +00:00
Sergey Biryukov
f3368725ac Upgrade/Install: In WP_Ajax_Upgrader_Skin, call ::get_error_codes() method on a WP_Error object $this->errors instead of a string variable $errors.
Props yrpwayne.
Fixes #41449.

git-svn-id: https://develop.svn.wordpress.org/trunk@41157 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-26 13:38:21 +00:00
Sergey Biryukov
e8f7df4669 Docs: Use 3-digit, x.x.x style semantic versioning for @since 4.8.0 entries.
See #41017.

git-svn-id: https://develop.svn.wordpress.org/trunk@41151 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-25 22:47:27 +00:00
John Blackbourn
850940a7f7 Users: Show a Super Admin label next to Super Admins on all user listing screens when the current user can manage network users.
Fixes #41165


git-svn-id: https://develop.svn.wordpress.org/trunk@41150 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-25 17:42:14 +00:00
Andrea Fercia
5de0d45b90 Administration: WP_Screen: strip all tags from the columns display name.
This ensures all the column titles, not just the Comments column one, are
"clean" when later reused for the Screen Options checkboxes. Also introduces
some consistency with what is already done in WP_List_Table.

Fixes #41261.


git-svn-id: https://develop.svn.wordpress.org/trunk@41148 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-25 16:04:50 +00:00
Sergey Biryukov
5508cdedba Docs: Correct @global entry for $cat_id in WP_Links_List_Table::column_categories().
Props tejas5989.
Fixes #41436.

git-svn-id: https://develop.svn.wordpress.org/trunk@41147 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-25 13:18:20 +00:00
John Blackbourn
44491ba49f Users: Ensure that users with no role on a site are taken into consideration when listing users on Multisite.
This ensures that users who are a member of a site but have no role are correctly listed on the Users screen and can be filtered from the 'None' role filter.

Props tobi823, flixos90, scottlee

Fixes #36196


git-svn-id: https://develop.svn.wordpress.org/trunk@41138 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-25 00:23:44 +00:00
Weston Ruter
0cfe1b9136 Widgets: Rename Text widget's legacy mode to non-visual mode, restore boolean filter prop, and improve compatibility for widget_text filters applied in Custom HTML widget.
Props westonruter, obenland, timmydcrawford for testing.
Amends [41050].
See #35243, #40951, #40907.
Fixes #41394.


git-svn-id: https://develop.svn.wordpress.org/trunk@41132 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-24 22:45:55 +00:00
John Blackbourn
0fdf7fdebf Networks and Sites: Introduce an AYS when bulk deleting sites from the Sites screen in Network Admin.
Props flixos90, MaximeCulea

Fixes #41177


git-svn-id: https://develop.svn.wordpress.org/trunk@41131 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-24 22:40:12 +00:00
John Blackbourn
90583c8360 Users: Don't show the 'Add Existing User' form on the 'Add New User' screen to users without the promote_users capability.
Props bseddon, Mista-Flo

Fixes #37836


git-svn-id: https://develop.svn.wordpress.org/trunk@41122 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-23 01:13:13 +00:00
John Blackbourn
384ac2a367 Administration: Send an appropriate HTTP response status code when an invalid action is passed to admin-ajax.php.
Props ryanrolds, ayeshrajans

Fixes #41269


git-svn-id: https://develop.svn.wordpress.org/trunk@41120 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-23 00:20:37 +00:00
Sergey Biryukov
c66c90a438 Docs: Add a @global entry for $wpdb in get_author_user_ids(), get_editable_authors(), get_editable_user_ids(), get_nonauthor_user_ids(), and get_others_unpublished_posts().
Props parthsanghvi.
Fixes #41368.

git-svn-id: https://develop.svn.wordpress.org/trunk@41111 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-20 14:01:39 +00:00
Sergey Biryukov
6ac73689f4 Docs: Add a @global entry for $wp_filesystem in wp_ajax_install_theme(), wp_ajax_update_theme(), wp_ajax_delete_theme(), wp_ajax_install_plugin(), wp_ajax_update_plugin(), and wp_ajax_delete_plugin().
Props ronakganatra.
Fixes #41382.

git-svn-id: https://develop.svn.wordpress.org/trunk@41110 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-20 13:46:14 +00:00
Sergey Biryukov
06f6f249bc Docs: Add @access entries for WP_Upgrader_Skin::set_upgrader(), ::request_filesystem_credentials(), and ::decrement_update_count().
See #41383.

git-svn-id: https://develop.svn.wordpress.org/trunk@41108 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-20 13:34:07 +00:00
Sergey Biryukov
f62453c06f Docs: Add @access entry for Automatic_Upgrader_Skin::request_filesystem_credentials().
Props rushabh4486.
Fixes #41383.

git-svn-id: https://develop.svn.wordpress.org/trunk@41107 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-20 13:32:19 +00:00
Sergey Biryukov
078f396b17 Docs: Add @access entries for Bulk_Upgrader_Skin::before() and ::after().
Props rushabh4486.
Fixes #41384.

git-svn-id: https://develop.svn.wordpress.org/trunk@41106 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-20 13:24:05 +00:00
Sergey Biryukov
2a4d33f2c6 Docs: Add @access entries for before() and after() methods in Bulk_Plugin_Upgrader_Skin and Bulk_Theme_Upgrader_Skin.
See #41365.

git-svn-id: https://develop.svn.wordpress.org/trunk@41103 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-20 12:08:19 +00:00
Sergey Biryukov
977c0592e0 Docs: Add @access entries for __construct() in WP_Upgrader_Skin, Bulk_Upgrader_Skin, Language_Pack_Upgrader_Skin, Plugin_Upgrader_Skin, and Theme_Upgrader_Skin.
Props rushabh4486.
Fixes #41376.

git-svn-id: https://develop.svn.wordpress.org/trunk@41102 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-20 12:05:34 +00:00
Sergey Biryukov
d27ac87b78 Docs: Add @access entries for feedback() and error() methods in WP_Upgrader_Skin, Bulk_Upgrader_Skin, and Language_Pack_Upgrader_Skin.
See #41365.

git-svn-id: https://develop.svn.wordpress.org/trunk@41101 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-20 11:59:16 +00:00
Sergey Biryukov
dbfa71a638 Docs: Add @access entries for $admin_header_callback and $admin_image_div_callback properties in Custom_Image_Header and Custom_Background.
Props rushabh4486.
Fixes #41377.

git-svn-id: https://develop.svn.wordpress.org/trunk@41100 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-20 11:53:15 +00:00
Sergey Biryukov
348073994e Docs: Correct @access entry for Custom_Image_Header::default_headers.
Props rushabh4486.
Fixes #41378.

git-svn-id: https://develop.svn.wordpress.org/trunk@41099 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-20 11:47:34 +00:00
James Nylen
df386b41a9 About page: Add a privacy policy.
Props MattyRob, johnbillion, swissspidy.
Fixes #40794.


git-svn-id: https://develop.svn.wordpress.org/trunk@41096 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-19 21:41:13 +00:00
Weston Ruter
6e30e93d7f Widgets: Improve Text widget's reliability in syncing Visual tab's contents with Text tab and with hidden sync inputs.
Amends [40631].
Props azaozz, westonruter, rinkuyadav999 for testing.
See #35243.
Fixes #40974 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@41094 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-19 20:48:28 +00:00
Sergey Biryukov
f2adcb8e52 Docs: Add @access entry for Automatic_Upgrader_Skin::feedback().
Props akbarhusen.
Fixes #41365.

git-svn-id: https://develop.svn.wordpress.org/trunk@41091 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-19 11:13:19 +00:00
Weston Ruter
af66f0b03e Widgets: Check for existence of wp.customize.state before attempting to access in Text widget.
Amends [40631].
See #35243.
Fixes #41361 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@41088 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-18 22:35:47 +00:00
Felix Arntz
83af67a0e1 Multisite: Remove help text duplication on Edit Site screens in the network admin.
Prior to this change, the similar help tab and sidebar for these screens were all duplicated for each respective screen. This changeset introduces two internal admin functions `get_site_screen_help_tab_args()` and `get_site_screen_help_sidebar_content()` that make these available in a centralized location.

Props atanasangelovdev.
Fixes #41167.


git-svn-id: https://develop.svn.wordpress.org/trunk@41065 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-17 20:52:26 +00:00
Felix Arntz
ca95a827b8 Multisite: Fix a user-facing message when adding a new site with a new user as admin.
Previously the message would falsely state that the username and password would be sent to the new user. It is actually a link to set the password that they receive in the email.

Props nishitlangaliya.
Fixes #41169.


git-svn-id: https://develop.svn.wordpress.org/trunk@41064 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-17 20:22:08 +00:00
Aaron Jorbin
eb78c8e092 Update autoprefixer browser support matrix
WordPress no longer supports many old old browsers: https://make.wordpress.org/core/2017/04/23/target-browser-coverage/

This also removes alot of no longer necessary CSS. It served us well, but we are never getting back together with IE8,9,10.

So, in the (paraphrased) words of Taylor Swift:

I remember when we dropped support  the first time
Saying, "This is it, I've had enough, " 'cause like
We hadn't seen many users in a month
When you said you needed flexbox. (What?)
Then you postMessage again and say
"IE8, I miss you and I swear I'm gonna change, trust me."
Remember how that lasted for a day?
I say, "I hate the box model, " we break up, you call me, "I love css-grids."
Ooh, we called it off again last night
But ooh, this time I'm telling you, I'm telling you

We are never ever ever supporting IE 8,9,10,
We are never ever ever supporting IE 8,9,10,
You go talk to EDGE, talk to my FIREFOX, talk to CHROME
But we are never ever ever ever getting back together
Like, ever...

Fixes #37651.
Props stunnedbeast, netweb, jorbin.




git-svn-id: https://develop.svn.wordpress.org/trunk@41062 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-16 01:14:36 +00:00
Adam Silverstein
d2e18ea761 Move sanitizeText and stripTags from press this to wp.sanitize.
Introduce the `wp.sanitize` namespace and add two helpers for text sanitization. `stripTags` strips HTML tags from a string using regex.

Fixes #40635.


git-svn-id: https://develop.svn.wordpress.org/trunk@41061 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-15 15:47:16 +00:00
Weston Ruter
e85f291a79 Widgets: Add legacy mode for Text widget and add usage pointers to default visual mode.
The Text widget in legacy mode omits TinyMCE and retains old behavior for matching pre-existing Text widgets. Usage pointers added to default visual mode appear when attempting to paste HTML code into the Visual tab and when clicking on the Text tab, informing users of the new Custom HTML widget.

Props westonruter, melchoyce, gitlost for testing, obenland for testing, dougal for testing, afercia for testing.
See #35243.
Fixes #40951.


git-svn-id: https://develop.svn.wordpress.org/trunk@41050 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-14 17:08:20 +00:00
Sergey Biryukov
7e8d932935 Docs: Add a @global entry for $allowed_files in get_file_description().
Props div33, ajayghaghretiya1.
Fixes #41294.

git-svn-id: https://develop.svn.wordpress.org/trunk@41032 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-12 21:39:37 +00:00
Sergey Biryukov
90aca8c4d7 Docs: Add a @global entry for $wpdb in display_setup_form().
Props mitraval192.
Fixes #41300.

git-svn-id: https://develop.svn.wordpress.org/trunk@41030 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-12 21:02:35 +00:00
Sergey Biryukov
1c017250b7 Users: Add a "View" link to users listed on the Users screen that points to the user's author archive.
Props ryanplas, johnjamesjacoby, viralsampat, Girishpanchal, xkon.
Fixes #38085.

git-svn-id: https://develop.svn.wordpress.org/trunk@41027 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-11 13:29:51 +00:00
Sergey Biryukov
4c5bb9758a Comments: In WP_Comments_List_Table::extra_tablenav(), save the state of ::has_items() to a static variable, so that the value is consistent between top and bottom navigation.
This prevents "Empty Spam" and "Empty Trash" buttons from disappearing if there's only one page of comments in Spam/Trash.

Fixes #40975.

git-svn-id: https://develop.svn.wordpress.org/trunk@41022 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-10 23:04:26 +00:00
Weston Ruter
34c3d7d044 Customize: Restrict click target of menu deletion, moving to button from its container.
Props westonruter, afercia.
Fixes #40981.


git-svn-id: https://develop.svn.wordpress.org/trunk@41020 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-10 18:39:56 +00:00
Andrea Fercia
caf4c06f2a Administration: in WP_List_Table->pagination(), properly concatenate CSS classes for the pagination links when infinite_scroll is set to true.
Props SGr33n.
See #19815.
Fixes #40003.


git-svn-id: https://develop.svn.wordpress.org/trunk@41019 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-09 11:11:03 +00:00
Weston Ruter
8e84510ebb Customize: Fix logic to re-expand a newly inserted nav menu section after placeholder section is replaced.
Fixes todo from Menu Customizer feature plugin: https://github.com/voldemortensen/menu-customizer/commit/0f4ea4e#diff-daa55fade2253f26ccbe02f71058841cR2330
Amends [32806].
Props greuben.
See #32576.
Fixes #40997.


git-svn-id: https://develop.svn.wordpress.org/trunk@41001 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-05 00:43:11 +00:00
Andrew Ozz
05325257c9 Customizer: improve setting the TinyMCE modals z-index.
Props westonruter, greuben.
See #41158.

git-svn-id: https://develop.svn.wordpress.org/trunk@40995 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-03 21:17:26 +00:00
Andrew Ozz
02f0ddc844 TinyMCE: respect the Disable the visual editor when writing user setting and don't output the TinyMCE components when using wp_enqueue_editor().
Fixes #40960 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@40991 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 21:30:10 +00:00
Andrew Ozz
0d9dbc2fea Text widget: bump the TinyMCE modals z-index to 500001 so they show in the Customizer.
Props greuben.
Fixes #41158 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@40990 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 20:32:12 +00:00
Drew Jaynes
de79ff87b3 Docs: Remove a few more superfluous @package WordPress and @subpackage notations outside of file headers missed in [40988].
See #41017.


git-svn-id: https://develop.svn.wordpress.org/trunk@40989 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 17:10:37 +00:00
Drew Jaynes
de87b6d828 Docs: Remove superfluous @package WordPress and @subpackage notations used outside of file headers in a variety of core files.
Per the inline documentation standards for PHP, there should only be one `@package` and/or `@subpackage` notation per file, and only in the file header.

See #41017.


git-svn-id: https://develop.svn.wordpress.org/trunk@40988 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 16:57:13 +00:00
Drew Jaynes
958d29dc68 Docs: Convert an @uses tag in the class DocBlock for Walker_Nav_Menu_Edit to @see.
See #41017.


git-svn-id: https://develop.svn.wordpress.org/trunk@40987 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 16:48:04 +00:00
Drew Jaynes
886e1995c6 Docs: Remove an unnecessary @package tag from the DocBlock for post_preview().
See #41017.


git-svn-id: https://develop.svn.wordpress.org/trunk@40986 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 16:38:49 +00:00
Drew Jaynes
0a9d2d6b8e Docs: Add a valid return type for post_preview() and improve the DocBlock summary.
See #41017.


git-svn-id: https://develop.svn.wordpress.org/trunk@40985 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 16:36:20 +00:00
boonebgorges
2dff153c75 Introduce most_used taxonomy label, for text on 'Most Used' metabox tab.
Props mdifelice, jlambe.
Fixes #41150.

git-svn-id: https://develop.svn.wordpress.org/trunk@40984 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 14:45:02 +00:00
Drew Jaynes
417b094dd4 Users: Introduce the manage_users_extra_tablenav action, fired immediately outside the closing "actions" div in the Users list table tablenav.
A similar `manage_posts_extra_tablenav` hook fires in the same location and context in the Posts list table tablenav.

Props GunGeekATX, adamsilverstein.
Fixes #36990.


git-svn-id: https://develop.svn.wordpress.org/trunk@40974 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 03:01:16 +00:00
Drew Jaynes
63739c5c3d Docs: Provide best practice guidance for achieving parity between $menu_slug values supplied when adding menu and submenu pages, and later trying to compare those initial values against sanitized screen IDs derived from $menu_slug.
At the heart of the matter, the `$menu_slug` parameter in `add_menu_page()` and `add_submenu_page()` is not sanitized with `sanitize_key()`. When the screen object is later built for the admin page, the screen ID is derived from that `$menu_slug` value, though passed through `sanitize_key()`, which can produce unexpected results in comparison check.

Changing the sanitization code to provide actual parity is out of the question at this juncture, so updating the docs to describe how to avoid this edge case is the next best option.

Props GregRoss.
Fixes #35305.


git-svn-id: https://develop.svn.wordpress.org/trunk@40967 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-30 04:17:56 +00:00
Sergey Biryukov
33f8a894cf Administration: In WP_List_Table::comments_bubble(), replace the mdash with its HTML entity for consistency with the similar code in other list tables.
Props afercia.
See #40659, #32152.

git-svn-id: https://develop.svn.wordpress.org/trunk@40960 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-29 00:03:02 +00:00
Sergey Biryukov
021d5ba403 Docs: Add missing backtick character in export_wp() DocBlock.
Props pbiron.
Fixes #41178.

git-svn-id: https://develop.svn.wordpress.org/trunk@40958 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-27 00:57:56 +00:00
Sergey Biryukov
6fa3e5c883 Administration: In taxonomy list tables, display a dash instead of a blank space and add "No description" as a screen reader text when the term description is blank.
Props pratikgandhi, yahil.
Fixes #40659.

git-svn-id: https://develop.svn.wordpress.org/trunk@40957 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-27 00:33:31 +00:00
Sergey Biryukov
c0dc34d4c7 Administration: In user list tables, display a dash instead of a blank space and add "Unknown" as a screen reader text when the user's first name and last name are blank.
Props Girishpanchal, yahil.
Fixes #40628.

git-svn-id: https://develop.svn.wordpress.org/trunk@40956 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-27 00:26:07 +00:00
Felix Arntz
b5668c3527 Multisite: Remove full stops from radio and checkbox labels in the Network Settings screen.
This change brings consistency with the regular site administration panel settings pages: Radio and checkbox labels do not use full stops there, so those in the network administration panel should not either.

Props Ankit K Gupta.
Fixes #39319.


git-svn-id: https://develop.svn.wordpress.org/trunk@40953 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-26 19:19:49 +00:00
Drew Jaynes
704731b9d3 Docs: Replace a variety of http links referenced in inline docs with their https counterparts (where possible).
Props johnpgreen.
Fixes #40732.


git-svn-id: https://develop.svn.wordpress.org/trunk@40948 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-25 22:05:54 +00:00
Weston Ruter
f25d9d7909 Widgets: Add accessibility mode support for TinyMCE-enhanced Text and Media widgets (Video, Audio, Images).
Amends [40640], [40631].
Props westonruter, afercia.
See #35243, #32417.
Fixes #40986.


git-svn-id: https://develop.svn.wordpress.org/trunk@40941 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-25 18:47:13 +00:00
John Blackbourn
d7fc80ca43 Users: Use more appropriate HTTP status codes for errors relating to user management.
Also re-uses one error message string.

Props tuanmh

Fixes #40230


git-svn-id: https://develop.svn.wordpress.org/trunk@40940 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-25 18:45:33 +00:00
Weston Ruter
01efaabfc5 Widgets: Forcibly limit Video widget to only accept oEmbed URLs from YouTube and Vimeo (for now).
Amends [40640].
Props timmydcrawford.
See #34115, #39994.
Fixes #40935.


git-svn-id: https://develop.svn.wordpress.org/trunk@40939 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-25 07:23:52 +00:00