Commit Graph

12866 Commits

Author SHA1 Message Date
Adam Silverstein
274792f9cd REST API: JS client - Enumerate endpoints supporting trash.
Improve the logic determining which endpoints support the trash by enumerating them. Endpoints that don't support the trash require `force=true` when deleting. The previous approach relied on the `force` argument description, which is a translated string and was fragile. In the future, we can expose whether an endpoint supports the trash as part of its schema and automate this logic.

Props Soean.
Fixes #40672.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-31 02:54:48 +00:00
Konstantin Obenland
b61de38e87 Customize: Spiff up theme updates
Fixes UI bugs around theme updates in the Customizer. Theme versions now get updated and users are no longer left alone after a successful update.

Props rinkuyadav999, celloexpressions for initial patch.
Fixes #42365.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41880 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-31 01:33:47 +00:00
Gary Pendergast
8981414082 About page: Tweak the privacy policy language, for clarity.
See #40794.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41879 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-31 00:21:49 +00:00
Mel Choyce
f7aa0e24a7 About Page: Update the blurb in "Warning: Potential Danger Ahead!" to be more accurate.
Props transl8or, karmatosed, chanthaboune.
See #42087.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41878 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-30 20:58:50 +00:00
Felix Arntz
82c6a301f2 Multisite: Pass network object instead of ID to pre_get_main_site_id.
In the original function introduced in [41380], and subsequently [41861], only the network ID was passed to the new `pre_get_main_site_id` filter. In order to make give quick access to other network properties, it was decided to pass the whole object instead. The changeset includes an additional test.

Fixes #29684.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-30 19:56:47 +00:00
Weston Ruter
ca84147401 Customize: Allow 0:00-0:59 in date/time control when 24-hour time used.
* Let min hour be 0 and max be 23 in 24-hour time; let min hour be 1 and max be 12 in 12-hour time.
* Show error notification when an invalid date value is provided, not just when not a future date.
* Fix translation of custom validity message.
* Start checking for validity after all inputs have been initially populated.
* Remove support for being able to enter 24:00.
* Cease forcing date input elements from being casted to integers, to allow for invalid inputs to be detected.

Props westonruter, Presskopp, peterwilsoncc, atachibana for testing.
See #39896, #28721.
Fixes #42373.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-30 16:40:47 +00:00
Weston Ruter
285c6a57c8 Tests: Remove references to deleted JS files in QUnit tests.
Amends [41570], [40584].
See #41755, #40690.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41875 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-30 04:06:48 +00:00
Weston Ruter
fbb0b8bc8f Customize: Debounce requests for theme searches and the updating of the resulting filter count.
Props celloexpressions.
See #37661.
Fixes #42343.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41874 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-30 03:57:52 +00:00
Weston Ruter
9a18c87e0c Customize: Fix phpdoc for params in WP_Customize_Manager::add_section().
Amends [40804].
See #39671.
Fixes #42372.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41873 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-29 03:22:49 +00:00
Weston Ruter
5fc9fddccc Customize: Fix interface alignment between Setting and Control, adding defaults to wp.customize.Setting and using wp.customize.previewer as default previewer param.
Also move jsdoc from class to `initialize` method and correct the param types.

Amends [41726], [42037], [32681].
See #42083, #30737.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41872 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-29 03:08:53 +00:00
Weston Ruter
35172737ef Customize: Support instantiation of partials with flat/unwrapped params for parity with controls, sections, and panels in [41726].
* Passing `options.params` when constructing `Partial` is now deprecated in favor of just passing `options`.
* Improve usage of jsdoc in JS `Partial` class.
* Also add `defaults` property to `wp.customize.selectiveRefresh.Partial` class for parity with `Control`.

See #42083.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-29 00:15:53 +00:00
Weston Ruter
cb7483b595 Customize: Fix mobile placement of panes for available widgets and nav menu items.
Props Mahvash-Fatima.
Amends [41893].
See #42215.
Fixes #42359.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41870 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-28 06:54:47 +00:00
Weston Ruter
84b969efea Customize: Ensure id for section and panel is passed among params to respective templates.
Fixes issue where JS-added Publish Settings section failed to get container element ID set properly to hide its section-meta.

Amends [42025].
See #42337, #42083.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41869 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-28 06:37:47 +00:00
Weston Ruter
685e3c1a67 Customize: Deprecate nav menu classes that are no longer used, instead of removing them immediately.
* Deprecate PHP classes `WP_Customize_New_Menu_Section` and `WP_Customize_New_Menu_Control`.
* Deprecate JS class `wp.customize.Menus.NewMenuControl`.
* Also introduce `wp.customize.Menus.createNavMenu()` for logic to create nav menus separately from the logic for handling UI interactions.

Amends [41768].
See #40104, #42364.
Fixes #42357.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-28 05:48:47 +00:00
Weston Ruter
9dca5ae189 Customize: Fix deep-linking to sections for themes via autofocus[section] query parameter.
* Expand containing panel when expanding themes section.
* Consolidate UI changes related to a section's expanded state change.
* Prevent collapsing current section when expanding.
* Auto-expand first themes section when expanding panel if one is not expanded already.

See #37661, #42354.
Fixes #42360.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-28 05:22:46 +00:00
Gary Pendergast
615a9afab8 Tests: Update wp-api-generated.js.
[41979] caused a change in `wp-api-generated.js`, so it needs to be updated.

See #39996.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41866 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-28 01:56:46 +00:00
Weston Ruter
d348f1624b Customize: Improve Media control accessibility and compatibility for settings passed as arrays or as solitary setting.
* Eliminate Media control template from having dependency on `params.settings.default` for element ID, to fix compat with `params.settings` array or single `params.setting`. See #36167.
* Move description out of label and add `aria-describedby` to Media control's Select button. See #30738, #33085.
* Obtain notification container whenever content is (re-)rendered (such as for Media control). See #38794.
* Re-render notifications after control content is re-rendered, if control is in expanded section. See #38794.

Amends [41390].
See #36167, #38794, #33085, #30738.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41865 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-27 20:18:47 +00:00
Weston Ruter
cb877e10ba Widgets: Prevent showing underlying attachment excerpt as caption when empty caption value is supplied in Image widget.
Allow underlying attachment to display if `caption` is `null`.

Props miyauchi, westonruter.
See #39993.
Fixes #42350.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41864 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-27 05:05:51 +00:00
Weston Ruter
7b0de1f1b0 Themes: Switch back from throttling to debouncing in theme searches on admin screen.
Start debouncing after initial search performed when `search` query param is present to prevent initial "flash of unsearched themes".

Props afercia, westonruter.
Amends [41797].
See #40254.
Fixes #42348.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41863 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-27 03:31:53 +00:00
John Blackbourn
c6fd6b0374 External Libraries: Remove usage of each() from the Text_Diff_Engine_native class.
This removes deprecated notices in PHP 7.2 but takes a different approach to the upstream class from Horde, which appears to be buggy.

Props SergeyBiryukov
Fixes #41526

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


git-svn-id: http://core.svn.wordpress.org/trunk@41862 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-26 12:52:53 +00:00
John Blackbourn
4550ef5b2c External Libraries: Remove usage of text strings in assert() in the Text_Diff_Engine_native class.
See #41526

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


git-svn-id: http://core.svn.wordpress.org/trunk@41861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-26 11:32:48 +00:00
Konstantin Obenland
db00af7cc2 Menus: Add menu-$i slugs to mapping groups
Helps to future proof the feature.
Also orders slugs by popularity to optimize mapping time.

See #39692.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41860 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-25 22:29:49 +00:00
Weston Ruter
a6af74ec32 Customize: Register the Publish Settings section in JS to ensure it does not get unregistered via PHP.
The `publish_settings` section is a fundamental dependency for Customizer, so it must be guaranteed to be registered.

Also unconditionally register core types for panels, sections, and controls in case plugin unhooks all `customize_register` actions.

See #39896.
Fixes #42337.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-25 21:45:49 +00:00
Weston Ruter
3ed6bbf4a4 Customize: Link elements prior to embedding to prevent possible errors when a control is associated with a non-existent section.
Fixes issue specifically with attempting to access an orphaned control's `elements` immediately after it has been added. Normally this would not happen because a control would not be registered without a section, and also a control should only be interacted with once its `embedded` deferred has been resolved.

Also harden logic for gathering list of deferred setting IDs.

See #37964.
Fixes #42330.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41858 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-25 16:49:49 +00:00
Sergey Biryukov
6b3b489a5d Permalinks: Change mention of URI to URL in the description of %category% tag.
Props danieltj, tobifjellner.
Fixes #42147.
Built from https://develop.svn.wordpress.org/trunk@42023


git-svn-id: http://core.svn.wordpress.org/trunk@41857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-25 11:11:45 +00:00
John Blackbourn
7fc62bbd4f External Libraries: Revert [41633]. This causes warnings when editing and viewing certain revisions.
See #41526

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


git-svn-id: http://core.svn.wordpress.org/trunk@41856 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-25 09:56:53 +00:00
Weston Ruter
6794fd18ef Post WordPress 4.9 Beta 4 version bump.
Built from https://develop.svn.wordpress.org/trunk@42021


git-svn-id: http://core.svn.wordpress.org/trunk@41855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-25 07:08:52 +00:00
Weston Ruter
f6bf73792c WordPress 4.9 Beta 4.
Built from https://develop.svn.wordpress.org/trunk@42020


git-svn-id: http://core.svn.wordpress.org/trunk@41854 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-25 06:13:47 +00:00
David A. Kennedy
750098da21 Bundled Themes: Make sure new gallery widgets look good in themes
Twenty Ten: Reduces image size and removes image borders for galleries in widget areas.
Twenty Eleven: Reduces image size and removes image borders for galleries in widget areas.
Twenty Twelve: Reduces image size for some gallery sizes in widget areas.
Twenty Thirteen: Ensure proper clearing for images, hide captions for some gallery column combos and ensure good display for galleries in widget areas.
Twenty Fourteen: Ensure proper clearing for images and hide captions for some gallery column combos for galleries in widget areas.
Twenty Seventeen: Hide captions for some gallery column combos for galleries in widget areas.

Props joyously, williampatton, davidakennedy, melchoyce, crunnells.

Fixes #41969.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-25 02:17:47 +00:00
Weston Ruter
d19c79fa21 Customize: Remove theme_installing notification when installation fails.
Amends [41648].
Props celloexpressions.
See #42184, #37661.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41852 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-25 01:14:46 +00:00
Gary Pendergast
3cd984f024 About page: The link URLs in the privacy policy shouldn't be translatable.
Both of these URLs live on the main wordpress.org site, not Rosetta sites.

See #40794.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41851 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-25 01:07:47 +00:00
iandunn
2762709d2a Dashboard: Strip ports from IPs to avoid PHP warnings.
Fixes #41083.
Props pento, iandunn, EatonZ, birgire, dd32.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41850 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-25 00:07:46 +00:00
Weston Ruter
12c626c82e Update $_old_files to add the deleted MediaElement.js files when it was upgraded from 2.22.0 to 4.2.3.
Amends [41198].
See #39686.
Fixes #42097.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-25 00:02:50 +00:00
Sergey Biryukov
116e4712cb I18N: Use a consistent pattern for translator comments for placeholders in the string added in [42013].
See #41974.
Built from https://develop.svn.wordpress.org/trunk@42014


git-svn-id: http://core.svn.wordpress.org/trunk@41848 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 23:40:46 +00:00
Mel Choyce
7495a110cc Code Editors: Add a persistent notification on CSS files, encouraging people to use the CSS panel in the Customizer instead of editing their CSS files directly.
Props helen, westonruter, nic.bertino, michelleweber.
Fixes #42100.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41847 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 23:35:46 +00:00
Weston Ruter
d96b7af890 Permalinks: Fix placement of structure tags based on last cursor position.
Props felipeelia, afercia.
See #29872.
Fixes #42042.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41846 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 23:27:48 +00:00
John Blackbourn
2f3e91028a Filesystem API: Add more specificity to the rules for valid files in validate_file().
This now treats files containing `./` as valid, and also treats files containing a trailing `../` as valid due to widespread use of this pattern in theme and plugin zip files.

Adds tests.

Props Ipstenu, borgesbruno, DavidAnderson, philipjohn, birgire
Fixes #42016, #36170

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


git-svn-id: http://core.svn.wordpress.org/trunk@41845 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 23:15:49 +00:00
John Blackbourn
16cfe96580 Filesystem API: Don't immediately return an error for invalid file names contained within a Zip while it's being extracted.
This allows the extraction of the rest of the valid files within the archive to continue.

See #42016

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


git-svn-id: http://core.svn.wordpress.org/trunk@41844 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 23:11:50 +00:00
Weston Ruter
48e726bbef Embeds: Improve consistency of update and refresh logic for oEmbed caching between oembed_cache and post meta.
* Allow updating oEmbed cache during `parse-embed` requests for non-post editors (such as widgets).
* Update any existing `oembed_cache` post when `usecache` and TTL has passed.
* Do not overwrite a previously valid cache with `{{unknown}}`.

Props dlh.
See #34115.
Fixes #42310.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 23:10:48 +00:00
Sergey Biryukov
5dd45b38c8 Transients: After [41963], add missing cron task for delete_expired_transients().
Props dlh.
Fixes #41699.
Built from https://develop.svn.wordpress.org/trunk@42008


git-svn-id: http://core.svn.wordpress.org/trunk@41842 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 23:00:47 +00:00
John Blackbourn
4812370aab Docs: Improve the docs for validate_file() and validate_file_to_edit().
See #42016, #36170, #41017

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


git-svn-id: http://core.svn.wordpress.org/trunk@41841 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 22:50:49 +00:00
Sergey Biryukov
29d5ee851c I18N: Use a consistent pattern for translator comments for placeholders in some more Customizer strings.
See #41974.
Built from https://develop.svn.wordpress.org/trunk@42006


git-svn-id: http://core.svn.wordpress.org/trunk@41840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 22:47:46 +00:00
Sergey Biryukov
f156f90ff5 I18N: Add a context for remaining "Schedule" strings.
Props Mirucon.
Fixes #42165.
Built from https://develop.svn.wordpress.org/trunk@42005


git-svn-id: http://core.svn.wordpress.org/trunk@41839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 22:35:47 +00:00
David A. Kennedy
55c8978f1f Twenty Seventeen: Make gallery link styles consistent in all widget areas
Removes the box shadow on gallery links in footer widget areas so they're consistent with the sidebar widget area.

Props transl8or, sami.keijonen, davidakennedy.

Fixes #42302.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 21:53:51 +00:00
Weston Ruter
a1ec65b695 Themes: Harmonize list of theme features on Theme Install screen with list in the Customizer.
Use the core list, rather than the .org API, due to inconsistencies and to ensure tags are translated.

Props celloexpressions.
See #37661, #42306.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41837 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 21:46:47 +00:00
Sergey Biryukov
50c6a55fba I18N: Give context to "Installed" string added in [41648].
Props dimadin.
Fixes #42325.
Built from https://develop.svn.wordpress.org/trunk@42002


git-svn-id: http://core.svn.wordpress.org/trunk@41836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 21:43:47 +00:00
Weston Ruter
fd2e006968 Widgets: Limit container-constraining logic in Text widget to video, iframe, object, and embed elements.
Amends [41779].
See #40854.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41835 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 21:32:46 +00:00
Joe Hoyle
bebb0b0d82 REST API: Don’t remove unregistered properties from objects in schema.
In r41727 the ability to sanitise and validate objects from JSON schema was added, with a whitelist approach. It was decided we should pass through all non-registered properties to reflect the behaviour of the root object in register_rest_route. To prevent arbitrary extra data via setting objects, we force additionalProperties to false in the settings endpoint.

See #38583.
Built from https://develop.svn.wordpress.org/trunk@42000


git-svn-id: http://core.svn.wordpress.org/trunk@41834 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 21:05:49 +00:00
Mel Choyce
c0d0380baa Code Editors: Tweak styles to work better on smaller screens.
See #42100.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41833 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 20:29:46 +00:00
Mel Choyce
9c7eb32fc2 Credits: Update "Contributing Developers" to "Noteworthy Contributors."
"Developers" excludes the various major contributors in non-developer roles, so let's update this term to be more inclusive.

See #41022.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41832 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 19:29:47 +00:00
Weston Ruter
6737643773 Customize: Prevent theme installation and deletion in Customizer while SFTP credentials need to be requested.
This is a temporary measure while we wait for credentials to be able to be supplied in the Customizer.

Amends [41788].
See #42184, #37661, #42126.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41831 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 19:06:47 +00:00
Mel Choyce
b008754486 Code Editors: Update copy in warning modals.
Props helen.
See #42100.

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


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

Props westonruter.
See #39692.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 18:35:48 +00:00
Weston Ruter
7e689f541d Code Editor: Fix phpunit tests related to gutters after [41974].
See #12423.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 16:58:50 +00:00
Ella Iseulde Van Dorpe
abc1579a42 TinyMCE: Set undefined FloatPanel zIndex
See [40995] for the Customizer.
Fixes #42322.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41827 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 16:52:56 +00:00
Weston Ruter
226263bfec Code Editor: Define default gutters and toggle lint markers based on changes to lint option.
Explicitly define `gutters` in base `defaultSettings` to improve merges of multiple calls to `wp_enqueue_code_editor()`.

Props westonruter, georgestephanis for testing.
Amends [41974].
See #12423.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41826 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 16:35:54 +00:00
Sergey Biryukov
9eb75432b6 Canonical: Strip trailing punctuation from permalinks.
Previously attempted in [40256], which caused the test for decoded curly quotes to fail in some environments.

`$_SERVER['REQUEST_URI']` contains the encoded URI, so this version removes the failing tests and only checks for encoded curly quotes.

Props joostdevalk, lancewillett, SergeyBiryukov.
Fixes #20383.
Built from https://develop.svn.wordpress.org/trunk@41991


git-svn-id: http://core.svn.wordpress.org/trunk@41825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 14:18:48 +00:00
Sergey Biryukov
bcdedf7f4a Formatting: Make sure wp_allowed_protocols() is filterable until wp_loaded has fired.
Fixes the issue with plugins not being able to use the `kses_allowed_protocols` filter if `esc_url()` was called too early.

Props turtlepod, SergeyBiryukov.
Fixes #36033.
Built from https://develop.svn.wordpress.org/trunk@41990


git-svn-id: http://core.svn.wordpress.org/trunk@41824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 13:25:55 +00:00
John Blackbourn
2623caf8b0 Docs: Correct a class name in the docs for WP_Customize_Manager::post_value().
See #41017

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


git-svn-id: http://core.svn.wordpress.org/trunk@41823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 11:57:49 +00:00
Sergey Biryukov
4c16522bbe Taxonomy: Use keypress instead of keyup for listening for Enter key to add a tag via Tags meta box.
Fixes issue with Japanese input.

Props miyauchi.
Fixes #42234.
Built from https://develop.svn.wordpress.org/trunk@41988


git-svn-id: http://core.svn.wordpress.org/trunk@41822 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 11:30:49 +00:00
Sergey Biryukov
654386a5b7 Taxonomy: After [40984], add the most_used label for non-hierarchical taxonomies too, and use it on the Menus screen.
Props johnbillion.
Fixes #41150.
Built from https://develop.svn.wordpress.org/trunk@41987


git-svn-id: http://core.svn.wordpress.org/trunk@41821 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 11:23:24 +00:00
Sergey Biryukov
ffddfb573b I18N: Remove <code> and <kbd> tags from translatable strings on Settings screens.
Move URLs to separate strings.

Props ramiy.
Fixes #40763.
Built from https://develop.svn.wordpress.org/trunk@41986


git-svn-id: http://core.svn.wordpress.org/trunk@41820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 10:51:52 +00:00
Weston Ruter
9093718b15 Editor: Specify maxwidth in parse-embed requests based on width of editor iframe so that TinyMCE view embeds fit, particularly in Text widgets.
See #40854, #34115.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41819 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 04:07:50 +00:00
Helen Hou-Sandí
a7f2613fc7 Buttons: Ensure active styling applies to both :active and .active.
props sayedwp, helen.
fixes #42236.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-23 23:34:49 +00:00
Sergey Biryukov
a891bc6c92 Docs: Fix typo in path_is_absolute() description.
Props octalmage, birgire.
Fixes #42317.
Built from https://develop.svn.wordpress.org/trunk@41983


git-svn-id: http://core.svn.wordpress.org/trunk@41817 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-23 22:51:46 +00:00
Weston Ruter
fce310e744 Menus: Don't prime nav menu items cache if a persistent cache is being used.
Amends [14560].
Props david.binda.
See #12734.
Fixes #41662.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-23 22:40:50 +00:00
Mel Choyce
94e74066e9 About Page: Revised strings to be easier to translate.
Props kristastevens, Presskopp, swissspidy.
See #42087.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41815 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-23 22:24:47 +00:00
Peter Wilson
339d838475 Comments: Check if wp_new_comment() returns an error.
Adds checks throughout to allow for `wp_new_comment()` returning a `WP_Error` instance.

Updates the docs for the `pre_comment_approved` filter to include that it can be passed an error.

Props enrico.sorcinelli, ryotsun.
Fixes #39730.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41814 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-23 22:12:51 +00:00
Weston Ruter
29d213cfbd REST API: Allow passing existing template value for posts even when template no longer exists.
Also remove `enum` for validating allowed templates to allow plugins to dynamically supply their own templates for specific posts, even when they are not in the theme.

Props TimothyBlynJacobs, jnylen0, swissspidy.
Fixes #39996.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41813 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-23 22:11:46 +00:00
Aaron Jorbin
b8fc8cb59c Dashboard: Remove "Try Gutenberg" callout.
Reverting this for 4.9. It will be added back in a future version of WordPress. This doesn't mean that you shouldn't be trying Gutenberg, just that it isn't ready for a call out to a larger audience. But if you are the type to read commit messages, https://github.com/WordPress/gutenberg could use your pull requests and comments on issues.

Reverts [41931] [41900] [41896] [41895]
See #41316


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


git-svn-id: http://core.svn.wordpress.org/trunk@41812 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-23 20:48:47 +00:00
Weston Ruter
c364743d35 Code Editor: Add underscore as a dependency for the code-editor script.
Amends [41376].
See #12423.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-23 20:38:47 +00:00
Pascal Birchler
74fc7efbae Themes: Add files missed in [41975].
See #41717.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41810 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-23 20:23:49 +00:00
Pascal Birchler
8222b85aa2 Themes: Show templates from both parent and child theme when calling WP_Theme::get_post_templates().
Props birgire for initial patch.
Fixes #41717.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-23 20:08:47 +00:00
Weston Ruter
0343b1a2c8 Code Editor: Keep linting and its error reporting configured when lint option is changed dynamically.
Also explicitly disable `lint` option for SCSS and LESS.

See #12423.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41808 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-23 19:55:46 +00:00
Konstantin Obenland
91ad9114d0 Customize: Ease extendability of filter drawer
By moving the `wporg` conditional inside the method body, the filter drawer can be overridden without having to also override the entire section template.

Props celloexpressions.
Closes #42212.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41807 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-23 18:58:46 +00:00
Andrea Fercia
69518459e6 Customize: Make sure the FTP credentials modal is visible.
The customizer and the theme installer use `visibility: hidden` on the body when
they open full-overlays screens. The FTP credentials modal needs a visibility
property set back to `visible` to be visible over those overlays.

Props purnendu.
Fixes #42205.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-23 17:54:53 +00:00
Sergey Biryukov
703713756a Tests: Fix typo in test_do_action_with_multiple_callbacks_on_different_priorities().
Props withinboredom.
Fixes #42311.
Built from https://develop.svn.wordpress.org/trunk@41971


git-svn-id: http://core.svn.wordpress.org/trunk@41805 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-23 13:04:49 +00:00
Peter Wilson
ca45ec136f Build/Test tools: Move wp_doing_ajax defintion from class setup to test setup.
Moves defintion of ajax request in `WP_Ajax_UnitTestCase` to `setUp()` method to account for hooks being reset as part of `tearDown()`.

Props matthias.thiel for report.
Fixes #41561.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-23 05:11:47 +00:00
Weston Ruter
990c6d5a42 Customize: Keep frontend preview link updated to reflect the current state of previewed URL, active theme, and autosaved state.
See #39896.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41803 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-23 00:41:47 +00:00
Weston Ruter
5e7e44aba7 Customize: Update 'Save & Activate' reference to 'Publish & Activate' in themes help tab text.
See #39896.
Fixes #42305.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41802 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-22 20:03:51 +00:00
John Blackbourn
74cf14cdf3 Docs: Correct docs introduced in [41965].
See #16778

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


git-svn-id: http://core.svn.wordpress.org/trunk@41801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-21 22:42:51 +00:00
Dion Hulse
cb1b49bca5 Tests: Return an exit code of 1 in the event that the database server for tests is unavailable.
This allows for automated scripts & test suites to handle the failure of the test suite easier.

Props danielbachhuber
Fixes #41916

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


git-svn-id: http://core.svn.wordpress.org/trunk@41800 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-21 14:14:48 +00:00
Gary Pendergast
8608b710b7 Docs: Expand the docs for the core_version_check_query_args filter.
Add documentation for the parameters in the `$query` parameter.

Props MattyRob.
Fixes #16778.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41799 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-21 13:46:50 +00:00
Gary Pendergast
0847fab645 Media: Don't backdate media uploaded to pages.
When media is uploaded to a post, the upload directory is set according to the date of the post, so that the media URLs in the post match when the post was published.

A page is a slightly different beast, pages often live for years, and are regularly updated to stay relevant. This change causes media uploaded to pages to use the upload date to determine the upload directory.

Fixes #10752.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41798 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-21 13:27:48 +00:00
Dion Hulse
26f9c6b909 Transients: Clear expired transients from the database in a daily cron task.
Fixes #41699

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


git-svn-id: http://core.svn.wordpress.org/trunk@41797 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-21 13:22:49 +00:00
Gary Pendergast
f7fcb2cd5b Updates: Add the core_version_check_query_args filter.
This filter allows the data being sent for core update checks to be controlled for privacy concerns.

Props toscho, MattyRob, swissspidy, pento.
Fixes #16778.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41796 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-21 11:55:47 +00:00
Weston Ruter
0c1c0980e7 Customize: Improve back-compat for wp.customize.Control subclasses that expect options.params to be present for direct manipulation before calling parent initialize method.
Fixes known incompatibility with Make theme.

Amends [41726].
See #30741.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41795 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-21 08:51:48 +00:00
Weston Ruter
1f735509af Customize: Allow control subclasses to add to the deferred object before the base class initializes.
Update the `CodeEditorControl`'s `codemirror` deferred to be set before calling the parent class's `initialize` method. Since the `ready` method may be called directly by `initialize` it may be too late to add a new `Deferred` to the control's `deferred` property after calling the base control class's `initialize`.

Amends [41958].
See #41897.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41794 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-21 08:44:52 +00:00
Sergey Biryukov
45655bb928 Docs: Document $wp_version global in wp_initial_constants().
Props mt8.biz.
Fixes #42259.
Built from https://develop.svn.wordpress.org/trunk@41959


git-svn-id: http://core.svn.wordpress.org/trunk@41793 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-20 22:04:56 +00:00
Weston Ruter
47c555f8ed Customize: Add codemirror deferred object to CodeEditorControl which is resolved when CodeMirror is initialized.
CodeMirror gets initialized once the control's containing section is expanded. The deferred will be rejected if user preference for syntax highlighting is disabled.
Also move jsdoc from `wp.customize.Control` to intended `wp.customize.Control#initialize()`.

See #41897, #12423.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-20 21:48:46 +00:00
Weston Ruter
81c87e7d5e Code Editor: Improve ability to create Customizer CodeEditorControl instances in JS, lessening PHP dependencies.
Allow `CodeEditorControl` to be instantiated with a `editor_settings` param which is merged with `wp.codeEditor.defaultSettings`.

Also:

* Turn redundant "CSS Code" control label into screen reader text for Additional CSS.
* Remove `code-editor` as script dependency for `custom-html-widgets` since enqueueing is determined by `wp_enqueue_code_editor()`.
* Remove useless exporting of `code_type` param to JS in `WP_Customize_Code_Editor_Control`.
* Add `disabled` class to Custom HTML widget's Save button when linting errors are present.
* Remove redundant `span` inside CodeEditorControl's `label`.

See #41897, #12423, #41872.

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


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


git-svn-id: http://core.svn.wordpress.org/trunk@41790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-20 14:07:47 +00:00
Sergey Biryukov
f80db51d0f Menus: Remove an extra space in the <ul> tag in Walker_Nav_Menu::start_lvl().
Fixes #42289.
Built from https://develop.svn.wordpress.org/trunk@41955


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

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


git-svn-id: http://core.svn.wordpress.org/trunk@41788 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-20 10:34:49 +00:00
Mel Choyce
4d41bf7127 Customization Locking: Update error message to use existing strings.
Props ramiy.
See #42024.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-20 10:32:53 +00:00
Weston Ruter
a402312a8d Customize: Prevent using default template for a base control when it has content rendered on the server.
Also prevent invalid `type` attribute from being added to a `select` element.

See #30738.
Fixes #42286.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41786 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-20 03:30:46 +00:00
Weston Ruter
6913ad9219 Widgets: Improve extensibility of the Gallery widget and of media widgets generally.
* Introduce a `widget_{$id_base}_instance_schema` filter for plugins to add new properties to a media widget's instance schema.
* Pass all of a gallery widget's instance props to the gallery media frame, not just the ones that core supports.

See #32417, #41914.
Fixes #42285.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-19 23:44:48 +00:00
Weston Ruter
ea21ad6cc1 Customize: Prevent re-highlighting "Add Items" button after available nav menu items pane has already been opened.
Amends [41930].
Props bpayton.
See #42114.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41784 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-19 18:38:47 +00:00
Weston Ruter
c8105f1460 Customize: Fix alignment of Customize, Activate, and Live Preview buttons appearing on the Themes admin screen.
Amends [41893].
Props Mahvash-Fatima.
See #42215.
Fixes #42275.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-19 18:10:47 +00:00
Weston Ruter
d695648084 Customize: Fix rendering issues in theme browsing when opening theme details or performing search in Safari.
Props sayedwp.
See #37661.
Fixes #42052.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41782 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-19 17:57:47 +00:00
Weston Ruter
b1a9139b46 Customize: Prevent drawing attention to save button if status unchanged from publish; account for changes to status/date when alerting about unsaved changes.
Also fix malformed ESLint directive from [41933].

Amends [41932].
See #39896, #42211.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41781 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-19 17:42:54 +00:00
Gary Pendergast
609da14d59 About page: Update the privacy policy dashes.
If one were to insert 1—3 dashes into a sentence - on purpose - they should use the correct da–
sh.

See #40794.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41780 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-19 15:36:47 +00:00
John Blackbourn
06eba419fe Build/Test tools: Document the return value of WP_UnitTestCase::factory().
See #41017

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


git-svn-id: http://core.svn.wordpress.org/trunk@41779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-19 15:33:48 +00:00
Gary Pendergast
31a3c8e744 About page: Update the privacy policy language.
See #40794.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41778 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-19 15:26:48 +00:00
Mel Choyce
02ff01d331 About Page: Commit initial strings for 4.9.
Props kristastevens, dd32, hlashbrooke.
See #42087.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-19 13:57:48 +00:00
Sergey Biryukov
3aa0c23274 Docs: After [37329], update the documentation for register_widget() and unregister_widget().
Both functions can accept a `WP_Widget` instance object instead of a `WP_Widget` subclass name, same as `WP_Widget_Factory::register()` and `::unregister()`.

Props behzod.
Fixes #42270.
Built from https://develop.svn.wordpress.org/trunk@41942


git-svn-id: http://core.svn.wordpress.org/trunk@41776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-19 13:51:50 +00:00
Sergey Biryukov
1accb992f8 Menus: Pass $recent_args parameter to nav_menu_items_{$post_type_name}_recent filter.
Props welcher, eclev91.
Fixes #39849.
Built from https://develop.svn.wordpress.org/trunk@41941


git-svn-id: http://core.svn.wordpress.org/trunk@41775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-19 13:05:55 +00:00
Sergey Biryukov
9c4fb24458 Docs: Reference WP_Comment_Query::__construct() as the source of information on accepted arguments in get_comments() and get_approved_comments().
See #41017.
Built from https://develop.svn.wordpress.org/trunk@41940


git-svn-id: http://core.svn.wordpress.org/trunk@41774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-19 08:49:47 +00:00
Weston Ruter
bdefa6bf34 Post WordPress 4.9 Beta 3 version bump.
Built from https://develop.svn.wordpress.org/trunk@41939


git-svn-id: http://core.svn.wordpress.org/trunk@41773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-19 05:08:48 +00:00
Weston Ruter
0ae160dec1 WordPress 4.9 Beta 3.
Built from https://develop.svn.wordpress.org/trunk@41938


git-svn-id: http://core.svn.wordpress.org/trunk@41772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-19 04:43:48 +00:00
Joe McGill
d21f6799a6 Customizer: Improve handling of crops in the media library.
This is a follow up on r41732, implementing the following improvements:

* Attachment parent info is now stored in attachment meta rather than a 
separate post meta key.
* Attachments created from contextual crops (e.g. header, logos, etc.) are
filtered out of the media library using a new `_filterContext` method in
`wp.media.controller.Library`.

Props joemcgill, westonruter.
See #21819.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-19 04:18:47 +00:00
Weston Ruter
20aad6b5c5 Customize: Consistently use input_attrs as control param key in JS instead of inputAttrs.
See #30738, #41897.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41770 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-19 03:25:47 +00:00
Weston Ruter
f8d16c8aed Customize: Move control's fallback selection of default content template to renderContent method to align with sections and panels.
* Only use default control content template when a more specific template doesn't exist.
* Remove extraneous whitespace from being output in `WP_Customize_Control::render()` method.
* Move Custom Header template printing to `customize_controls_print_footer_scripts` action.

See #30738.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-19 03:04:49 +00:00
Sergey Biryukov
c81acd7cef I18N: Unify permission error message in wp-admin/ms-delete-site.php.
Props ramiy.
Fixes #42268.
Built from https://develop.svn.wordpress.org/trunk@41934


git-svn-id: http://core.svn.wordpress.org/trunk@41768 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-19 00:48:50 +00:00
Weston Ruter
887998f7ed Widgets: Harden logic for checking for valid media URLs.
* Update deprecated `isHostedVideo` method to always return `true` since all oEmbeds are now supported.
* Disable `scanImage` for non-image media widgets.
* Ensure embed URL field element is matched from current media frame instance due to bug where media frames are not destroyed upon closing.
* Update error message for invalid video URLs to ask user to check the URL for validity.

Props gk.loveweb, octalmage, westonruter.
See #42039, #40935.
Fixes #41052.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41767 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-19 00:07:54 +00:00
Weston Ruter
ed686152f5 Customize: Draw attention to save button after collapsing the publish settings section when the changeset status or date had been changed.
Props bpayton, westonruter.
See #42114, #39896.
Fixes #42211.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41766 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 23:06:49 +00:00
Sergey Biryukov
15c8976cc4 Dashboard: Add missing URL to "Help with testing" link in Gutenberg callout.
See #41316.
Built from https://develop.svn.wordpress.org/trunk@41931


git-svn-id: http://core.svn.wordpress.org/trunk@41765 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 22:41:46 +00:00
Weston Ruter
b65d6eb680 Customize: Draw attention to "Add Items" button after creating a new menu.
Introduce `wp.customize.utils.highlightButton()` and `wp.customize.Menus.MenuSection#highlightNewItemButton()`.

Props bpayton, melchoyce, afercia, westonruter.
Fixes #42114.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41764 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 22:00:50 +00:00
Sergey Biryukov
71dca590dc Build/Test Tools: Clean up $_REQUEST and $GLOBALS after modifying them in _test_list_hierarchical_page().
Props birgire.
Fixes #42044.
Built from https://develop.svn.wordpress.org/trunk@41929


git-svn-id: http://core.svn.wordpress.org/trunk@41763 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 21:48:48 +00:00
Sergey Biryukov
0f06f90341 Rewrite Rules: Remove redundant if condition in extract_from_markers().
Props Dency, yahil, appchecker.
Fixes #39920.
Built from https://develop.svn.wordpress.org/trunk@41928


git-svn-id: http://core.svn.wordpress.org/trunk@41762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 21:28:46 +00:00
Sergey Biryukov
0afafb7a1b I18N: Unify error messages in XML-RPC methods wp_deleteCategory() and wp_deleteComment().
Props ramiy.
Fixes #39019.
Built from https://develop.svn.wordpress.org/trunk@41927


git-svn-id: http://core.svn.wordpress.org/trunk@41761 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 21:12:51 +00:00
Sergey Biryukov
50db4bceb0 Administration: After [41120], check for a registered action before sending a Bad Request HTTP response status code.
Props Clorith.
Fixes #42240.
Built from https://develop.svn.wordpress.org/trunk@41926


git-svn-id: http://core.svn.wordpress.org/trunk@41760 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 21:01:49 +00:00
Sergey Biryukov
469e37446e Menus: Remove unnecessary top margin for menu item type on Menus screen for correct alignment with the dropdown icon.
Props punit5658.
Fixes #41521.
Built from https://develop.svn.wordpress.org/trunk@41925


git-svn-id: http://core.svn.wordpress.org/trunk@41759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 20:52:49 +00:00
Sergey Biryukov
d2499c4212 Network Admin: After [41923], move the second <p> tag to a new line for better readability.
See #41652.
Built from https://develop.svn.wordpress.org/trunk@41924


git-svn-id: http://core.svn.wordpress.org/trunk@41758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 20:51:48 +00:00
Sergey Biryukov
a749494900 I18N: Remove hardcoded constant from a translatable string in network_step1().
Props ramiy.
Fixes #41652.
Built from https://develop.svn.wordpress.org/trunk@41923


git-svn-id: http://core.svn.wordpress.org/trunk@41757 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 20:02:50 +00:00
Sergey Biryukov
73dc2a45e3 Docs: Document $ini_all staticvar in wp_is_ini_value_changeable().
Props nileshdudakiya94.
Fixes #41399.
Built from https://develop.svn.wordpress.org/trunk@41922


git-svn-id: http://core.svn.wordpress.org/trunk@41756 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 19:54:48 +00:00
Sergey Biryukov
106beec6a7 I18N: Combine two "Warning" strings in network_step1() and network_step2().
Props ramiy.
Fixes #38570.
Built from https://develop.svn.wordpress.org/trunk@41921


git-svn-id: http://core.svn.wordpress.org/trunk@41755 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 19:50:47 +00:00
Sergey Biryukov
eac62c8da0 Date/Time: Use delta comparison in get_gmt_from_date() tests to avoid race conditions.
Props keesiemeijer.
Fixes #38815.
Built from https://develop.svn.wordpress.org/trunk@41920


git-svn-id: http://core.svn.wordpress.org/trunk@41754 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 19:42:48 +00:00
Weston Ruter
9cb9695104 Customize: Fix visibility of overlay notifications in Safari.
Props sayedwp, westonruter.
Amends [41390].
See #35210, #42024, #42052.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 18:14:37 +00:00
Felix Arntz
4cb1026757 Multisite: Document all return types in get_networks().
Adds more complete documentation to get_networks() and the corresponding methods in WP_Network_Query.

Fixes #42260.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41752 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 18:13:50 +00:00
Sergey Biryukov
0fc7597032 Docs: Document $default_scripts parameter in _WP_Editors::enqueue_scripts().
Props danieltj, ajayghaghretiya1.
Fixes #41322.
Built from https://develop.svn.wordpress.org/trunk@41917


git-svn-id: http://core.svn.wordpress.org/trunk@41751 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 18:09:47 +00:00
Sergey Biryukov
a28bd1d36c Plugins: Revert unintended change from [41915].
See #37430.
Built from https://develop.svn.wordpress.org/trunk@41916


git-svn-id: http://core.svn.wordpress.org/trunk@41750 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 18:01:49 +00:00
Sergey Biryukov
936bf3661f Plugins: After [41608], make the markup in WP_Plugin_Install_List_Table::no_items() a bit more readable.
See #37430.
Built from https://develop.svn.wordpress.org/trunk@41915


git-svn-id: http://core.svn.wordpress.org/trunk@41749 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 17:58:48 +00:00
Sergey Biryukov
4dd637acde Docs: Add @since entry for WP_Automatic_Updater::after_core_update(), introduced in [25841].
See #41017, #29086.
Built from https://develop.svn.wordpress.org/trunk@41914


git-svn-id: http://core.svn.wordpress.org/trunk@41748 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 17:48:49 +00:00
Weston Ruter
ae538512c3 Widgets: Fix previewing embeds in Text widget by allowing parse-embed admin ajax requests with an empty post_ID just as WP_oEmbed_Controller::get_proxy_item_permissions_check() allows.
As of #34115 if there is no post context the oEmbed will be cached in an `oembed_cache` custom post type, so having a post as context is no longer a requirement for caching.

Props biskobe, westonruter.
See #34115, #40450.
Fixes #40854.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41747 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 17:40:49 +00:00
Jeremy Felt
548d8c2e0d Multisite: Document all return types in get_sites().
Adds more complete documentation to `get_sites()` and the corresponding methods in `WP_Site_Query`.

Fixes #41789.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41746 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 17:39:46 +00:00
Sergey Biryukov
53dba84ec7 I18N: Remove <a> tag from a translatable string in confirm_another_blog_signup().
Props ramiy.
Fixes #41694.
Built from https://develop.svn.wordpress.org/trunk@41911


git-svn-id: http://core.svn.wordpress.org/trunk@41745 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 17:36:50 +00:00
Sergey Biryukov
3951984680 I18N: Remove <b> tag from a translatable string in post_submit_meta_box().
Props ramiy.
Fixes #41681.
Built from https://develop.svn.wordpress.org/trunk@41910


git-svn-id: http://core.svn.wordpress.org/trunk@41744 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 17:31:48 +00:00
Sergey Biryukov
6b2a4c4574 I18N: Remove <strong> tag from a translatable string in Theme_Upgrader::install_strings().
Props ramiy.
Fixes #41695.
Built from https://develop.svn.wordpress.org/trunk@41909


git-svn-id: http://core.svn.wordpress.org/trunk@41743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 17:20:48 +00:00
Sergey Biryukov
2b9e8abd8f I18N: Remove <code> tags from translatable strings in Core_Upgrader, Language_Pack_Upgrader, Plugin_Upgrader, Theme_Upgrader.
Props ramiy.
Fixes #41705.
Built from https://develop.svn.wordpress.org/trunk@41908


git-svn-id: http://core.svn.wordpress.org/trunk@41742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 17:15:47 +00:00
Sergey Biryukov
fb8d73a0f7 Docs: Correct type and description for the $data parameter in WP_Http::browser_redirect_compatibility().
Fixes #41380.
Built from https://develop.svn.wordpress.org/trunk@41907


git-svn-id: http://core.svn.wordpress.org/trunk@41741 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 16:38:48 +00:00
Sergey Biryukov
f9ff030127 I18N: Replace hardcoded file name in a translatable string in convert_to_screen() with a placeholder.
Props ramiy.
Fixes #41668.
Built from https://develop.svn.wordpress.org/trunk@41906


git-svn-id: http://core.svn.wordpress.org/trunk@41740 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 15:46:52 +00:00
Sergey Biryukov
82dd23d36f I18N: Make context for "Schedule" string added in [41898] more accurate.
Props ocean90.
Fixes #42165.
Built from https://develop.svn.wordpress.org/trunk@41905


git-svn-id: http://core.svn.wordpress.org/trunk@41739 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 15:39:52 +00:00
Sergey Biryukov
16bee559d4 I18N: Replace hardcoded file name in translatable strings in wp-admin/setup-config.php with a placeholder.
Props ramiy, danieltj.
Fixes #42161.
Built from https://develop.svn.wordpress.org/trunk@41904


git-svn-id: http://core.svn.wordpress.org/trunk@41738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 15:27:53 +00:00
Konstantin Obenland
d8f98b3649 Customize: Unstick filter pane in Theme selector
Prevents the filter pane from blocking the view of theme search results when it's open.
Users are now able to just scroll to view results.

Props rclations.
Fixes #42212.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 15:11:46 +00:00
Sergey Biryukov
ac5096d8bd Embeds: Avoid "Division by zero" warning in embed-content.php template if a thumbnail has a zero height.
Props stevenlinx, aegis123.
Fixes #40931.
Built from https://develop.svn.wordpress.org/trunk@41902


git-svn-id: http://core.svn.wordpress.org/trunk@41736 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 15:09:48 +00:00
Sergey Biryukov
a859b46e92 I18N: Replace function name in error message in WP_Http_Curl::request() and WP_Http_Streams::request() with a placeholder.
Props ramiy.
Fixes #41666.
Built from https://develop.svn.wordpress.org/trunk@41901


git-svn-id: http://core.svn.wordpress.org/trunk@41735 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 15:04:51 +00:00
Gary Pendergast
a2bd3e23d1 Dashboard: Ensure the "Dismiss" button on the Gutenberg callout is clickable.
Who likes z-index? We like z-index!

Props joemcgill.
See #41316.



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


git-svn-id: http://core.svn.wordpress.org/trunk@41734 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 14:55:48 +00:00
Konstantin Obenland
261f0d8ef2 Customize: Allow menu creation in locations pane
Adds a link to the menu creation workflow from the locations selector in the nav menu control.

Props bpayton, westonruter, Travel_girl, melchoyce, celloexpressions.
Fixes #36279.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 14:51:47 +00:00
Sergey Biryukov
97bab0459a I18N: Add a context for "Schedule" string.
Props Mirucon.
Fixes #42165.
Built from https://develop.svn.wordpress.org/trunk@41898


git-svn-id: http://core.svn.wordpress.org/trunk@41732 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 14:45:51 +00:00
Mel Choyce
0c73d35816 Code Editors: Fix display of "help" cursor.
Props studionashvegas .
Fixes #42210.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 13:11:49 +00:00
Gary Pendergast
df8ab820ef Dashboard: Remove a rogue comma introduced in [41895].
See #41316.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 12:39:46 +00:00
Gary Pendergast
3981736cd6 Dashboard: Introduce a "Try Gutenberg" callout.
To encourage more people to try Gutenberg, this new Dashboard box allows site users to easily install and try out Gutenberg.

Props pento, melchoyce, joen, karmatosed.
Fixes #41316.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41729 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 10:04:47 +00:00
Weston Ruter
e914c0447c Customize: Add missing filter docs in WP_Customize_Nav_Menu_Item_Setting::sanitize().
Props dlh.
Fixes #42257.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41728 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 04:57:50 +00:00
Weston Ruter
43b4a2577d Customize: Improve theme browsing UI on small screens.
Props Mahvash-Fatima, melchoyce, celloexpressions.
See #37661.
Fixes #42215.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41727 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 04:06:47 +00:00
Weston Ruter
41bb2125b0 Customize: Remove incorrect test assertions for the post_date of customization drafts.
Amends [41887].
See #42220.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41726 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 02:41:49 +00:00
Weston Ruter
b4edf21599 Media: Add missing mediaelement-migrate.js script to get uglified.
Amends [41877].
See #42189, #39686.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41725 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 02:26:48 +00:00
Weston Ruter
7ee77760af Widgets: Use a foreach loop instead of The Loop to iterate over posts in Recent Posts widget to avoid needing to reset a polluted global $post.
Props welcher, westonruter.
Amends [14607].
See #12320.
Fixes #37312.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 00:34:46 +00:00
Weston Ruter
dce5306603 Media: Use user locale as ME.js language in admin and add mejsL10n inline script before mediaelement-core so WP-exported translation strings are used.
See #39686.
Fixes #42241.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41723 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 00:08:45 +00:00
David A. Kennedy
b6539fb5a0 Twenty Seventeen: Fix double bottom-margins below embeds
Corrects an issue where both the containing paragraph and embed had bottom margins, causing unwanted extra space.

Props westonruter.

Fixes #42118.

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


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

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

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


git-svn-id: http://core.svn.wordpress.org/trunk@41721 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-17 20:15:52 +00:00
Weston Ruter
955d5b0ab1 Widgets: Prevent MediaElement.js player from overflowing sidebar in Audio widget.
Props bradyvercher.
See #39686.
Fixes #42244.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41720 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-16 23:02:47 +00:00
Felix Arntz
021afced82 Role/Capability: Prevent a fatal error when checking a language capability early or in the frontend.
The meta capabilities `install_languages` and `update_languages` rely on the admin function `wp_can_install_language_pack()`. That function in turn relies on `request_filesystem_credentials()`, so it needs to be ensured that this function is available as well.

Fixes #42230.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41719 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-16 22:54:57 +00:00
Felix Arntz
3f8621b632 Multisite: Revert [41698] and [41743].
In order for `get_site_by()` to be truly beneficial, caching in `WP_Site_Query` needs to be improved to account for common use-cases and have them be invalidated less aggressively.

See #40180, #40228, #42091.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41718 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-16 22:35:47 +00:00
Felix Arntz
18789739c1 Multisite: Revert [41719].
While `get_site_by()` makes sense as a more explicit and less complex replacement for `get_blog_details()`, it is not ready yet in terms of caching, where it currently falls short of the older function under specific circumstances.

See #40180, #40228.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41717 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-16 22:29:48 +00:00
Helen Hou-Sandí
bb66a52a14 Code Editors: Minor style improvements.
props melchoyce.
see #42214.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41716 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-16 21:36:48 +00:00
Boone Gorges
af960204b6 Taxonomy: Add note about $number inconsistency to WP_Term_Query docs.
Fixes #41796.
Built from https://develop.svn.wordpress.org/trunk@41881


git-svn-id: http://core.svn.wordpress.org/trunk@41715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-16 18:38:48 +00:00
Boone Gorges
9f73875705 Don't force distinct term queries when specifying number and object_ids.
This reverts [41377], which caused performance problems on sites with a large
number of terms.

See #41796.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-16 18:35:47 +00:00
John Blackbourn
24783cfc3e Media: Allow the unminified mediaelement script to be enqueued when SCRIPT_DEBUG is true.
Props dsawardekar
Fixes #42229

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


git-svn-id: http://core.svn.wordpress.org/trunk@41713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-16 18:15:47 +00:00
Andrea Fercia
575e60e96c Administration: Improve consistency of the "not found" strings.
Partially reverts [41608] restoring the original strings without the word `query`.

See #37430.
Fixes #42231.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-16 18:14:48 +00:00
Weston Ruter
2e602a8560 Media: Add MediaElement.js 2.2 back-compat for MediaElement.js 4.2
* Introduces `mediaelement-migrate.js`.
* Upgrades ME.js from 4.2.5-74e01a40 to 4.2.6-78496d1.

Props rafa8626, bradyvercher.
See #39686.
Fixes #42189.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41711 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-16 18:07:52 +00:00
Andrea Fercia
4085a1b266 Accessibility: Improve the File Editors interstitial warning.
The warning displayed upon first visit on the File Editors introduced in [41774]
needs to be the only perceivable content in the page for users of assistive
technologies. It looks like a modal but it's not exactly an ARIA dialog, not an
ARIA alert either, and needs some special treatment.

- constrains tabbing within the modal
- uses `wp.a11y.speak()` to make screen readers announce the modal message
- hides all the other page content from assistive technologies using `aria-hidden="true"`

This way, even if users miss the speak message, the warning is actually the only
perceivable content in the page.

Fixes #42110.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41710 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-16 17:59:52 +00:00
Jeremy Felt
e362e61ae5 Multisite: Explicitly globalize global variables in ms-settings.php.
Explicitly globalize and document `$domain`, `$path`, `$site_id`, and `$public` in `ms-settings.php.

Props csloisel, danielbachhuber.
Fixes #39419.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41709 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-16 17:06:48 +00:00
Sergey Biryukov
a88704d026 Administration: Remove punctuation from the link text in "Site Address" option description.
Props Presskopp.
Fixes #42190.
Built from https://develop.svn.wordpress.org/trunk@41874


git-svn-id: http://core.svn.wordpress.org/trunk@41708 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-16 14:02:50 +00:00
Weston Ruter
862e8c1807 Customize: Use keydown instead of keyup for listening for enter key to add page stub via dropdown-pages control.
Fixes issue with Japanese input.

Props miyauchi.
Amends [38906].
See #34923.
Fixes #42233.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41707 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-16 07:57:48 +00:00
Weston Ruter
4150e805d7 Widgets: Update preview for Gallery widget when one of its attachments is modified in the media modal, outside the customized state.
* Ensure that changes to captions are shown in preview when modified in media modal.
* Also keep `wp.customize.widgetsPreview.renderedWidgets` updated when widgets are added or removed.

See #41914, #37887, #40403.
Fixes #41979.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41706 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-16 06:46:48 +00:00
Weston Ruter
94f9c7e789 Customize: Prevent theme details modal from being clipped in Safari.
Props afercia.
See #42052, #37661.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41705 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-16 04:41:45 +00:00
Sergey Biryukov
c79492540a Build/Test Tools: Pass correct $message argument to WP_UnitTestCase::setExpectedException() in Tests_Ajax_CompressionTest::test_logged_out() and Tests_Ajax_TagSearch::test_no_results().
PHPUnit 6.4.1 and earlier versions ignored the `'0'` value, causing the issue to go unnoticed.

Fixes #42232.
Built from https://develop.svn.wordpress.org/trunk@41870


git-svn-id: http://core.svn.wordpress.org/trunk@41704 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-16 04:06:49 +00:00
Weston Ruter
2e184426c0 Customize: Add 'save-request-params' event on wp.customize for plugins to inject/modify params in save requests.
Allows feature plugins, for example, to supply a `customize_changeset_title` param instead of having to wrap `wp.customize.previewer.query`.

Props dlh.
Fixes #42206.

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


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

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


git-svn-id: http://core.svn.wordpress.org/trunk@41702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-15 22:23:47 +00:00
Sergey Biryukov
46ff957961 Widgets: Move empty title checks out of the apply_filters( 'widget_title' ) calls for clarity.
See #42226.
Built from https://develop.svn.wordpress.org/trunk@41867


git-svn-id: http://core.svn.wordpress.org/trunk@41701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-15 21:43:47 +00:00
Sergey Biryukov
0ae79ece9f Widgets: In WP_Widget_Media, apply widget_title filter regardless of whether the title is empty, same as other widgets do.
Props Bsop.
Fixes #42226.
Built from https://develop.svn.wordpress.org/trunk@41866


git-svn-id: http://core.svn.wordpress.org/trunk@41700 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-15 21:29:51 +00:00
Weston Ruter
ad8c9f0170 File Editor: Move inline to external style to fix extra padding in RTL page direction.
Props afercia.
Fixes #42221.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-15 05:51:49 +00:00
Weston Ruter
191beede5e File Editor: Prevent the scrolling of current-file into view to also change initially-focused element in Chrome.
Props afercia.
Fixes #24048.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-15 05:37:51 +00:00
Weston Ruter
8562e4bfac Customize: Fix visibility of theme browser header in Safari.
Props benoitchantre, afercia.
See #42052, #37661.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41697 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-15 04:59:10 +00:00
Felix Arntz
e4550efbb7 Multisite: Return get_current_blog_id() value instead of hard-coded 1 in get_main_site_id() for non-multisite environments.
See #41936.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-14 22:46:48 +00:00
Felix Arntz
5ea3d62192 Multisite: Take WP_Network::$blog_id into account in get_main_site_id().
When the `WP_Network::$blog_id` property is set manually, for example in the multisite bootstrap process, `get_main_site_id()` should use that value instead of running its own logic. The main logic for the function was therefore moved into the internal `WP_Network::get_main_site_id()` method, which is now being accessed by the function through the magic property handling for `WP_Network::$blog_id` (and its equivalent `WP_Network::$site_id`).

Props spacedmonkey, jeremyfelt.
Fixes #41936.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-14 22:42:54 +00:00
Weston Ruter
24d304a0a1 Customize: Fix positioning of device-previewed window when publish settings are open.
* Update date control padding.
* Collapse publish settings section when opening panes for available widgets or nav menus.
* Remove save and cog buttons in mobile preview only mode.
* Move definition of `wp.customize.previewedDevice` to `wp.customize.state('previewedDevice')` for centralization, maintaining old alias.
* Remove unused CSS because the section is inside form now.

Props sayedwp, westonruter.
See #39896.
Fixes #42027, #42199.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-13 21:21:55 +00:00
Helen Hou-Sandí
e48b16d96a File editor warning: Add a "Go back" button.
see #42100, #31779.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41693 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-13 20:56:50 +00:00
Weston Ruter
d975dccac9 Code Editor: Fix syntax error in PHP 5.2 and PHP 5.3 after [41855].
See #41871.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-13 19:43:49 +00:00
Mel Choyce
e5db49d607 Settings: Widen time/day input fields on General Settings page, and move the preview onto the next line.
Props desrosj, afercia.
Fixes #41603.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41691 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-13 18:39:48 +00:00
Adam Silverstein
59c3c7ae14 Media Grid: Fix escape key sometimes failing to close details modal.
Fix an issue where the escape key would no longer close the attachment details modal after attempting to navigate over the navigation boundaries (by clicking the left arrow key on the first media item or clicking the right arrow key on the last media item). Remove a focus blur which caused the underlying Backbone View to not receive the 'keydown' event.

Props subrataemfluence, afercia.
Fixes #42180.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41690 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-13 18:21:49 +00:00
Weston Ruter
22ecf792b5 Code Editor: Add unit tests for wp_enqueue_code_editor() and WP_Widget_Custom_HTML.
Props ryotsun.
See #12423.
Fixes #41871.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-13 17:58:46 +00:00
Mel Choyce
af6d136163 Improve File Credentials / Code Editor modal responsive styles.
Makes the modal full-width and height. 

Props sami.keijonen, Mirucon, helen.
Fixes #42111.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41688 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-13 14:39:54 +00:00
Weston Ruter
8af4e6e3f9 Customize: Fix positioning of Preview button in mobile.
Props Mahvash-Fatima.
Fixes #42172.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-13 08:23:50 +00:00
Weston Ruter
d44acf01dc Code Editor: Remove keeping track of wp.codeEditor instances since unused and no removal of instances upon deletion, leading to memory leak.
See #12423.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-13 04:34:52 +00:00
Weston Ruter
0659de4e21 File Editors: Display list of theme/plugin files in scrollable directory tree.
Props WraithKenny, afercia, melchoyce, westonruter.
Amends [41721].
Fixes #24048.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-13 02:39:47 +00:00
Gary Pendergast
95cfb7f5e4 Login: Swap bloginfo() usage for get_bloginfo().
[41843] introduced a use of `bloginfo()`, where it should be using `get_bloginfo()`.

Props dlh.
Fixes #34625.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-13 02:10:48 +00:00
Boone Gorges
a1879766ed Bump 'posts' query cache incrementor when modifying postmeta.
This ensures that the `get_pages()` query cache doesn't go stale when
postmeta is modified.

Props spacedmonkey.
Fixes #40669.
Built from https://develop.svn.wordpress.org/trunk@41849


git-svn-id: http://core.svn.wordpress.org/trunk@41683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-12 15:20:47 +00:00
Boone Gorges
0fce77da25 Invalidate comment query cache when modifying comment meta.
Comment queries are sensitive to comment meta due to the `meta_query`
parameter, so the cache must be invalidated when comment meta is changed,
added, or deleted.

Props spacedmonkey.
See #40669.
Built from https://develop.svn.wordpress.org/trunk@41848


git-svn-id: http://core.svn.wordpress.org/trunk@41682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-12 14:59:47 +00:00
Weston Ruter
3bfe1f6c21 Post WordPress 4.9 Beta 2 version bump.
Built from https://develop.svn.wordpress.org/trunk@41847


git-svn-id: http://core.svn.wordpress.org/trunk@41681 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-12 06:25:48 +00:00
Weston Ruter
2601b16e76 WordPress 4.9 Beta 2.
Built from https://develop.svn.wordpress.org/trunk@41846


git-svn-id: http://core.svn.wordpress.org/trunk@41680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-12 05:43:47 +00:00
Weston Ruter
39a2308a94 Customize: Prevent showing confirmation dialog when leaving Customizer after previewing theme switch without making any changes.
Fixes #42173.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41679 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-12 05:17:49 +00:00
Gary Pendergast
af83fe7fb9 Editor: Improve the accuracy of the list of shortcodes that the word count ignores.
Previously, shortcodes were being counted when the `init` action fired, even though it's possible for shortcodes to be registered later than that.

By leaving the counting until just before the script is printed, we get a more accurate list of shortcodes.

Props ocean90.
Fixes #41917.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41678 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-12 05:10:50 +00:00
Gary Pendergast
a9d38090ac Login: On the single site login screen, match the logo link text with the title.
Previously, the (W) logo on the single site login screen linked to wordpress.org, with an appropriate `title` attribute, but the link text was the blog name.

To fix this discrepency, the link text is now the same as the `title` attribute.

Props pento, obrienlabs, afercia, flixos90, lukecavanagh, and the infinite stack of bikesheds that WordPress is balanced upon.
Fixes #34625.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41677 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-12 04:57:46 +00:00
Weston Ruter
da565a20b9 Twenty Seventeen: Fix positioning of edit shortcuts when partials are nested inside a frontpage panel.
Fixes #41557.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41676 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-12 04:44:45 +00:00
Gary Pendergast
8cb9f6159a Build/Test Tools: Revert [41784].
[41784] was a workaround for a bug in PHPUnit 6.4. PHPUnit 6.4.1 has since been released, which includes a fix for this.

Fixes #42124.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41675 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-12 04:28:46 +00:00
Weston Ruter
663c20388b Widgets: Update default link_type for Gallery widget from none to post for consistency with wp.media.galleryDefaults.
Props bor0.
See #41914.
Fixes #41985.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41674 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-12 04:21:46 +00:00
Weston Ruter
434e3aba82 Customize: Add changeset locking in Customizer to prevent users from overriding each other's changes.
* Customization locking is checked when changesets are saved and when heartbeat ticks.
* Lock is lifted immediately upon a user closing the Customizer.
* Heartbeat is introduced into Customizer.
* Changes made to user after it was locked by another user are stored as an autosave revision for restoration.
* Lock notification displays link to preview the other user's changes on the frontend.
* A user loading a locked Customizer changeset will be presented with an option to take over.
* Autosave revisions attached to a published changeset are converted into auto-drafts so that they will be presented to users for restoration.
* Focus constraining is improved in overlay notifications.
* Escape key is stopped from propagating in overlay notifications, and it dismisses dismissible overlay notifications.
* Introduces `changesetLocked` state which is used to disable the Save button and suppress the AYS dialog when leaving the Customizer.
* Fixes bug where users could be presented with each other's autosave revisions.

Props sayedwp, westonruter, melchoyce.
See #31436, #31897, #39896.
Fixes #42024.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-12 04:01:46 +00:00
Mel Choyce
f44ed386c1 Media: Fix an issue where audio players overflow playlist containers.
Props celloexpressions.
Fixes #41844.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-12 03:55:46 +00:00
Mel Choyce
a19f05ad63 Customizer: Improve specificity of small-screen styles in Widgets panel.
Props mrasharirfan, celloexpressions.
Fixes #41614.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41671 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-12 03:53:47 +00:00
Mel Choyce
7e6748ad61 Settings: Widen image size input fields on Media Settings page.
On narrower devices, input fields are too short to fit the number of default digits they contain. This widens the fields and also breaks each height and width attribute onto a new line for better usability, using some terrible CSS trickery. My apologies.

Props: Toru, Presskopp, desrosj, xkon, ryelle, melchoyce.
Fixes #34539.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41670 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-12 03:48:47 +00:00
Gary Pendergast
5a8d166547 General: Remove .jshintrc and *.json from the 2-space-indent .editorconfig group.
JSON files don't need a particular indent style, this was just inherited from the jQuery `.editorconfig`, that we based ours on.

`package.json` is staying in the 2-space-indent group for now, due to npm 3 and 4 having issues. Upgrading to npm 5 will allow us to remove `package.json`, too.

Props netweb.
Fixes #40946.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41669 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-12 01:58:45 +00:00
Mel Choyce
009c3a94bb Gallery Widget: Fix row spacing across major browsers.
Props petertoi .
Fixes #42188.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41668 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-11 21:14:51 +00:00
Mel Choyce
71aa62101f Gallery Widget: Remove grey background behind gallery, and align images to the edge of the container.
Props Presskopp, benoitchantre, mrasharirfan.
Fixes #42101.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41667 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-11 19:45:49 +00:00
Weston Ruter
2866a3cad2 Customize: Vary description for nav menu locations control based on whether it is shown during menu creation.
Also fix issue with initial visibility of notice when there are no menus.

Amends [41823].
Props bpayton, melchoyce, westonruter.
See #42116.
Fixes #42113.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41666 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-11 19:38:50 +00:00
Mel Choyce
e8922f416e TinyMCE: Remove "Unlink" icon from toolbar
Because "unlink" now appears contextually when editing a link, let's remove it from the toolbar.

Props azaozz, ahortin, swissspidy, afercia.
Fixes #36569.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-11 19:14:46 +00:00
Mel Choyce
39f3764a4b Code Editors: Improve cursor interactions on warning notices.
Fixes an issue where hovering over the warning icon didn't work if there were multiple warnings on the same line of code. Also updates the cursor from "pointer" to "help" when hovering over warnings and errors.

Props joyously, obenland.
Fixes #42129.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-11 18:25:46 +00:00
Gary Pendergast
a72be13ec0 Editor: Add the replace_editor filter.
This filter allows the Core editor to be replaced by an entirely different editor (coughcoughGUTENBERGcough).

Props azaozz, who is supposed to be on sabbatical right now.
Fixes #42119.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41663 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-11 12:06:48 +00:00
Pascal Birchler
8b4a8b6c15 Database: Add translators comment for error message in wpdb::prepare().
Props felipeelia.
Fixes #42142.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41662 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-11 08:35:47 +00:00
Weston Ruter
3ba66a0030 Widgets: Update video widget embed failure notice to indicate streams other than YouTube and Vimeo are allowed.
Amends [41759].
See #42039.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-11 06:22:47 +00:00
Weston Ruter
43801ded60 Customize: Make sure saved state is initially false when restoring autosave revision so that Save button will be enabled.
Amends [41597].
Props sayedwp.
See #39896.
Fixes #42143.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-11 05:57:48 +00:00
Weston Ruter
b2c816ff74 Customize: Correct docs for WP_Customize_Manager::changeset_uuid() after changes in [41626].
Props dlh.
Fixes #42174.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-11 05:45:46 +00:00
Weston Ruter
3f2b453a4d Customize: Introduce WP_Customize_Manager::trash_changeset_post() to reduce duplication and ensure proper changeset trashing logic.
Trashing a changeset via `wp_trash_post()` does not have the desired result since it mutates `post_content` (via Kses) and the `post_name` (even though it is a UUID).

Props dlh.
See #39896, #42030.
Fixes #42175.

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


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

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


git-svn-id: http://core.svn.wordpress.org/trunk@41657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-11 05:28:52 +00:00
Weston Ruter
36f8e77b49 Customize: Prevent outputting value attribute if already supplied among input_attrs.
This allows for `input[type=button]` controls to be added without producing illegal HTML.

Amends [41740].
See #30738, #33085.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41656 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-11 04:26:48 +00:00
Dion Hulse
b35cf2f529 Upgrades: Remove the usage of each() from WP_Upgrader for PHP 7.2 compatibility.
Props chrisvendiadvertisingcom, dd32.
Fixes #41524

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


git-svn-id: http://core.svn.wordpress.org/trunk@41655 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-11 04:24:50 +00:00
Gary Pendergast
fd247bc2e4 Database: When parsing the host, leave the port and socket as null if they're not defined.
This fixes a change in behaviour introduced by [41629].

The host is set to an empty string when it isn't defined, this continues existing behaviour. In particular, the mysqli library treats a `null` host as being the same as `localhost`, which is not always the intended behaviour.

Props birgire, markjaquith, pento.
Fixes #41722.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41654 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-11 00:10:47 +00:00
Weston Ruter
3609d0c4c5 Plugin Editor: Revert superseded changes to activate_plugin() and plugin_sandbox_scrape().
Partially revert [41671], [41561], [41560].
See #21622.
Fixes #39766.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41653 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-11 00:03:48 +00:00
Gary Pendergast
80fd3cad0d Database: Fix a test failing on MySQL 5.7 and MariaDB 10.2.
On newer versions of MySQL, an error was being thrown when creating a table with an index that we wanted to be silently truncated.

To avoid this, the test now tries to use a newer InnoDB file format where available, and skips the test when that happens.

Props pento, danielbachhuber, straussd.
Fixes #41716.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-10 23:46:47 +00:00
Weston Ruter
5bde734323 Customize: Fix vertical alignment of radio and checkbox inputs after [41740].
Props Shital Patel, subrataemfluence, sayedwp.
Amends [41740].
See #33085.
Fixes #42157.

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


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

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


git-svn-id: http://core.svn.wordpress.org/trunk@41650 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-10 21:04:49 +00:00
Weston Ruter
5123283cf7 Customize: Improve and clarify help text for Themes panel.
Props michelleweber, melchoyce, celloexpressions.
See #37661.
Fixes #42047.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41649 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-10 20:53:49 +00:00
Weston Ruter
6c05b7bef2 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-10 20:39:47 +00:00
Weston Ruter
7cb66a5353 Widgets: Allow deletion even when widget form fails validity checks.
Props felipeelia.
Amends [41352].
See #23120.
Fixes #42127.

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


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

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


git-svn-id: http://core.svn.wordpress.org/trunk@41646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-10 17:57:48 +00:00
Konstantin Obenland
b17b035009 Menus: Limit mapping to registered locations
Weeds out orphaned locations, so their information will not continue to be mapped to future themes.

Fixes #42121.

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


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

See #39692.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41644 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-10 17:06:47 +00:00
Boone Gorges
8d773262f3 Taxonomy: Don't discard keys when merging queried terms from different taxonomies.
For values of `fields` like `id=>parent`, the keys of the array must be
maintained as part of the query results.

Introduced as part of #40496. See [38667], [40513].

Props miyauchi, dany2217, pcarvalho.
Fixes #41293.
Built from https://develop.svn.wordpress.org/trunk@41809


git-svn-id: http://core.svn.wordpress.org/trunk@41643 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-10 16:45:48 +00:00
Mel Choyce
8f4e2bdb6b Customizer: Vertically center section arrows.
Props dualcube_subrata.
Fixes #42123.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41642 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-10 16:23:50 +00:00
Weston Ruter
7b0dbf49fc 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41641 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-10 07:09:52 +00:00
Gary Pendergast
58db3cb54e 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.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-10 05:34:49 +00:00
Weston Ruter
1a22fb3b60 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41639 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-10 05:27:49 +00:00
Weston Ruter
132c847087 Customize: Ensure customized changes pending to be written into changeset are successfully injected into Ajax requests in preview.
Amends [40704].
See #42162.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41638 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-10 04:51:47 +00:00
Weston Ruter
ef1c95ff91 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41637 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-10 03:34:53 +00:00
Weston Ruter
f462387431 Customize: Improve keyboard accessibility for publish settings section.
Props sayedwp.
See #39896.
Fixes #42027.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-09 23:01:46 +00:00
Konstantin Obenland
756c052ccb Menus: Add social as tertiary mapping group
Allows mapping of all social menus that include the term `social` in their slug.

See #39692.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41635 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-09 21:23:47 +00:00
Adam Silverstein
ca30822541 Docs: add docs for meta authorization filters.
Add filter documentation for `auth_{$object_type}_meta_{$meta_key}` and `auth_{$object_type}_{$sub_type}_meta_{$meta_key}`.

Props ericlewis, johneckman, DrewAPicture.
Fixes #36319.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-09 19:14:52 +00:00
Weston Ruter
598e5f400e Customize: Add jsdoc for api.panel, api.section, api.control, and api.notifications collections.
Props shramee, westonruter.
Fixes #39930.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41633 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-09 18:56:55 +00:00
Konstantin Obenland
8911893672 Widgets: Update globals documentation.
It doesn't look like `wp_register_sidebar_widget()` ever used a global named `$wp_register_widget_defaults`. It does however make use of `$wp_registered_widget_controls` now.

See [8960], [30776].

Props upadalavipul.
Fixes #41592.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-09 16:35:47 +00:00
Weston Ruter
35b5c9e762 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-09 16:04:48 +00:00
John Blackbourn
c9e8431582 Users: Remove some links to the dashboard from My Sites for users who cannot access it.
See #41453

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


git-svn-id: http://core.svn.wordpress.org/trunk@41630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-09 15:22:46 +00:00
John Blackbourn
b25e759621 Networks and Sites: Correct the documentation for the update_site_cache parameter of WP_Site_Query.
Props welcher, sudar
Fixes #42155

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


git-svn-id: http://core.svn.wordpress.org/trunk@41629 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-09 14:26:49 +00:00
John Blackbourn
f14b24792a Press This: Use "installation" when referring to the act of installing Press This.
Props Presskopp
Fixes #41620

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


git-svn-id: http://core.svn.wordpress.org/trunk@41628 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-09 14:08:48 +00:00
John Blackbourn
8ec310d44c Customize: Don't use an abbreviation in screen reader help text.
Props pixolin
Fixes 42153

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


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

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


git-svn-id: http://core.svn.wordpress.org/trunk@41626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-08 16:34:49 +00:00
Dominik Schilling
3bee2912ea Customize: Use a consistent translator comment for the same strings.
See #21492.
Built from https://develop.svn.wordpress.org/trunk@41791


git-svn-id: http://core.svn.wordpress.org/trunk@41625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-08 16:23:46 +00:00
Pascal Birchler
d323ea9e18 Customize: Add missing word in error message about already published changesets.
Introduced in [41626].

Fixes #42144.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-08 09:25:55 +00:00
Pascal Birchler
1478135c46 Database: Use numbered placeholders in error message in wpdb::prepare().
Props tobifjellner.
Fixes #42142.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-08 09:18:57 +00:00
Weston Ruter
a01ae9a8c3 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.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-07 06:00:54 +00:00
Sergey Biryukov
dc4241986b General: Correct _deprecated_function() calls in debug_fopen(), debug_fwrite(), and debug_fclose().
The second parameter is supposed to be the version number, the replacement function should be the third parameter.

Props milindmore22, jdgrimes.
Fixes #41094.
Built from https://develop.svn.wordpress.org/trunk@41787


git-svn-id: http://core.svn.wordpress.org/trunk@41621 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-07 00:40:52 +00:00
Sergey Biryukov
2ae2b1269a Rewrite: In url_to_postid(), bail early if the URL does not belong to the site.
Props ivankristianto, swissspidy, jkhongusc, SergeyBiryukov.
Fixes #39373.
Built from https://develop.svn.wordpress.org/trunk@41786


git-svn-id: http://core.svn.wordpress.org/trunk@41620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-06 23:29:51 +00:00
Sergey Biryukov
6ecdbe6e0e Editor: Fix JSHint errors after [41783].
See #42059.
Built from https://develop.svn.wordpress.org/trunk@41785


git-svn-id: http://core.svn.wordpress.org/trunk@41619 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-06 19:12:49 +00:00
Sergey Biryukov
20a3f8d6c9 Build/Test Tools: In Tests_Image_Functions::test_load_directory(), check the expected internal type instead of using assertNotInternalType(), which causes an error with PHPUnit 6.4.0.
Props joemcgill.
Fixes #42124.
Built from https://develop.svn.wordpress.org/trunk@41784


git-svn-id: http://core.svn.wordpress.org/trunk@41618 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-06 18:22:48 +00:00
Andrew Ozz
765272e3e5 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.
Built from https://develop.svn.wordpress.org/trunk@41783


git-svn-id: http://core.svn.wordpress.org/trunk@41617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-06 17:44:48 +00:00
Sergey Biryukov
806c464e4b Login and Registration: Prevent PHP warnings when POSTing to wp-login.php with an array as a user_login or user_email field.
Props menakas, johnjamesjacoby.
Fixes #40888.
Built from https://develop.svn.wordpress.org/trunk@41782


git-svn-id: http://core.svn.wordpress.org/trunk@41616 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-06 17:37:47 +00:00
Joe McGill
53a58e35b7 Media: Fix MEJS error when removing a media player.
This fixes a bug introduced by the upgrade to MediaElement.js, where code 
calling `wp.media.mixin.removePlayer()` would result in a JS error.

Props rafa8626, afercia.
Fixes #41787.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-06 16:31:54 +00:00
Sergey Biryukov
0b39f4c99d Twenty Seventeen: Add missing @return tag for twentyseventeen_video_controls().
Props ndoublehwp, audrasjb.
Fixes #41927.
Built from https://develop.svn.wordpress.org/trunk@41780


git-svn-id: http://core.svn.wordpress.org/trunk@41614 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-06 01:35:47 +00:00
Weston Ruter
77a4574b96 Widgets: Apply the same container-constraining embed resizing logic from the Video widget to embeds in the Text widget.
See #40854, #39994.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-06 00:39:52 +00:00
Weston Ruter
b6297d1866 Customize: Prevent color default control type from overriding template for ColorControl.
Amends [41771].
See #30738.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-05 14:36:57 +00:00
Weston Ruter
766db88eb9 Post WordPress 4.9 Beta 1 version bump
Built from https://develop.svn.wordpress.org/trunk@41777


git-svn-id: http://core.svn.wordpress.org/trunk@41611 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-05 05:54:52 +00:00
Weston Ruter
6a899cf45c WordPress 4.9 Beta 1.
Built from https://develop.svn.wordpress.org/trunk@41776


git-svn-id: http://core.svn.wordpress.org/trunk@41610 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-05 05:06:47 +00:00
Weston Ruter
b5f75fc315 File Editors: Fix JSHint error after [41774].
See #31779.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41609 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-05 04:43:47 +00:00
Helen Hou-Sandí
b698881469 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41608 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-05 04:25:48 +00:00
Weston Ruter
7f7dffafbb Customize: Fix QUnit tests after failures introduced in [41768].
Props bpayton.
Fixes #40104.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41607 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-05 04:23:48 +00:00
Weston Ruter
48209c926f Widgets: Remove "Replace Gallery" button from Gallery widget since redundant with "Edit Gallery".
Props Presskopp, juhise, melchoyce.
See #41914.
Fixes #41994.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41606 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-05 03:13:49 +00:00
Weston Ruter
9d6134a88c 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41605 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-05 02:56:47 +00:00
Sergey Biryukov
561bde29c7 Administration: Add .protected-post-excerpt class to password-protected post excerpts in the posts list.
Props Soean, mp518, slaFFik, SergeyBiryukov.
Fixes #41426.
Built from https://develop.svn.wordpress.org/trunk@41770


git-svn-id: http://core.svn.wordpress.org/trunk@41604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-05 02:50:46 +00:00
Sergey Biryukov
2e8615f21e REST API: After [41760], use correct query variable in WP_Term_Query::parse_orderby() when 'include_slugs' => 'slug__in' is passed.
See #40826.
Built from https://develop.svn.wordpress.org/trunk@41769


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

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

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

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

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


git-svn-id: http://core.svn.wordpress.org/trunk@41602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-05 02:22:49 +00:00
Sergey Biryukov
a47a253e90 Taxonomy: After [40903], restore documentation for wp_dropdown_categories() arguments that are different from the defaults in WP_Term_Query::__construct().
Fixes #41058.
Built from https://develop.svn.wordpress.org/trunk@41767


git-svn-id: http://core.svn.wordpress.org/trunk@41601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-05 01:57:48 +00:00
Sergey Biryukov
2f0f46cb84 Menus: Introduce wp_get_nav_menu_name() to retrieve the name of a navigation menu as set in the admin.
Props markoheijnen, christophherr, SpencerFinnell, wojtek.szkutnik, sagarprajapati, welcher, SergeyBiryukov.
Fixes #13910.
Built from https://develop.svn.wordpress.org/trunk@41766


git-svn-id: http://core.svn.wordpress.org/trunk@41600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-05 01:38:46 +00:00
Konstantin Obenland
2bd80ac24f Widgets: Continue to use shortcode for some embeds
Renders YouTube and Vimeo embeds through WordPress' video shortcode.

See #42039.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41599 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-05 01:29:46 +00:00
K. Adam White
2914ba6db8 Widgets: Fix jshint error in media widget.
Built from https://develop.svn.wordpress.org/trunk@41764


git-svn-id: http://core.svn.wordpress.org/trunk@41598 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-05 00:58:48 +00:00
Sergey Biryukov
33beafaf02 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.
Built from https://develop.svn.wordpress.org/trunk@41763


git-svn-id: http://core.svn.wordpress.org/trunk@41597 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-05 00:55:47 +00:00
Sergey Biryukov
2c5a378291 Twenty Fourteen: Add missing singular placeholder in comments.php.
Uses the recommended pattern for better compatibility with languages that use the singular form for other numbers. Also adds translator comments.

Props bplv, xkon.
See #39660.
Built from https://develop.svn.wordpress.org/trunk@41762


git-svn-id: http://core.svn.wordpress.org/trunk@41596 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-05 00:42:46 +00:00
Sergey Biryukov
0a2c1d7749 Twenty Fifteen: Add missing singular placeholder in comments.php.
Uses the recommended pattern for better compatibility with languages that use the singular form for other numbers. Also adds translator comments.

Props bplv, xkon.
See #39660.
Built from https://develop.svn.wordpress.org/trunk@41761


git-svn-id: http://core.svn.wordpress.org/trunk@41595 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-05 00:41:46 +00:00
K. Adam White
30827e4a4f REST API: Support ordering response collection by listed slugs.
Adds an "include_slug" orderby value for REST API collections to permit returning a collection filtered by slugs in the same order in which those slugs are specified.
Previously, the order of slugs provided with the ?slug query parameter had no effect on the order of the returned records.

Props wonderboymusic, ocean90, boonebgorges.
Fixes #40826.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41594 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-05 00:37:47 +00:00
Konstantin Obenland
5fe4acb1f5 Widgets: Allow oEmbeds in video widget.
Opens up video embeds to all supported video oEmbed providers.

Props westonruter.
See #42039.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-05 00:22:47 +00:00
K. Adam White
704fb3900b REST API: Support objects in settings schema.
Enables register_setting to accept an object as its schema value, allowing settings to accept non-scalar values through the REST API.
This whitelists the added type in the settings controller, and passes properties from argument registration into the validation functions.

Props joehoyle.
See #38583.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-05 00:19:49 +00:00
Sergey Biryukov
9319a9cec9 Bundled Themes: Restore double line breaks before media queries.
See #40138.
Built from https://develop.svn.wordpress.org/trunk@41757


git-svn-id: http://core.svn.wordpress.org/trunk@41591 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-05 00:02:48 +00:00
Sergey Biryukov
203b275658 Bundled Themes: Change tag cloud format to a list (<ul>) for better semantics and accessibility.
List markup allows screen reader users to know in advance how many tags are within the list.

Props xkon, davidakennedy.
Fixes #40138.
Built from https://develop.svn.wordpress.org/trunk@41756


git-svn-id: http://core.svn.wordpress.org/trunk@41590 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 23:53:47 +00:00
Gary Pendergast
37aa531cd4 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.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41589 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 23:43:46 +00:00
Sergey Biryukov
821004b1a6 Twenty Seventeen: After [41703], adjust RTL styles for tag cloud widget.
Props davidakennedy.
Fixes #40184.
Built from https://develop.svn.wordpress.org/trunk@41754


git-svn-id: http://core.svn.wordpress.org/trunk@41588 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 23:35:50 +00:00
John Blackbourn
50948669eb Users: Revert [41613], [41614], and [41623] as this feature needs some more work.
See #38741

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


git-svn-id: http://core.svn.wordpress.org/trunk@41587 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 22:17:46 +00:00
Adam Silverstein
adb8f0161b Build: Webpack instead of Browserify as JavaScript bundler.
Use Webpack as our bundler of choice, enabling improved JavaScript build chain capabilities.

Props aduth, netweb, kadamwhite, schlessera.
Fixes #40894. 

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


git-svn-id: http://core.svn.wordpress.org/trunk@41586 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 21:02:23 +00:00
Adam Silverstein
0a431ea356 Revert "Add wp.hooks - JavaScript actions and filters."
Revert `wp.hooks` for now as we continue to refine and test. 

Reverts [41375].

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


git-svn-id: http://core.svn.wordpress.org/trunk@41585 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 20:25:49 +00:00
Weston Ruter
f5bc1d1f52 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 20:02:49 +00:00
Sergey Biryukov
08b5714221 Customize: Improve the wording for Site Icon control intro.
Props michelleweber, dlh, menakas, melchoyce.
Fixes #40430.
Built from https://develop.svn.wordpress.org/trunk@41749


git-svn-id: http://core.svn.wordpress.org/trunk@41583 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 19:59:48 +00:00
John Blackbourn
be693a6181 Build/Test tools: Remove PHP 7.2 from the allowed failures list on Travis CI.
Fixes #40109

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


git-svn-id: http://core.svn.wordpress.org/trunk@41582 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 19:54:48 +00:00
Sergey Biryukov
dd4ea3c038 Customize: Improve the wording for Header Image control intro.
Props michelleweber, menakas, jcc9873, melchoyce.
Fixes #40431.
Built from https://develop.svn.wordpress.org/trunk@41747


git-svn-id: http://core.svn.wordpress.org/trunk@41581 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 19:35:47 +00:00
Mike Schroder
e8a1a7ab2b 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.
Built from https://develop.svn.wordpress.org/trunk@41746


git-svn-id: http://core.svn.wordpress.org/trunk@41580 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 19:32:47 +00:00
Adam Silverstein
eb3b3fec1d Security: Rename new wp.sanitize.sanitizeText to stripTagsAndEncodeText.'
Improve function naming: this function strips tags from a string and also encodes any HTML entities.

Props ocean90.

Fixes #40635.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 18:58:47 +00:00
K. Adam White
37ec288f71 REST API: Add _fields parameter to selectively include fields in response JSON.
Allows REST API consumers to specify the specific fields needed in their application code, whitelisting those fields and omitting all others from the returned JSON response object.
This permits applications that only need for example the ID and title of posts to avoid having to transfer the entire rendered post content over the wire alongside the desired fields.
While this whitelisting has no affect on the queries run when preparing the response, it can yield significant reductions in the bandwidth required to transfer a response payload for simple applications.

Props adamsilverstein, TimothyBlynJacobs, svrooij.
Fixes #38131.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41578 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 18:46:38 +00:00
Jeremy Felt
018a94d5f5 Multisite: Use get_site_by() in get_id_from_blogname().
Fixes #42091.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 18:45:52 +00:00
Sergey Biryukov
0f0ab0e8ef 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.
Built from https://develop.svn.wordpress.org/trunk@41742


git-svn-id: http://core.svn.wordpress.org/trunk@41576 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 18:35:46 +00:00
John Blackbourn
fbd44ee554 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

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


git-svn-id: http://core.svn.wordpress.org/trunk@41575 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 18:25:46 +00:00
Weston Ruter
c03b283f37 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41574 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 18:12:46 +00:00
Weston Ruter
55ba2f5e53 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41573 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 16:49:46 +00:00
Jeremy Felt
f646f0aa47 Multisite: Only query for one site in domain_exists().
`get_sites()` queries for a maximum of 100 records by default. In `domain_exists()`, we only use one.

A previous commit, [41736], has this same commit message but applies to `get_blog_id_from_url()` and #42073 instead.

Props danieltj, spacedmonkey.
Fixes #42072.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 16:26:45 +00:00
K. Adam White
fe29c9c881 REST API: Return 409 status when attempting to create an existing term.
Fixes an issue where submitting a well-formed request to create a term inappropriately returns a 500 error status if that term already exists.
HTTP 5xx error codes should be reserved for unexpected server errors, so "409 Conflict" is a more appropriate response.

Props alibasheer, guzzilar, shooper.
Fixes #41370.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41571 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 16:24:46 +00:00
Jeremy Felt
19e9de3367 Multisite: Only query for one site in domain_exists().
`get_sites()` queries for a maximum of 100 records by default. In `domain_exists()`, we only use one.

Props danieltj, spacedmonkey.
Fixes #42072.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41570 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 16:11:51 +00:00
John Blackbourn
090dfae53e REST API: Avoid counting an uncountable type when checking read permissions for comment posts.
This avoids deprecated notices from showing in PHP 7.2 and above.

Props ayeshrajans
Fixes #41457

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


git-svn-id: http://core.svn.wordpress.org/trunk@41569 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 15:38:49 +00:00
Sergey Biryukov
54ff178923 I18N: Make sure wp_dropdown_languages() does not print out empty name and id attributes.
Props johnjamesjacoby, afercia.
Fixes #40829.
Built from https://develop.svn.wordpress.org/trunk@41734


git-svn-id: http://core.svn.wordpress.org/trunk@41568 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 15:23:46 +00:00
Sergey Biryukov
35617e12dd I18N: In wp_dropdown_languages(), change the parsed arguments variable to $parsed_args, to prevent stomping the original $args array.
Props Mte90.
See #40829.
Built from https://develop.svn.wordpress.org/trunk@41733


git-svn-id: http://core.svn.wordpress.org/trunk@41567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 15:08:46 +00:00
Joe McGill
7e29c9646a 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41566 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 14:59:48 +00:00
K. Adam White
18d9cc6051 REST API: Specify specific json-schema version.
Explicitly specifies that the REST API uses JSON Schema draft-04,
as JSON Schema has deprecated versionless schema URIs and recommends
the use of a specific draft version.

Props @TimothyBlynJacobs
Fixes #41734


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


git-svn-id: http://core.svn.wordpress.org/trunk@41565 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 14:52:46 +00:00
John Blackbourn
20f2edbb4e I18N: Improvements to the tests for plural forms.
* Move the `create_function()` code into a file that's only loaded, and into a test that's only run, on PHP <= 7.2 to avoid deprecated warnings in 7.2+.
* Convert the test skipping into a failure if the GlotPress locale file cannot be downloaded.
* Ensure `test_exceptions` fails if an exception is not thrown.
* Docs improvements

See #41562, #40109

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


git-svn-id: http://core.svn.wordpress.org/trunk@41564 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 13:27:47 +00:00
Sergey Biryukov
44e23c2dab Twenty Sixteen: Make sure comment number comparison in comments.php works as expected.
`get_comments_number()` returns a numeric string, not an integer.

See #39660.
Built from https://develop.svn.wordpress.org/trunk@41729


git-svn-id: http://core.svn.wordpress.org/trunk@41563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 13:22:48 +00:00
Sergey Biryukov
e29c2f560b Template: Introduce readonly() form helper to complement the disabled() helper added in [13658].
Props soulseekah.
Fixes #16886.
Built from https://develop.svn.wordpress.org/trunk@41728


git-svn-id: http://core.svn.wordpress.org/trunk@41562 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 13:19:48 +00:00
Joe Hoyle
f276b4901b REST API: Support for objects in schema validation and sanitization.
When registering routes developers can now define their complex objects in the schema and benefit from the automatic validation and sanitization in the REST API. This also paves the way for support for complex object registration via register_meta and register_setting.

See #38583.
Props TimothyBlynJacobs5.
Built from https://develop.svn.wordpress.org/trunk@41727


git-svn-id: http://core.svn.wordpress.org/trunk@41561 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 08:27:47 +00:00
Weston Ruter
f8c6040ff5 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 06:48:46 +00:00
Gary Pendergast
3987df19fe Tests: Some tests in [41722] were using newer PHPUnit features.
`test_cache` used PHPUnit's object mocking to test some internal behaviour in `Plural_Forms`, but made use of the `willReturn()` method, which was introduced in PHPUnit 4.0 as shorthand for `will($this->returnValue())`. Fixed by switching to the longer form.

Several tests used the `@expectedException` directive to catch generic `Exception` exceptions, which was added in PHPUnit 3.7. Fixed by changing to an explicit `try` / `catch` test.

See #41562.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 04:11:46 +00:00
Joe McGill
760f9fd3fd Media: Use max-width for default captions.
This alters the HTML output of the image caption shortcode to use
`max-width` instead of `width` to improve compatibility with
flexible layouts.

Props aaronrutley, desrosj.
Fixes #33981.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 02:50:46 +00:00
Gary Pendergast
4f48c60803 I18N: Fix a PHP error introduced in [41722].
PHP 5.2 and 5.3 don't support short array syntax, Ryan.

Fixes #41562.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 02:12:46 +00:00
Gary Pendergast
0a3b7d8e31 I18N: Introduce the Plural_Forms class.
Historically, we've evaluated the plural forms for each language using `create_function()`. This is being deprecated in PHP 7.2, so needs to be replaced.

The `Plural_Forms` class parses the `Plural-Forms` header from the PO file, and internally caches the result of all subsequent plural form tests, allowing it to match the performance of the existing code.

Props rmccue.
Fixes #41562.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 01:30:46 +00:00
Weston Ruter
5f7a5c1246 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41555 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 00:20:45 +00:00
Weston Ruter
0909a73eed Customize: Let establish_loaded_changeset query changesets from any author not just current user when determining which changeset to autoload in non-branching mode.
See #39896.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 00:01:46 +00:00
Felix Arntz
29e5ad5528 Multisite: Improve get_blog_details() by using get_site_by().
`get_site_by()` is now the preferred way to retrieve a site object by lookup for identifying data. By using a coherent structure and `get_sites()` internally, it has several advantages over the direct database queries and complex code in `get_blog_details()`. Therefore `get_blog_details()` is now a wrapper for `get_site_by()`, providing backward compatibility fixes where necessary.

Unit tests have been adjusted to account for the `blog-details` and `blog-lookup` cache groups, which are no longer needed.

Props spacedmonkey, jeremyfelt, flixos90.
Fixes #40228.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41553 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 19:40:46 +00:00
Felix Arntz
f821106df8 Multisite: Use WP_Network_Query in ms_load_current_site_and_network().
This gets rid of the last readonly direct database query for networks in core. 🎉

Props spacedmonkey.
Fixes #41762.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41552 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 19:26:49 +00:00
Felix Arntz
1130241bbd Multisite: Replace calls to refresh_blog_details() with clean_blog_cache().
Fixes #42077. See #40201.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 19:05:46 +00:00
Felix Arntz
a9b8f70682 Multisite: Establish clean_blog_cache() as a replacement for refresh_blog_details().
Going forward, `clean_blog_cache()` is recommended to be used instead of `refresh_blog_details()`. It has been adjusted to match the functionality of the latter, with the exception that it always requires a site ID or object to be passed. The `refresh_blog_details` action has been deprecated in favor of the `clean_site_cache` action. The function itself is not formally deprecated at this point, but will likely be in the near future.

Props spacedmonkey.
Fixes #40201.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41550 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 18:41:48 +00:00
Felix Arntz
0410474758 Multisite: Add specific tests for clean_blog_cache() and refresh_blog_details().
See #40201.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41549 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 18:21:46 +00:00
John Blackbourn
2ad86e1e82 Docs: Correct some @since MU notation that was broken in [41200].
Every function introduced by MU was introduced in 3.0.0 as this was when MU was merged.

See #41509

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


git-svn-id: http://core.svn.wordpress.org/trunk@41548 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 17:44:48 +00:00
John Blackbourn
f4f31bc598 Plugins: Introduce a singular and plural form for the plugin deletion error message.
Props eddhurst, SergeyBiryukov

Fixes #38918

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


git-svn-id: http://core.svn.wordpress.org/trunk@41547 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 17:13:46 +00:00
John Blackbourn
1e1a48aaa0 Embeds: Remove the external oEmbed tests for YouTube.
These tests no longer test anything that WordPress core has control over. YouTube now serves everything
over HTTPS by default, so the tests for #23149 will always pass, and the tests for #32714 aren't testing
anything that core has control over.

Tests for the responses from oEmbed providers has been attempted and reverted in #32360.

See #42076, #32714, #23149

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


git-svn-id: http://core.svn.wordpress.org/trunk@41546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 16:52:46 +00:00
Andrea Fercia
d8ea080526 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 16:03:32 +00:00
John Blackbourn
22fd6a190b Login and Registration: Add unit tests for wp_auth_check().
Props pbearne, birgire

Fixes #41860

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


git-svn-id: http://core.svn.wordpress.org/trunk@41544 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 16:02:46 +00:00
Andrea Fercia
a452e2259b 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41543 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 15:44:46 +00:00
Andrew Ozz
d0593d59be Tools: enable Grunt precommit task to run without requiring SVN or GIT.
Fixes #41957
Built from https://develop.svn.wordpress.org/trunk@41708


git-svn-id: http://core.svn.wordpress.org/trunk@41542 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 15:20:46 +00:00
Sergey Biryukov
52ca3b18d2 HTTP API: Use WP_HTTP_Response::set_data() in ::__construct() instead of directly accessing the $data property.
Props tfrommen.
Fixes #41759.
Built from https://develop.svn.wordpress.org/trunk@41707


git-svn-id: http://core.svn.wordpress.org/trunk@41541 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 15:18:46 +00:00
Sergey Biryukov
af4cda27cc Posts, Post Types: Simplify the wording in post locking notice.
Props munyagu.
Fixes #42023.
Built from https://develop.svn.wordpress.org/trunk@41706


git-svn-id: http://core.svn.wordpress.org/trunk@41540 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 15:11:48 +00:00
Sergey Biryukov
190929cb6c Multisite: Change IP references in new site or user notifications to IP address for clarity.
Props gk.loveweb, bradparbs.
See #40382.
Built from https://develop.svn.wordpress.org/trunk@41705


git-svn-id: http://core.svn.wordpress.org/trunk@41539 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 13:13:47 +00:00
Sergey Biryukov
806b2a5af1 Comments: Change IP references in moderation option labels and email notifications to IP address for clarity.
Props mako09, gk.loveweb, bradparbs.
Fixes #40382.
Built from https://develop.svn.wordpress.org/trunk@41704


git-svn-id: http://core.svn.wordpress.org/trunk@41538 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 13:09:47 +00:00
Sergey Biryukov
f67678b59a Twenty Seventeen: Change tag cloud format to a list (<ul>) for better semantics and accessibility.
List markup allows screen reader users to know in advance how many tags are within the list.

Props sami.keijonen.
Fixes #40184.
Built from https://develop.svn.wordpress.org/trunk@41703


git-svn-id: http://core.svn.wordpress.org/trunk@41537 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 12:17:46 +00:00
Gary Pendergast
369ad06c82 Emoji: Fix incorrect emoji encoding in PHP < 5.4.
[41701] included a bug with PHP < 5.4. Prior to then, `html_entity_decode()` decoded into `ISO-8859-1`, when we actually need it to use `UTF-8`.

Fixes #35293.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41536 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 09:57:47 +00:00
Gary Pendergast
a7a57df525 Emoji: Bring Twemoji compatibility to PHP.
This was previously attempted in [41043], which unfortunately had severe performance issues, the regex it used was fatally slow on long posts.

This version now uses an array of all emoji that Twemoji supports, which maintains the accuracy of [41043], while being the same speed or only a few ms slower than the code prior to [41043].

As with [41043], the `grunt precommit:emoji` task detects when `twemoji.js` has changed, and regenerates the array.

Props jmdodd for feedback, suggestions, and insults where appropriate.
Fixes #35293. 🤞🏻


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


git-svn-id: http://core.svn.wordpress.org/trunk@41535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 07:12:50 +00:00
Jeremy Felt
7e190e496b Multisite: Use %s when building query for archived sites in WP_Site_Query.
In [25548], the `archived` column in `wp_blogs` was changed from `ENUM` to `TINYINT` to match other status fields. When `WP_Site_Query` was written later, it used `%d` as a placeholder when formatting the archived status.

It is possible that this query will fail for any installations that did not update the schema for `wp_blogs` as only single quoted values are accepted for the `ENUM` type. In this case, `'0'` or `'1'` rather than `0` or `1`.

We can work around this and support both `ENUM` and `TINYINT` in the query by using the `%s` placeholder and casting the value with `absint()`.

Props stephdau.
Fixes #38856. See #27832.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 04:40:46 +00:00
Weston Ruter
a3ad1e8c57 Customize: Update dashboard welcome link to point to themes panel in the customizer instead of themes admin screen.
Props celloexpressions.
Fixes #42050.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 04:13:46 +00:00
Jeremy Felt
a580793b82 Multisite: Introduce get_site_by().
`get_site_by()` is a replacement for `get_blog_details()` that uses `WP_Site_Query` to retrieve specific sites based on a given field and value.

Props flixos90, spacedmonkey.
Fixes #40180.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 04:10:49 +00:00
Weston Ruter
2d69c9ef4f Customize: Provide validation feedback for invalid Custom Link URLs in nav menu items.
Props RMarks, EGregor, umangvaghela123, andrew.taylor, celloexpressions, westonruter, voldemortensen.
Fixes #32816.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 03:43:47 +00:00
Joe McGill
51ee4233f1 Widgets: Default to "custom URL" in the image widget.
This changes the default value for `link_type` in the image widget
schema to 'custom'.

Props bor0, desrosj.
Fixes #41629.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 03:00:48 +00:00
Gary Pendergast
7e33702830 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.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41529 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 00:25:46 +00:00
Weston Ruter
8d79246606 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 00:22:49 +00:00
John Blackbourn
882a2a8042 Build/Test tools: Correctly delete attachment files used in the media and post thumbnail tests.
Props atanasangelovdev

Fixes #38264 

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


git-svn-id: http://core.svn.wordpress.org/trunk@41527 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 00:09:46 +00:00
John Blackbourn
f9a5f5485d I18N: Allow the login screen language to be specified via a wp_lang query variable, and use this for the interim login modal.
This allows users who are using the admin area in a language other than the site language to read the notice on the login screen
(which explains that they need to log in again) in their chosen language.

Props Nikschavan, swissspidy

Fixes #40205

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


git-svn-id: http://core.svn.wordpress.org/trunk@41526 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 23:21:47 +00:00
Sergey Biryukov
50e03e19af Login and Registration: Introduce login_title filter for the <title> tag content on login page.
The new filter mirrors the `admin_title` filter used on admin pages.

Props nishitlangaliya, henry.wright, SergeyBiryukov.
Fixes #40812.
Built from https://develop.svn.wordpress.org/trunk@41691


git-svn-id: http://core.svn.wordpress.org/trunk@41525 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 23:00:46 +00:00
Sergey Biryukov
63402326c1 Login and Registration: Make the order of <title> tag parts on login page consistent with the rest of admin pages.
Props nishitlangaliya, henry.wright.
Fixes #40814.
Built from https://develop.svn.wordpress.org/trunk@41690


git-svn-id: http://core.svn.wordpress.org/trunk@41524 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 22:30:46 +00:00
Sergey Biryukov
df0958697a Comments: Pass $comment object to comment actions:
* `delete_comment`
* `deleted_comment`
* `trash_comment`
* `trashed_comment`
* `untrash_comment`
* `untrashed_comment`
* `spam_comment`
* `spammed_comment`
* `unspam_comment`
* `unspammed_comment`

Props henry.wright.
Fixes #41228.
Built from https://develop.svn.wordpress.org/trunk@41689


git-svn-id: http://core.svn.wordpress.org/trunk@41523 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 22:15:33 +00:00
John Blackbourn
4a16295dc5 Docs: Standardise the format used for documenting parameters passed by reference.
See #35974, #41017

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


git-svn-id: http://core.svn.wordpress.org/trunk@41522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 22:14:46 +00:00
Sergey Biryukov
c5c5fb1cd3 Twenty Seventeen: Add missing labels for <aside role="complementary"> widget areas.
Props sami.keijonen.
Fixes #42056.
Built from https://develop.svn.wordpress.org/trunk@41687


git-svn-id: http://core.svn.wordpress.org/trunk@41521 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 22:04:46 +00:00
John Blackbourn
9fdbe6538e Docs: Remove & prefixes from parameter documentation to avoid doc parsing errors.
Props sudar for the original patch.

See #35974

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


git-svn-id: http://core.svn.wordpress.org/trunk@41520 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 22:03:33 +00:00
Sergey Biryukov
253541556e Widgets: Pass $instance to widget argument filters:
* `widget_archives_dropdown_args`
* `widget_archives_args`
* `widget_categories_dropdown_args`
* `widget_categories_args`
* `widget_meta_poweredby`
* `widget_pages_args`
* `widget_comments_args`
* `widget_posts_args`
* `widget_tag_cloud_args`

See [33971] for `widget_links_args` and [34662] for `widget_nav_menu_args`.

Props Takahashi_Fumiki.
Fixes #38017.
Built from https://develop.svn.wordpress.org/trunk@41685


git-svn-id: http://core.svn.wordpress.org/trunk@41519 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 22:02:47 +00:00
Andrea Fercia
a42b9cebde 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 21:52:52 +00:00
Andrea Fercia
6a6795382a 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41517 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 19:44:47 +00:00
Andrea Fercia
c56dbad284 Accessibility: Improve the Dashboard Nearby Events widget wp.a11y.speak() messages.
Avoids to announce the "city updated" message on page load.

Fixes #42037.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 19:25:45 +00:00
John Blackbourn
3dda9e9257 Embeds: Add oEmbed support for someecards.com.
Props someecards

Fixes #40792

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


git-svn-id: http://core.svn.wordpress.org/trunk@41515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 19:10:49 +00:00
John Blackbourn
7859e22ad5 Embeds: Switch the collegehumor.com oEmbed endpoint to HTTPS, as it redirects there by default now.
See #28507

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


git-svn-id: http://core.svn.wordpress.org/trunk@41514 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 19:06:46 +00:00
Weston Ruter
d8d8a01134 Customize: Fix jumping behavior upon scrolling up when a sticky header has its description expanded.
Props delawski.
See #34343, #41879.
Fixes #41850.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 18:55:47 +00:00
Adam Silverstein
5087d26d2d WP-API JS Client: Improve support for meta.
* Add/fix `getMeta`, `getMetas`, `setMeta` and `setMetas` helpers for models that support meta.
* Add tests for new helpers, verify meta support for `Posts`, `Comments`, `Tags` and `Users`.
* Include meta data in fixture generation and fixture file driving tests.

Fixes #41055.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 18:41:35 +00:00
Weston Ruter
df7af1ee21 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41511 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 18:40:48 +00:00
John Blackbourn
2e3581c3ad Embeds: Alignment following [41615].
See #38181

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


git-svn-id: http://core.svn.wordpress.org/trunk@41510 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 18:38:46 +00:00
Adam Silverstein
896d779541 Menus: Increase timeout for QUnit wpNavMenu trigger tests.
Fix an (intermittent) issue where the final assertion verifying all hooks have been triggered ran too early, resulting in the test failing. 

Fixes #31218.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41509 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 18:35:46 +00:00
John Blackbourn
acaf286151 Taxonomy: Add context and a translator comment to the new most_used label.
Fixes #41150

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


git-svn-id: http://core.svn.wordpress.org/trunk@41508 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 18:25:46 +00:00
Konstantin Obenland
1e6810e433 Widgets: Revert format of sidebars_widgets.
Restores the data format of the `sidebars_widgets` theme mod to its pre [41555]
format. It can trigger PHP warnings after switching themes if that mod has not
been removed previously.

Fixes #39693.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41507 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 18:11:46 +00:00
Weston Ruter
6db8e66b43 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41506 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 17:34:47 +00:00
Weston Ruter
31647252e7 Plugin Editor: Remove plugins_loaded from being re-triggered in plugin_sandbox_scrape().
Props jdgrimes.
Amends [41560].
Fixes #39766.

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


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

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

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


git-svn-id: http://core.svn.wordpress.org/trunk@41504 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 04:12:47 +00:00
Peter Wilson
8294b40161 Emoji: Refactor browser support tests.
Moves the repeated code in the emoji browser support test to a function to reduced the potential for errors and follow DRY principles.

Renames the "emoji4" test "emoji" as unicode version specific tests were removed in [38869].

Props peterwilsoncc, pento for code review.
Fixes #41156.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41503 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 04:00:48 +00:00
Jeremy Felt
5ccf8eebb7 Multisite: Deprecate is_user_option_local().
`is_user_option_local()` was added during MU development and used for a handful of changesets before the code using it was removed again. It has not been used by MU or core since nor is it widely used elsewhere.

Fixes #41697.
Props bnap00, jeremyfelt.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41502 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 03:38:45 +00:00
Weston Ruter
728e44ab5a 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41501 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 03:37:46 +00:00
Jeremy Felt
bdd50f28b4 Docs: Clarify docs for hooked count/date updates
See #41017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41500 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 03:20:47 +00:00
Jeremy Felt
78880a6a0b Multisite: Only update a site's post count when post types of post are updated.
Previously, the query to update the count of published posts would run every time any post type transitioned between a `publish`/non-published status or was deleted.

Props sboisvert, JPry, spacedmonkey.
Fixes #42021.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41499 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 03:09:44 +00:00
Jeremy Felt
b47cf7330c Multisite: Use get_networks() instead of a direct query in get_admin_users_for_domain().
Props spacedmonkey.
Fixes #41806.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41498 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 03:06:47 +00:00
Gary Pendergast
f0492c5da8 Database: Fix some PHP errors introduced in [41662].
PHP < 5.4 requires a `$matches` parameter to be passed to `preg_match_all()`

`wpdb::prepare()` can be called before translations are loaded, so needs appropriate `wp_load_translations_early()` calls.

See #42040.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41497 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 02:45:47 +00:00
Gary Pendergast
1603a9e067 Database: Throw a notice if wpdb::prepare() is called with an incorrect number of arguments
`wpdb::prepare()` currently gives no information if the number of arguments passed doesn't match the number of placeholders in the query. This change gives an explicit notice that the call was incorrect.

Also fixes an enrelated term meta test that was triggering this new notice.

Props thekt12 for the initial patch.
Fixes #42040.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41496 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 02:11:47 +00:00
Jeremy Felt
abdfe59c28 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41495 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 01:44:47 +00:00
Gary Pendergast
5f19289fc2 Docs: Clarify the docs for wpdb::prepare().
Make the usage of the `%` wildcard in queries clearer.

Props jrf.
Fixes #41983.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41494 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 00:22:45 +00:00
Jeremy Felt
d5acf636b0 Build/Test Tools: Add ms-files test group to sub-task list.
Previously, the `ms-files` test group would not run in any automatic configuration. This ensures it is always run as part of the test suite in Travis CI.

Props netweb.
Fixes #41698.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-01 22:16:48 +00:00
Andrea Fercia
1f4dab28fe 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41492 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-01 13:48:46 +00:00
Adam Silverstein
e23b4e9269 REST API JavaScript Client: improve support for model deletion/trash.
Update the way and location the JavaScript client determines which models/endpoints require the `force=true` parameter when being deleted to avoid a `rest_trash_not_supported` error. Identify models with endpoints that support DELETE, excluding those that support the trash (posts and pages by default). Also, move the check into the default `wp.api.WPApiBaseModel.initialize()` function.

Props caercam, euthelup.
Fixes #40672.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41491 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-01 13:07:45 +00:00
Andrew Ozz
40d84f7503 Editor: Use editor.$ to improve removeSelectionMarker().
See #42029
Built from https://develop.svn.wordpress.org/trunk@41656


git-svn-id: http://core.svn.wordpress.org/trunk@41490 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-01 10:33:47 +00:00
Andrew Ozz
5335ba8c20 Editor: pass the DOM library instance instead of a (fake) editor instance to getCursorMarkerSpan().
See #42029
Built from https://develop.svn.wordpress.org/trunk@41655


git-svn-id: http://core.svn.wordpress.org/trunk@41489 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-01 09:42:47 +00:00
Felix Arntz
eedca8f3da Multisite: Fix wp_get_users_with_no_role() possibly including users with a role on a different site.
Prior to this change, when passing another site than the current one to `wp_get_users_with_no_role()` through its `$site_id` parameter, the function still used the roles available on the current site, which would cause users with other roles that possibly exist on the other site to show up as users without a role. Switching the site before retrieving the available rules fixes the issue.

Fixes #42015.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41488 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-30 04:10:45 +00:00
Felix Arntz
5edfea22b9 Multisite: Fix count_users() possibly querying incorrect roles when passed a different site ID.
The `time` strategy in `count_users()` queries users by role. However, the roles queried for were not affected by passing another site than the current one through the `$site_id` parameter, causing users having roles that were not queried for to appear as users without a role. This changeset fixes the issue by switching the site before retrieving the roles to query for.

Fixes #42014.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41487 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-30 03:54:45 +00:00
Felix Arntz
b0aaa16b32 Multisite: Display correct roles in Network > Site Users screen for sites other than the main site.
Props jeremyfelt.
Fixes #42013.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41486 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-30 03:20:46 +00:00
Weston Ruter
e0c3951b08 Embeds: Cache oEmbeds in an oembed_cache custom post type instead of postmeta when there is no global $post.
Add processing of embeds to rich Text widget.

Props swissspidy, westonruter, ocean90, johnbillion.
See #40854, #39994, #40935.
Fixes #34115.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41485 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-30 01:15:48 +00:00
Weston Ruter
e90b5ee669 Customize: Remove unused JS variables to fix JSHint.
Amends [41649].
See #37661, #39896.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41484 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 22:04:47 +00:00
Weston Ruter
57044ac71e 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41483 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 21:52:45 +00:00
Weston Ruter
76f590b99b 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41482 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 20:13:50 +00:00
John Blackbourn
fb30317bad Build/Test tools: Partially revert [41367] as gd and exif aren't actually required to run WordPress.
See #41851

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


git-svn-id: http://core.svn.wordpress.org/trunk@41481 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 19:57:47 +00:00
Andrew Ozz
309c5559b4 Editor: improve attaching a callback on editor init.
See #42029
Built from https://develop.svn.wordpress.org/trunk@41646


git-svn-id: http://core.svn.wordpress.org/trunk@41480 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 19:12:47 +00:00
Andrew Ozz
e4bd7a86a6 Editor: Improve keeping text selection when switching between Visual and Text modes.
Props biskobe.
See #42029.
Built from https://develop.svn.wordpress.org/trunk@41645


git-svn-id: http://core.svn.wordpress.org/trunk@41479 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 17:50:45 +00:00
Sergey Biryukov
c1686e75bf Posts, Post Types: Correct test_submitting_comment_to_trashed_post_returns_error().
`wp_trash_post()` accepts a post ID, not a `WP_Post` object.

See #42030.
Built from https://develop.svn.wordpress.org/trunk@41644


git-svn-id: http://core.svn.wordpress.org/trunk@41478 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 15:10:47 +00:00
Andrew Ozz
8fc05d8fba TinyMCE: fix "flickering inline toolbar" in Chrome in RTL mode by not showing tooltips while an inline toolbar is shown.
Fixes #42018.
Built from https://develop.svn.wordpress.org/trunk@41643


git-svn-id: http://core.svn.wordpress.org/trunk@41477 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 14:25:47 +00:00
Sergey Biryukov
79ffa7ff2a Posts, Post Types: In wp_delete_post(), wp_trash_post(), wp_untrash_post(), and wp_delete_attachment(), standardize on WP_Post as a return value and internal representation of the post data.
Props bor0, SergeyBiryukov.
Fixes #42030.
Built from https://develop.svn.wordpress.org/trunk@41642


git-svn-id: http://core.svn.wordpress.org/trunk@41476 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 13:36:46 +00:00
Sergey Biryukov
6a2b59745e I18N: Use a consistent pattern for translator comments for placeholders in wp-admin/includes/dashboard.php.
See #41974.
Built from https://develop.svn.wordpress.org/trunk@41641


git-svn-id: http://core.svn.wordpress.org/trunk@41475 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 11:44:45 +00:00
Sergey Biryukov
10c46f5751 I18N: Use a consistent pattern for translator comments for placeholders in Customizer and widget strings.
Props danieltj, Rahmohn.
Fixes #41974.
Built from https://develop.svn.wordpress.org/trunk@41640


git-svn-id: http://core.svn.wordpress.org/trunk@41474 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 11:42:48 +00:00
Sergey Biryukov
033b371145 I18N: Improve i18n in help text for Custom HTML widget and Additional CSS section.
Fixes #42032.
Built from https://develop.svn.wordpress.org/trunk@41639


git-svn-id: http://core.svn.wordpress.org/trunk@41473 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 11:10:50 +00:00
Sergey Biryukov
70925e6741 Posts, Post Types: Introduce pre_trash_post and pre_untrash_post filters to allow for short-circuiting wp_trash_post() and wp_untrash_post().
This brings parity with `pre_delete_post` filter in `wp_delete_post()`, introduced in [34082].

Props bor0.
Fixes #42030.
Built from https://develop.svn.wordpress.org/trunk@41638


git-svn-id: http://core.svn.wordpress.org/trunk@41472 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 10:19:49 +00:00
John Blackbourn
32b555d0a7 Build/Test tools: Update the WP_PHPUnit_Util_Getopt class for PHP 7.2 compatibility.
This removes usage of `each()` which is deprecated in PHP 7.2.

Props ayeshrajans

See #40109
Fixes #41525

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


git-svn-id: http://core.svn.wordpress.org/trunk@41471 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-28 23:15:47 +00:00
John Blackbourn
d306285fa2 Build/Test tools: Update some test cases in anticipation of code formatting corrections.
These two tests assume a certain level of indentation in code which does not conform to core's coding
standards and will hopefully be corrected at some point in #41057.

See #41057

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


git-svn-id: http://core.svn.wordpress.org/trunk@41470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-28 22:56:50 +00:00
Dominik Schilling
9e097490af Embeds: In switched state, restore previous state if no post ID is found.
Fixes #40673.
Built from https://develop.svn.wordpress.org/trunk@41634


git-svn-id: http://core.svn.wordpress.org/trunk@41469 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-28 16:29:45 +00:00
John Blackbourn
0d629ec963 External Libraries: Update the Text_Diff_Engine_native class for PHP 7.2 compatibility.
This removes usage of `each()` and usage of text strings passed to `assert()`.

Props bor0

Fixes #41526

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


git-svn-id: http://core.svn.wordpress.org/trunk@41468 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-28 13:59:45 +00:00
Gary Pendergast
c805479c8b Docs: Update the documentation for wpdb::prepare()
The inline documentation for `wpdb::prepare()` was kind of confusing, and didn't describe some of the behaviour correctly.

Fixes #41983.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41467 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-28 11:45:45 +00:00
Gary Pendergast
3a4e78f9bd 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.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-28 07:58:46 +00:00
Gary Pendergast
ef3720ac49 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.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41465 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-28 06:45:46 +00:00
Gary Pendergast
dbd93ddbb6 Database: Add support for connecting to IPv6 hosts
IPv4 addresses are scarce, overworked, and underpaid. They're ready to retire, but we just won't let them go. If you care about their wellbeing, switch to IPv6 today.

Props schlessera, birgire.
Fixes #41722.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41464 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-28 05:37:44 +00:00
Gary Pendergast
0028a9555e 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.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41463 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-28 04:32:46 +00:00
Gary Pendergast
88f71a8adf Options: Add new alloptions and pre_cache_alloptions filters.
`pre_cache_alloptions` is run before the alloptions array is inserted into the cache, and is valuable for sanity checking the options, particularly if your caching scheme has size limitations.

`alloptions` is run before returning the alloptions array, and is useful for when you have extra information that alloptions should return.

Props sebastian.pisula, keesiemeijer.
Fixes #33958.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41462 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-28 00:23:47 +00:00
Weston Ruter
8043c2d8e5 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41461 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 22:25:46 +00:00
Felix Arntz
0892a6ebbf Multisite: Improve initializing available roles when switch sites.
Switching the available roles and the current user's capabilities no longer happens in `switch_to_blog()` and `restore_current_blog()`, instead it has been moved to a new function `wp_switch_roles_and_user()` which is hooked into the site switching process. This allows to improve performance by temporarily unhooking the function when roles and capabilities do not need to be switched.

This change ensures that switching available roles now works closer to switching user capabilities, particularly the changes in [41624]. A new `WP_Roles::for_site( $site_id )` method has been introduced, and the `WP_Roles::_init()` method has been deprecated. It is furthermore possible to retrieve the site ID for which the available roles are currently initialized through a new `WP_Roles::get_site_id()`.

Props johnjamesjacoby, flixos90.
Fixes #38645.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41460 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 21:44:44 +00:00
Felix Arntz
21f18c2d30 Multisite: Initialize a user's roles correctly when setting them up for a different site.
While it has always been possible to initialize a user's roles and capabilities for another site than the current one in a multisite, the actual roles available were not switched prior to this change, possibly causing invalid roles to show up or actually valid capabilities not being available.

In order to fix this bug in a clean way, relevant parts of the `WP_User` class have been refactored. The ID of the site for which capabilities are currently initialized are now stored in a private property `WP_User::$site_id`. The `WP_User::for_blog( $blog_id )` and `WP_User::_init_caps( $cap_key )` methods have been deprecated in favor of `WP_User::for_site( $site_id )`. In addition, a new method `WP_User::get_site_id()` has been introduced to retrieve the site ID for which the user's capabilities are currently initialized.

Props ryanduff, jeremyfelt, flixos90.
Fixes #36961.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41459 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 21:10:45 +00:00
John Blackbourn
7fc820382a Users: Remove the failing tests added in [41613] while they're investigated.
See #38741

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


git-svn-id: http://core.svn.wordpress.org/trunk@41458 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 17:42:46 +00:00
Andrea Fercia
c65fe27ba1 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41457 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 17:27:45 +00:00
Andrea Fercia
8c7a2b1d54 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41456 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 16:29:44 +00:00
Andrew Ozz
ddfa468e38 TinyMCE: disable the tests for wptextpatterns plugin in PhantomJS.
See #42009
Built from https://develop.svn.wordpress.org/trunk@41620


git-svn-id: http://core.svn.wordpress.org/trunk@41455 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 16:22:46 +00:00
Pascal Birchler
f71a685b11 Upgrade/Install: Update unit tests after [41611].
See #40764.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41454 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 15:15:47 +00:00
John Blackbourn
2429d4acea 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

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


git-svn-id: http://core.svn.wordpress.org/trunk@41453 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 14:39:45 +00:00
John Blackbourn
50a7d2b121 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

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


git-svn-id: http://core.svn.wordpress.org/trunk@41452 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 14:17:45 +00:00
John Blackbourn
5c7a7a2989 Embeds: Documentation alignment following [41615].
See #38181

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


git-svn-id: http://core.svn.wordpress.org/trunk@41451 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 13:27:44 +00:00
John Blackbourn
4b76c1f22f Embeds: Add support for Amazon Kindle instant previews.
Props jsepia, morganestes, adamsilverstein, swissspidy, jbpaul17, johnbillion, rugved

Fixes #38181

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


git-svn-id: http://core.svn.wordpress.org/trunk@41450 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 13:26:45 +00:00
John Blackbourn
255658fa31 Users: There is not, in fact, 12345 users on every WordPress installation.
Props spacedmonkey

See #38741

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


git-svn-id: http://core.svn.wordpress.org/trunk@41449 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 13:07:46 +00:00
John Blackbourn
807bc5a6c9 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

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


git-svn-id: http://core.svn.wordpress.org/trunk@41448 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 13:04:47 +00:00
Pascal Birchler
0fe4c3b3f2 Upgrade/Install: Fix updating plugins on the Add Plugins screen.
Props imath.
Fixes #41407.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41447 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 11:59:47 +00:00
Pascal Birchler
2dd83960b9 Upgrade/Install: Show new version number when updating a theme on Multisite.
Props afragen.
Fixes #40764.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 09:44:45 +00:00
Pascal Birchler
95d8b4fa44 Themes: Adjust unit test after [41607].
Props ocean90.
See #40820.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41445 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 08:53:44 +00:00
Pascal Birchler
5e7ce2a61a Plugins: Fix version number in docblock after [41608].
Props ocean90.
See #37430.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41444 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 08:52:47 +00:00
Pascal Birchler
1f5c7470fb 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41443 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 08:46:45 +00:00
Pascal Birchler
e7beaa590f Themes: Adjust translated string after [41601].
Props obenland.
See #40820.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41442 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 08:38:45 +00:00
Pascal Birchler
81a8f1cffe Embeds: Maintain switched state when embedding a post on Multisite.
Props bor0.
Fixes #40673.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41441 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 08:36:48 +00:00
Dion Hulse
db86c635ba 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41440 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 08:00:49 +00:00
Andrew Ozz
b32256701a TinyMCE: update to 4.6.7, changelog: https://www.tinymce.com/docs/changelog/#version467september182017.
Fixes #41996 #40956
Built from https://develop.svn.wordpress.org/trunk@41604


git-svn-id: http://core.svn.wordpress.org/trunk@41439 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-26 21:15:47 +00:00
Weston Ruter
cb8173e053 Customize: Dismiss all autosaved auto-drafts for user and not just the one suggested when dismissing restoration notification.
Amends [41597].
See #39896.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41438 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-26 20:33:46 +00:00
Mel Choyce
eb38b0da9b Customizer: Improve small-screen styles in Widgets panel.
Props mrasharirfan, mrahmadawais.
Fixes #41614.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41437 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-26 19:05:46 +00:00
Pascal Birchler
1ac10346ce Themes: Report theme as broken that sets itself as its parent.
Props davilera.
Fixes #40820.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41436 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-26 08:54:47 +00:00
Pascal Birchler
742fc18cca Embeds: Improve performance when embedding a post on Multisite.
After [37798], this fixes embeds coming from a different site in the network.

Props imath.
Fixes #40673. See #36767. 

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


git-svn-id: http://core.svn.wordpress.org/trunk@41435 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-26 08:40:47 +00:00
Dion Hulse
af3c440b1d Embeds: Switch the Imgur oEmbed endpoint to use SSL as the HTTP version has been deprecated.
Props swissspidy.
Fixes #41984.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41434 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-26 08:33:44 +00:00
Pascal Birchler
fce70235f2 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-26 08:24:46 +00:00
Weston Ruter
1a7616ad54 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41430 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-26 07:38:45 +00:00
Felix Arntz
85712eb281 Multisite: Fix documentation issues for domain_exists().
Props stevenlinx.
Fixes #41619.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41429 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-26 00:12:45 +00:00
Weston Ruter
f1779f24ed 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41428 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-25 21:46:47 +00:00
Konstantin Obenland
eea0e5f6f5 Widgets: Merge orphaned widgets on theme switch
Merges orphaned widgets into the inactive sidebar when switching themes.

Props bpayton.
See #39693.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41427 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-25 16:19:46 +00:00
Sergey Biryukov
9597082ec9 Twenty Seventeen: Add Docker Hub icon to supported social links.
Props xkon.
Fixes #41529.
Built from https://develop.svn.wordpress.org/trunk@41593


git-svn-id: http://core.svn.wordpress.org/trunk@41426 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-25 13:49:43 +00:00
Sergey Biryukov
01efcd51a6 Twenty Seventeen: Add Periscope icon to supported social links.
Props xkon.
Fixes #40959.
Built from https://develop.svn.wordpress.org/trunk@41592


git-svn-id: http://core.svn.wordpress.org/trunk@41425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-25 13:14:45 +00:00
Sergey Biryukov
486ab09a0e I18N: Add translator comments for placeholders in WP_REST_Controller strings.
Props ramiy.
Fixes #41667.
Built from https://develop.svn.wordpress.org/trunk@41591


git-svn-id: http://core.svn.wordpress.org/trunk@41424 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-25 10:27:43 +00:00
Weston Ruter
bb97df7b5f 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41423 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-25 06:28:45 +00:00
Sergey Biryukov
4865841343 Posts, Post Types: Pass the order parameter to get_{$adjacent}_post_sort filter.
Props manchumahara.
Fixes #41924.
Built from https://develop.svn.wordpress.org/trunk@41589


git-svn-id: http://core.svn.wordpress.org/trunk@41422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-24 23:01:44 +00:00
Sergey Biryukov
4a42f4e835 I18N: Replace code fragments in translatable strings for rest_trash_not_supported errors with a placeholder.
Props ramiy.
Fixes #41643.
Built from https://develop.svn.wordpress.org/trunk@41588


git-svn-id: http://core.svn.wordpress.org/trunk@41421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-24 22:29:46 +00:00
Sergey Biryukov
982ba72da9 I18N: Replace method name in a translatable string in WP_REST_Controller::register_routes() with a placeholder.
Props ramiy.
Fixes #41667.
Built from https://develop.svn.wordpress.org/trunk@41587


git-svn-id: http://core.svn.wordpress.org/trunk@41420 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-24 22:04:46 +00:00
Andrea Fercia
d1948f623a 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-24 16:00:46 +00:00
Sergey Biryukov
0170c40e24 Plugins: Restore "Clear List" button functionality for recently active plugins.
Props obenland.
Fixes #41080.
Built from https://develop.svn.wordpress.org/trunk@41585


git-svn-id: http://core.svn.wordpress.org/trunk@41418 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-24 15:16:46 +00:00
Andrew Ozz
a5f8097899 Retire Press This and extract it to a plugin. First run.
Props kraftbj, azaozz.
See #41689.
Built from https://develop.svn.wordpress.org/trunk@41584


git-svn-id: http://core.svn.wordpress.org/trunk@41417 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-24 14:22:54 +00:00
Sergey Biryukov
400bc41731 I18N: Allow for post custom field name in the_meta() to be translated, e.g. to insert a non-breaking space before the colon.
Props audrasjb, johnbillion.
Fixes #41653.
Built from https://develop.svn.wordpress.org/trunk@41583


git-svn-id: http://core.svn.wordpress.org/trunk@41416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-24 11:28:46 +00:00
Weston Ruter
58761c1ff2 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41415 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-23 18:46:49 +00:00
Sergey Biryukov
d379f839cf 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.
Built from https://develop.svn.wordpress.org/trunk@41581


git-svn-id: http://core.svn.wordpress.org/trunk@41414 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-23 17:07:46 +00:00
Sergey Biryukov
29fa55f71d Twenty Sixteen: After [41343], add missing space to if condition in twentysixteen_content_image_sizes_attr().
Fixes #38468.
Built from https://develop.svn.wordpress.org/trunk@41580


git-svn-id: http://core.svn.wordpress.org/trunk@41413 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-23 12:25:45 +00:00
Sergey Biryukov
fa5abb2474 I18N: Remove HTML tags from translatable strings in wp-activate.php.
Props ramiy.
Fixes #41645.
Built from https://develop.svn.wordpress.org/trunk@41579


git-svn-id: http://core.svn.wordpress.org/trunk@41412 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-23 12:21:47 +00:00
Sergey Biryukov
649eb34d2a Login and Registration: Replace home URL in password reset email with the site name to avoid confusing the user with multiple links.
Props Presskopp, code-monkey.
Fixes #38328.
Built from https://develop.svn.wordpress.org/trunk@41578


git-svn-id: http://core.svn.wordpress.org/trunk@41411 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-23 11:44:46 +00:00
Sergey Biryukov
b844c63db0 Customize: Tweak "New Custom HTML Widget" pointer text to be a bit less informal and more inclusive.
Props birgire, mrasharirfan, danieltj.
Fixes #41798.
Built from https://develop.svn.wordpress.org/trunk@41577


git-svn-id: http://core.svn.wordpress.org/trunk@41410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-23 11:26:46 +00:00
Sergey Biryukov
c28cc57f3b Quick/Bulk Edit: Remove duplicate inline-edit-{$screen->post_type} CSS class from Quick Edit table rows.
Props ibachal.
Fixes #41906.
Built from https://develop.svn.wordpress.org/trunk@41576


git-svn-id: http://core.svn.wordpress.org/trunk@41409 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-23 11:02:46 +00:00
Sergey Biryukov
77f011704e XML-RPC: Update the string in test_parent_for_nonhierarchical() to match the string added in [41574].
Props netweb.
Fixes #41637.
Built from https://develop.svn.wordpress.org/trunk@41575


git-svn-id: http://core.svn.wordpress.org/trunk@41408 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-23 08:20:49 +00:00
Sergey Biryukov
b8edb91f43 I18N: Merge two similar "Cannot set parent term" error strings.
Props ramiy.
Fixes #41637.
Built from https://develop.svn.wordpress.org/trunk@41574


git-svn-id: http://core.svn.wordpress.org/trunk@41407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-22 22:08:46 +00:00
Sergey Biryukov
6fa2cea232 Docs: Add @access private entries for _get_component_from_parsed_url_array() and _wp_translate_php_url_constant_to_key().
Props ajayghaghretiya1.
Fixes #41282.
Built from https://develop.svn.wordpress.org/trunk@41573


git-svn-id: http://core.svn.wordpress.org/trunk@41406 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-22 22:00:47 +00:00
Sergey Biryukov
bcb126292c I18N: Merge two similar error strings.
Props ramiy.
Fixes #39172.
Built from https://develop.svn.wordpress.org/trunk@41572


git-svn-id: http://core.svn.wordpress.org/trunk@41405 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-22 20:55:45 +00:00
Andrew Ozz
58b769a057 Plupload: also delete plupload.full.min.js when updating.
See #41755.
Built from https://develop.svn.wordpress.org/trunk@41571


git-svn-id: http://core.svn.wordpress.org/trunk@41404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-22 20:48:46 +00:00
Andrew Ozz
41ad3f294f Plupload: minify and load plupload.js and moxie.js separately to make them easier to debug.
Props gmariani405, azaozz.
Fixes #41755.
Built from https://develop.svn.wordpress.org/trunk@41570


git-svn-id: http://core.svn.wordpress.org/trunk@41403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-22 20:10:48 +00:00
Sergey Biryukov
b07cffe99a Media: Improve the preview of transparent images in Attachment Details modal by using CSS3 to show a checkered background.
Props powerzilly, stevepuddick.
Fixes #41948.
Built from https://develop.svn.wordpress.org/trunk@41569


git-svn-id: http://core.svn.wordpress.org/trunk@41402 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-22 19:57:47 +00:00
Sergey Biryukov
7c4cdbff27 Admin CSS: Autoprefixer for [41329].
See #39662.
Built from https://develop.svn.wordpress.org/trunk@41568


git-svn-id: http://core.svn.wordpress.org/trunk@41401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-22 19:51:47 +00:00
Sergey Biryukov
ba67e5f09c Docs: Correct filename references in duplicate hook comments for post_password_required filter.
Props coffee2code.
Fixes #41959.
Built from https://develop.svn.wordpress.org/trunk@41567


git-svn-id: http://core.svn.wordpress.org/trunk@41400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-22 18:34:45 +00:00
Sergey Biryukov
c2dcfa5278 Help/About: Tweak Help tabs on Users screen for consistency with Posts screen.
Props bnap00, Arena94.
Fixes #40553.
Built from https://develop.svn.wordpress.org/trunk@41566


git-svn-id: http://core.svn.wordpress.org/trunk@41399 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-22 18:31:48 +00:00
Sergey Biryukov
f69b784ec7 Embeds: Introduce embed_thumbnail_id filter for thumbnail image ID in the embed template.
Props ketuchetan, Dency, jontyravi, Ov3rfly.
Fixes #39759.
Built from https://develop.svn.wordpress.org/trunk@41565


git-svn-id: http://core.svn.wordpress.org/trunk@41398 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-22 17:35:48 +00:00
Sergey Biryukov
5046ef73c3 Docs: Correct description for insert_user_meta filter.
Props milana_cap, desrosj.
Fixes #41951.
Built from https://develop.svn.wordpress.org/trunk@41564


git-svn-id: http://core.svn.wordpress.org/trunk@41397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-22 13:14:45 +00:00
Sergey Biryukov
4db08514ea 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.
Built from https://develop.svn.wordpress.org/trunk@41563


git-svn-id: http://core.svn.wordpress.org/trunk@41396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-22 11:28:44 +00:00
Sergey Biryukov
fff6cc8fc8 Docs: Change $args to $r in the DocBlock for http_api_debug filter to match the variable name.
Props bor0, ronakganatra.
Fixes #41379.
Built from https://develop.svn.wordpress.org/trunk@41562


git-svn-id: http://core.svn.wordpress.org/trunk@41395 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-22 09:33:47 +00:00
Weston Ruter
bf1eb1b505 Plugin Editor: Use include_once instead of include in plugin_sandbox_scrape() to fix unit tests broken with [41560].
See #39766.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-22 02:01:45 +00:00
Weston Ruter
aff467e1cb 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-22 01:36:48 +00:00
Adam Silverstein
415e9379f9 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41392 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-21 23:33:44 +00:00
Weston Ruter
f0b5c39bde 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-21 23:04:45 +00:00
Adam Silverstein
43eb51d4a6 Customizer: retain aspect ration when cropping media w/ shift+click/drag.
Enforce a 1:1 ratio when holding the shift key and dragging in the image cropping tool in the customizer context.

Props melchoyce, mikeschroder.
Fixes #40211.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41390 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-21 22:45:44 +00:00
Adam Silverstein
220d5aec74 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.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-21 21:29:48 +00:00
Konstantin Obenland
27536e99c5 Widgets: Improved sidebar mapping on theme switch
Builds on efforts brought forward in #17979.

This will send sidebars through three levels of mapping:

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

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

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


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


git-svn-id: http://core.svn.wordpress.org/trunk@41388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-21 18:46:46 +00:00
Andrew Ozz
76296ef657 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.
Built from https://develop.svn.wordpress.org/trunk@41554


git-svn-id: http://core.svn.wordpress.org/trunk@41387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-21 16:35:48 +00:00
Adam Silverstein
639d215300 REST API JS Client: Improve nonce handling, refresh stale nonce on sync.
Keep the nonce used for cookie based authentication fresh by pulling in and using any new nonce supplied in the response headers.

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

Fixes #40422.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-21 12:58:45 +00:00
John Blackbourn
9aeedde6ae Multisite: Correct the docs for maybe_add_existing_user_to_blog().
See #41017

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


git-svn-id: http://core.svn.wordpress.org/trunk@41385 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-21 12:28:44 +00:00
Sergey Biryukov
da3e29eeba Docs: Use correct order of arguments in the DocBlock for WP_Hook::has_filter().
Props munyagu.
Fixes #41941.
Built from https://develop.svn.wordpress.org/trunk@41551


git-svn-id: http://core.svn.wordpress.org/trunk@41384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-21 10:00:48 +00:00
Weston Ruter
800ad7bd04 Customize: Let media control button labels better automatically reflect the specified MIME type.
Props Christian1012, celloexpressions, westonruter.
Fixes #38796.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41383 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-20 21:24:46 +00:00
Weston Ruter
379e0371dd Widgets: Omit attributes from an Image widget's link when they are empty.
Props subrataemfluence, Nenad Obradovic, westonruter.
See #39993.
Fixes #41919.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41382 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-20 19:45:46 +00:00
Sergey Biryukov
6918752529 Twenty Seventeen: Document the type of $item argument in twentyseventeen_dropdown_icon_to_menu_link() more accurately.
Props ndoublehwp.
Fixes #41923.
Built from https://develop.svn.wordpress.org/trunk@41548


git-svn-id: http://core.svn.wordpress.org/trunk@41381 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-20 18:15:46 +00:00
Weston Ruter
067970ca82 Widgets: Add Customizer preview support to the Category widget when navigating to a category via dropdown.
Switch to using a `form` that is submitted as opposed to making a direct JavaScript call to change the `window.location`. This ensures the Customizer is able to inject the customized state into the request.

Fixes #41671.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41380 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-20 03:16:46 +00:00
Dominik Schilling
f2589e222e Taxonomy/Users: Use correct escaping function for URLs.
Built from https://develop.svn.wordpress.org/trunk@41522


git-svn-id: http://core.svn.wordpress.org/trunk@41355 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-19 21:14:47 +00:00
Aaron Campbell
fc930d3dae Database: Hardening to bring wpdb::prepare() inline with documentation.
`wpdb::prepare()` supports %s, %d, and %F as placeholders in the query string. Any other non-escaped % will be escaped.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-19 17:56:45 +00:00
Aaron Campbell
5225e026ef Database: Don’t trigger _doing_it_wrong() for null values in wpdb::prepare().
While `wpdb::prepare()` does not support null values (see #12819) they still appear in the wild like in the WordPress Importer and other plugins.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41316 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-19 16:06:45 +00:00
Aaron Campbell
70b2127909 Database: Hardening for wpdb::prepare()
Previously if you passed an array of values for placeholders, additional values could be passed as well. Now additional values will be ignored.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-19 14:48:47 +00:00
John Blackbourn
69de73224f Filesystem API: Ensure filenames are valid before attempting to unzip them to ensure malformed file paths don't cause issues.
Built from https://develop.svn.wordpress.org/trunk@41457


git-svn-id: http://core.svn.wordpress.org/trunk@41290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-19 14:36:47 +00:00
Aaron Campbell
1115a36cda oEmbed: Add extra hardening around allowed HTML for improved sandboxing.
Built from https://develop.svn.wordpress.org/trunk@41448


git-svn-id: http://core.svn.wordpress.org/trunk@41281 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-19 13:43:05 +00:00
John Blackbourn
e088205014 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

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


git-svn-id: http://core.svn.wordpress.org/trunk@41232 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-19 10:11:43 +00:00
Dominik Schilling
9041e7a071 Taxonomy/Users: Provide a fallback for incorrect HTTP referrers.
Built from https://develop.svn.wordpress.org/trunk@41398


git-svn-id: http://core.svn.wordpress.org/trunk@41231 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-19 09:13:44 +00:00
Dominik Schilling
12694b6b92 Customize: Ensure valid themes in the preview.
Built from https://develop.svn.wordpress.org/trunk@41397


git-svn-id: http://core.svn.wordpress.org/trunk@41230 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-19 08:39:45 +00:00
Dominik Schilling
83853f9fd2 TinyMCE: Improve the previews for shortcodes.
Built from https://develop.svn.wordpress.org/trunk@41395


git-svn-id: http://core.svn.wordpress.org/trunk@41228 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-19 08:19:45 +00:00
Dominik Schilling
c2ead9d046 Editor: Prevent adding javascript: and data: URLs through the inline link dialog.
Built from https://develop.svn.wordpress.org/trunk@41393


git-svn-id: http://core.svn.wordpress.org/trunk@41226 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-19 08:01:45 +00:00
Weston Ruter
f6a26be345 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41223 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-19 05:40:44 +00:00
Weston Ruter
d544ac92f0 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41222 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-19 00:46:45 +00:00
Weston Ruter
3abea17301 Customize: Add wp_is_uuid() validation function with optional second $version=4 parameter to enforce v4 random UUIDs.
Props jonathanbardo.
Fixes #39778.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-18 23:04:44 +00:00
Weston Ruter
19e3d8bc41 Customize: Use input event instead of keyup or propertychange events when listening for changes in wp.customize.Element instances.
Ensures that a control's `Element` is updated in response to pasting into the field. Also fixes issue where inputs using "new" HTML5 types (like `url` and `number`) were not updating in the preview during keystrokes. The use of `input` was previously blocked due to needing to support IE9, but this is no longer a concern since IE<11 is no longer supported.

See #38845, #28477.
Fixes #35832.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41220 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-18 19:11:48 +00:00
Peter Wilson
10970701d7 Emoji: Invert value returned by UN test for accuracy.
The JavaScript testing for UN flag support was passing when it failed, and failing when it passes.

This inverts the result to take more traditional approach of returning the correct result.

Unprops Pento.
Fixes #41852.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41219 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-17 22:52:47 +00:00
Weston Ruter
c8eb741afd Code Editor: Remove scrollIntoView of editor's cursor line upon focus to prevent jumping issues for editor scroll position.
See #41850, #41879.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41218 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-17 03:58:44 +00:00
Weston Ruter
e5b3921ca4 Code Editor: Scroll the cursor line into view instead of the entire editor when focused.
See #41850.
Fixes #41879.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41217 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-17 03:35:47 +00:00
Sergey Biryukov
2f701f7d0e Media: Rename "Insert Media" window title to "Add Media" for consistency with the "Add Media" button.
Props danieltj.
Fixes #41704.
Built from https://develop.svn.wordpress.org/trunk@41383


git-svn-id: http://core.svn.wordpress.org/trunk@41216 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-16 11:03:45 +00:00
Sergey Biryukov
ca92da1dcc Twenty Fifteen: Add missing comma in ie.css.
Props lalitpendhare.
Fixes #41890.
Built from https://develop.svn.wordpress.org/trunk@41382


git-svn-id: http://core.svn.wordpress.org/trunk@41215 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-16 05:12:48 +00:00
Adam Silverstein
6b3432b9a4 JSDocs: add the jsdoc folder to .gitignore and svn:ignore.
Props netweb.
Fixes #41682.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41214 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-15 20:14:47 +00:00
Felix Arntz
f2d9abd022 Multisite: Introduce get_main_site_id().
This function can be used to easily get the main site ID of a given network via the optional `$network_id` parameter, which defaults to the current network. The existing `is_main_site()` now uses the new function internally and now accepts an optional `$network_id` parameter as well.

The main purpose of the new function at this point is to ensure that the `WP_Network::$blog_id` property is always set. Magic getters in the class have been adjusted to auto-fill the property when it is accessed and empty. Furthermore the function encapsulates logic that was previously part of `ms_load_current_site_and_network()` and has been replaced with a call to the function now.

Props spacedmonkey, jeremyfelt, johnjamesjacoby, flixos90.
Fixes #29684.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41213 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-15 11:15:52 +00:00
Adam Silverstein
938e93fe1f wp.sanitize - fix namespace for calls to stripTags.
Fixes an `undefined` JavaScript error in PressThis since [41061].

Props afercia.
Fixes #41883.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41212 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-14 19:29:44 +00:00
Sergey Biryukov
1929ba612e Taxonomy: Allow for adding custom list table views to taxonomy screens.
Props eventualo, mariovalney, riddhiehta02, llemurya.
Fixes #30829.
Built from https://develop.svn.wordpress.org/trunk@41378


git-svn-id: http://core.svn.wordpress.org/trunk@41211 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-13 15:20:44 +00:00
Boone Gorges
3f7bc21548 Taxonomy: Force a DISTINCT term query when result count matters.
Generally, duplicate terms returned by a term query are eliminated in PHP,
after the database query takes place. This technique doesn't work properly
when the query parameters specify the `number` of results, since the results
of a `SELECT ... LIMIT x...` query may be deduplicated to a count less than
`x`. In these cases, we force the original query to be `DISTINCT`.

Props elvishp2006.
Fixes #41796.
Built from https://develop.svn.wordpress.org/trunk@41377


git-svn-id: http://core.svn.wordpress.org/trunk@41210 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-13 14:48:45 +00:00
Weston Ruter
90bedf8f9d 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41209 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-13 06:08:47 +00:00
Adam Silverstein
f36cccde7e Add wp.hooks - JavaScript actions and filters.
Add a JavaScript hooks library with an API that mirrors the WordPress Plugin API; provides similar functionality and API to PHP hooks.

Called via the global `wp.hooks`, eg: `wp.hooks.addAction()`, etc. Adds:

* `addAction( 'hook', 'vendor/plugin/function', callback, priority )`
* `addFilter( 'hook', 'vendor/plugin/function', callback, priority )`
* `removeAction( 'hook', 'vendor/plugin/function' )`
* `removeFilter( 'hook',  'vendor/plugin/function' )`
* `removeAllActions( 'hook' )`
* `removeAllFilters( 'hook' )`
* `doAction( 'hook', arg1, arg2, moreArgs, finalArg )`
* `applyFilters( 'hook', content, arg1, arg2, moreArgs, finalArg )`
* `doingAction( 'hook' )`
* `doingFilter( 'hook' )`
* `didAction( 'hook' )`
* `didFilter( 'hook' )`
* `hasAction( 'hook' )`
* `hasFilter( 'hook' )`

Props adamsilverstein, jnylen0, aduth, kadamwhite, youknowriad, schlessera, mikeschinkel, azaozz, vhauri, CaptainN, scribu, carldanley, chetanchauhan, mgibbs189, stephenharris, justnorris, koopersmith, gcorne, TV productions, atimmer.

Fixes #21170.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41208 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-12 12:54:45 +00:00
Weston Ruter
d8f445bf0f 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-12 07:03:46 +00:00
Jeremy Felt
560d705b00 Multisite: Update docs for switch_to_blog().
As of [21403], autoload options are switched along with the cache key prefix.

Props stevepuddick.
Fixes #41815.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-12 03:34:48 +00:00
Weston Ruter
3853a250f9 Customize: Align behavior of WP_Customize_Manager::save_changeset_post() with wp_insert_post() by setting status to future if supplied status is publish but date is future.
Props dlh.
Fixes #41336.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41205 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-11 17:50:44 +00:00
Andrea Fercia
6fc55cad3a Allow usage of aria-current in paginate_links().
The `aria-current` attribute is a simple, effective way to help assistive
technology users orientate themselves within a list of items.

Props GrahamArmfield, palmiak.
Fixes #40833.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41204 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-11 14:29:44 +00:00
Adam Silverstein
10a51dbcfb Docs: Add jsdoc.conf.json JSDOC configuration file.
Left this file off by mistake in [41351].

Fixes #41682.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41203 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-11 13:14:45 +00:00
Peter Wilson
06bd0b40f9 General: Remove error screen padding for Internet Explorer.
The inline styles added to the `wp_die()` handler since [18534] increase file size of the error screen enough to prevent Internet Explorer from displaying a generic error page.

Props rfair404.
Fixes #37551.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41202 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-11 05:31:42 +00:00
Weston Ruter
f54cc32a6d 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41201 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-11 05:23:48 +00:00
John Blackbourn
88267bd891 Build/Test Tools: Convert more test skipping into hard failures.
See #41851

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


git-svn-id: http://core.svn.wordpress.org/trunk@41200 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-11 00:38:44 +00:00
John Blackbourn
152f5410ac Docs: Clarify some terminology around meta capabilities, primitive capabilities, and roles.
See #41017

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


git-svn-id: http://core.svn.wordpress.org/trunk@41199 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-10 22:51:43 +00:00
John Blackbourn
f2a0b5267d Login and Registration: Pass the user session token to the set_auth_cookie and set_logged_in_cookie filters.
This also adds some missing `@since` parameters for other uses of the token so that developers know when the token was first made available to various filters.

Fixes #41849

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


git-svn-id: http://core.svn.wordpress.org/trunk@41198 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-10 21:09:45 +00:00
Weston Ruter
203d220c6f 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41197 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-10 17:08:43 +00:00
Weston Ruter
a74e98d7be Customize: Rename "Static front page" to just "Homepage".
Props danieltj, melchoyce.
Fixes #41828.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41196 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-10 16:20:44 +00:00
Andrea Fercia
317d36668b Administration: Admin menu: Improve vertical spacing and alignment of menu items with counters.
Props pauldechov, JDTrower.

Fixes #41317.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41195 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-10 13:40:46 +00:00
Weston Ruter
84d2c51153 Widgets: Add shortcode support inside Text widgets.
* Used now in core to facilitate displaying inserted media. See #40854.
* The `[embed]` shortcode is not supported because there is no post context for caching oEmbed responses. This depends on #34115.
* Add `do_shortcode()` to the `widget_text_content` filter in the same way it is added for `the_content` at priority 11, with `shortcode_unautop()` called at priority 10 after `wpautop()`.
* For Text widget in legacy mode, manually apply `do_shortcode()` (and `shortcode_unautop()` if auto-paragraph checked) if the core-added `widget_text_content` filter remains, unless a plugin added `do_shortcode()` to `widget_text` to prevent applying shortcodes twice.
* Ensure that global `$post` is `null` while filters apply in the Text widget so shortcode handlers won't run with unexpected contexts.

Props westonruter, nacin, aaroncampbell.
See #40854, #34115.
Fixes #10457.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41194 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-10 06:33:44 +00:00
Weston Ruter
da3b644df4 Widgets: Prevent fatal error due to calling undefined wp_json_encode() when requesting the load-scripts.php endpoint.
Props Otto42.
Amends [41352].
Fixes #41610.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41193 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-09 20:44:44 +00:00
Andrea Fercia
d35be7a120 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41192 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-09 14:50:43 +00:00
Sergey Biryukov
eeb147e349 Docs: Remove "being being" dittography from inline comments.
Props birgire.
Fixes #41841.
Built from https://develop.svn.wordpress.org/trunk@41358


git-svn-id: http://core.svn.wordpress.org/trunk@41191 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-09 14:49:44 +00:00
Sergey Biryukov
9da1dd552d Twenty Fifteen: Remove "called called" dittography, missed in [41349].
Props birgire.
See #41841, #41836.
Built from https://develop.svn.wordpress.org/trunk@41357


git-svn-id: http://core.svn.wordpress.org/trunk@41190 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-09 14:48:44 +00:00
Andrea Fercia
a4ae97437b 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41189 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-09 14:14:43 +00:00
Sergey Biryukov
3d6c0dc45a Docs: Remove "since since" and "one one" dittography from inline comments.
Fixes #41841.
Built from https://develop.svn.wordpress.org/trunk@41355


git-svn-id: http://core.svn.wordpress.org/trunk@41188 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-09 13:53:42 +00:00
Sergey Biryukov
deb9b82032 Docs: Remove "to to" dittography from inline comments.
Props birgire.
See #41841.
Built from https://develop.svn.wordpress.org/trunk@41354


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


git-svn-id: http://core.svn.wordpress.org/trunk@41186 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-09 13:19:45 +00:00
Weston Ruter
9b5d71bad0 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41185 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-08 19:11:43 +00:00
Adam Silverstein
8a23b80b56 Docs: JSDoc improvements for namespaces.
Improve JS parsing of our inline JSDocs by introducing `@namespace`, `@lends` and `@memberOf`. Helps set the way for showing our JavaScript documentation on developer.wordpress.org, see https://meta.trac.wordpress.org/ticket/3063.

* Define all used namespaces using @namespace.
* Correctly specify in which namespace each class is using @memberOf.
* Define each usage of the extend function as a prototype assignment using @lends.
* Some comment blocks were moved to correct the parsing of certain definitions. 

Props herregroen, atimmer, netweb, SergeyBiryukov.  
Fixes #41682.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41184 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-08 18:42:49 +00:00
Sergey Biryukov
098fed18b7 Docs: Remove "the the" dittography from inline comments.
Props Presskopp.
Fixes #41835.
Built from https://develop.svn.wordpress.org/trunk@41350


git-svn-id: http://core.svn.wordpress.org/trunk@41183 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-08 18:21:42 +00:00
Sergey Biryukov
6bea951e7a Bundled Themes: Remove "called called" and "can can" dittography.
Props johnpgreen.
Fixes #41836.
Built from https://develop.svn.wordpress.org/trunk@41349


git-svn-id: http://core.svn.wordpress.org/trunk@41182 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-08 18:13:43 +00:00
Felix Arntz
6ced176459 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-08 16:33:43 +00:00
John Blackbourn
2bd20bb0db 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

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


git-svn-id: http://core.svn.wordpress.org/trunk@41180 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-08 15:01:44 +00:00
Pascal Birchler
078a63e049 Editor: In _WP_Editors::wp_link_query, allow filtering empty results.
Previously, it was not possible to hook into the `wp_link_query` filter to add custom entries when the 
query returned no posts.

Props mitraval192, msebel.
Fixes #41825.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41179 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-08 14:03:44 +00:00
John Blackbourn
e061a432cc Embeds: Add the dnt (Do Not Track) query parameter to all oEmbed provider URLs.
This means that, for those providers that support this somewhat de-facto standard, visitor tracking is disabled by default for all embeds.

Props norcross, joostdevalk

Fixes #41784

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


git-svn-id: http://core.svn.wordpress.org/trunk@41178 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-08 12:31:43 +00:00
Andrew Ozz
ffa304135e 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.
Built from https://develop.svn.wordpress.org/trunk@41344


git-svn-id: http://core.svn.wordpress.org/trunk@41177 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-08 10:57:43 +00:00
Sergey Biryukov
8cfe233137 Twenty Sixteen: Replace inline control structureв to improve code readability.
Fixes #38468.
Built from https://develop.svn.wordpress.org/trunk@41343


git-svn-id: http://core.svn.wordpress.org/trunk@41176 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-08 06:04:44 +00:00
Sergey Biryukov
6880400dd5 Twenty Seventeen: Correct the @return value for twentyseventeen_post_thumbnail_sizes_attr().
Props truongwp.
Fixes #41830.
Built from https://develop.svn.wordpress.org/trunk@41342


git-svn-id: http://core.svn.wordpress.org/trunk@41175 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-08 04:27:44 +00:00
Sergey Biryukov
15c38a8068 Twenty Sixteen: Correct the @return value for twentysixteen_post_thumbnail_sizes_attr().
Props truongwp.
See #41830.
Built from https://develop.svn.wordpress.org/trunk@41341


git-svn-id: http://core.svn.wordpress.org/trunk@41174 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-08 04:26:45 +00:00
Konstantin Obenland
a1688f0d2a Widgets: Improve _doing_it_wrong message.
Adds more context to help sending developers on the path to success.

Props ramiy.
Fixes 41743.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41173 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-06 21:32:43 +00:00
Weston Ruter
d031a9c3fe Widgets: Use word-wrap: break-word for available widget descriptions.
Props metodiew.
Fixes #36207.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-06 18:28:43 +00:00
Weston Ruter
0391928790 Customize: Do not show cursor: not-allowed on audio/video track titles within playlists in preview.
Props scott.deluzio, mitraval192, westonruter.
See #31517.
Fixes #41489.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41171 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-06 18:00:43 +00:00
Andrea Fercia
4c60dfa69b Themes: Prevent the Themes search field default action after [40572].
Props boonebgorges.
Fixes #41803.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41170 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-05 17:26:45 +00:00
Dominik Schilling
401808ea96 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.
Built from https://develop.svn.wordpress.org/trunk@41335


git-svn-id: http://core.svn.wordpress.org/trunk@41166 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-04 19:30:43 +00:00
Adam Silverstein
ba0970ab28 WP-API JS Client: Add helpers to get a model or collection by route.
Add two new helper functions, `wp.api.getModelByRoute` and `wp.api.getCollectionByRoute`. Passed a route, they return the matching model or collection, or `undefined` if none is found.

Also adds tests to verify these functions work as expected.

Props rcutmore.
Fixes #41111.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41165 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-04 16:01:43 +00:00
John Blackbourn
f66864af2e Multisite: More specificity for the get_sites() documentation.
See #41789

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


git-svn-id: http://core.svn.wordpress.org/trunk@41164 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-04 11:17:43 +00:00
Andrew Ozz
a93298f0c7 Plupload: remove the reinstated plupload.js from the list of old files.
Props afercia.
See #41755.
Built from https://develop.svn.wordpress.org/trunk@41332


git-svn-id: http://core.svn.wordpress.org/trunk@41163 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-04 10:22:47 +00:00
Dominik Schilling
2526eb2d86 Multisite: Clarify return type of get_sites() when 'count' is passed as a query var.
Fixes #41789.
Built from https://develop.svn.wordpress.org/trunk@41331


git-svn-id: http://core.svn.wordpress.org/trunk@41162 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-04 08:16:44 +00:00
Andrea Fercia
c3cf5cb324 Docs: Update media-audiovideo.js after [41239].
Fixes #41602.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41161 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-03 16:16:43 +00:00
Andrea Fercia
b43ddef0bc 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41160 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-03 16:02:46 +00:00
Andrew Ozz
e38ec0f485 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.
Built from https://develop.svn.wordpress.org/trunk@41328


git-svn-id: http://core.svn.wordpress.org/trunk@41159 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-01 12:28:46 +00:00
Konstantin Obenland
564e13cf30 Widgets: Add nudge for registered widgets
Informs developers that widgets need to be registered before they can be
displayed through `the_widget()`. Previously it would fail with an ambiguous
undefined index notice.

Props SeBsZ, mrasharirfan.
Fixes #41743.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41158 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-01 08:50:47 +00:00
Dominik Schilling
fff02086dd Taxonomy: Remove unused global imports for $wpdb in get_terms() and wp_get_object_terms().
Also remove incorrect `@global` tags for `$wpdb` and `$wp_filter`.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41157 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-31 12:26:42 +00:00
Sergey Biryukov
320c289ec0 Media: Set correct value for "Link Rel" field in Image Details modal.
Props hazemnoor.
Fixes #41764.
Built from https://develop.svn.wordpress.org/trunk@41325


git-svn-id: http://core.svn.wordpress.org/trunk@41156 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-31 11:17:45 +00:00
Felix Arntz
70daaadc6a Multisite: Remove an unnecessary if clause wrapping the added_existing_user filter.
This was accidentally introduced in [41125]. Since the `added_existing_user` filter has historically accepted either `true` or a `WP_Error` object, the clause is not necessary here. The doc block has been adjusted to account for the new possible `WP_Error` condition.

Fixes #41101.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41155 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-30 19:53:45 +00:00
Joe McGill
682ec35fbc 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41154 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-30 15:04:48 +00:00
John Blackbourn
d611184f4f Docs: Clarify descriptions and parameter types for various user capability checking functions.
See #41017

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


git-svn-id: http://core.svn.wordpress.org/trunk@41153 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-29 16:43:47 +00:00
Weston Ruter
1afaf8c605 Customize: Prevent potential cache corruption when finding a secondary changeset post by UUID.
Props dlh.
Fixes #41738.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41152 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-29 04:10:46 +00:00
Weston Ruter
a979e17e2b Media: Upgrade MediaElement.js to 4.2.5-74e01a40 fixing missing mejs.MediaElement reference.
ALso fixes:

* Accessibility for volume control
* Progress bar tooltip positioning and dimensions correctly set for media with long duration
* Better codec checking
* Minor CSS fix to avoid flickering effect on volume control

Props rafa8626.
See #39686.
Fixes #41640.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41151 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-28 19:29:47 +00:00
Andrew Ozz
c56801657a TinyMCE: fix cases where an additional empty link is created while updating an image with a link.
Props spocke.
Fixes #41259.
Built from https://develop.svn.wordpress.org/trunk@41319


git-svn-id: http://core.svn.wordpress.org/trunk@41150 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-26 16:34:46 +00:00
Sergey Biryukov
98995d46d1 Formatting: In sanitize_title_with_dashes(), convert forward slash to hyphen on save.
Props corvidism, jtsternberg, GhostToast, alxndr.
Fixes #10792.
Built from https://develop.svn.wordpress.org/trunk@41318


git-svn-id: http://core.svn.wordpress.org/trunk@41149 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-25 23:28:45 +00:00
Sergey Biryukov
00c88acb5e Docs: Correct description for view_mode_post_types filter added in [35357].
Props birgire.
Fixes #41730.
Built from https://develop.svn.wordpress.org/trunk@41317


git-svn-id: http://core.svn.wordpress.org/trunk@41148 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-25 19:27:45 +00:00
iandunn
476377f64d 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41147 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-25 18:12:44 +00:00
Joe McGill
bbb8d48086 Media: Prime post caches in 'wp_make_content_images_responsive()'.
In [38296] we replaced `get_post_meta()` with `wp_get_attachment_metadata()`
so that attachment metadata could be consistently filtered. However, this
results in extra post queries which were previously avoided.

This uses `_prime_post_caches()` instead of `update_meta_cache()` to improve
post caching before looping through all images to retrieve attachment metadata.

Props dlh.
Fixes #40490.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41146 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-25 16:16:46 +00:00
Scott Taylor
10177e7fbb Docs: improve JS docs for comment-reply.js
Props andizer, ireneyoast.
Fixes #41548.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41145 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-24 17:58:44 +00:00
Scott Taylor
4557e0d292 Docs: improve JS docs for bookmarklet.js
Props andizer, ireneyoast.
Fixes #41547.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41144 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-24 17:55:45 +00:00
Sergey Biryukov
33f0b56134 Widgets: Remove a duplicate require_once() for class-wp-widget-meta.php added in [40640].
Props thingsym.
Fixes #41723.
Built from https://develop.svn.wordpress.org/trunk@41312


git-svn-id: http://core.svn.wordpress.org/trunk@41143 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-24 17:53:27 +00:00
Scott Taylor
55a180f063 Docs: improve JS docs for tags.js
Props atimmer, jipmoors.
Fixes #41069.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41142 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-24 17:52:44 +00:00
Scott Taylor
412d5e60be Docs: improve JS docs for editor-expand.js
Props IreneYoast, terwdan.
Fixes #41068.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41141 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-24 17:48:45 +00:00
Mel Choyce
f10a6f8863 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41140 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-23 17:15:42 +00:00
Drew Jaynes
fabca552aa Docs: Clarify the expected usage of the $args parameter as an array in the DocBlock for apply_filters_deprecated(), including an example.
See #41017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41139 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-23 15:52:46 +00:00
John Blackbourn
9db227ac07 Build/Test tools: Use the latest in the 4.x and 6.x branches of PHPUnit when running tests on Travis.
Props netweb, ayeshrajans

Fixes #41472

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


git-svn-id: http://core.svn.wordpress.org/trunk@41134 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-22 16:09:43 +00:00
John Blackbourn
ed21c69ca9 Build/Test tools: Remove usage of DOING_AJAX from the test suite, so all tests that expect either an Ajax request or a
non-Ajax request can operate without being skipped.

Props Mte90

Fixes #41561

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


git-svn-id: http://core.svn.wordpress.org/trunk@41133 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-22 15:08:43 +00:00
John Blackbourn
76e864854f Widgets: Correctly strip slashes from widget and sidebar names to allow namespaced widgets to function correctly.
Fixes #27770

Props jdgrimes

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


git-svn-id: http://core.svn.wordpress.org/trunk@41132 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-22 14:52:44 +00:00
John Blackbourn
2cde37040d Login and Registration: Introduce a login_link_separator filter to allow the separator between links in the footer of the
login screen to be filtered.

Props henry.wright

Fixes #40802

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


git-svn-id: http://core.svn.wordpress.org/trunk@41131 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-22 14:23:47 +00:00
John Blackbourn
c7a79b0e6a 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 

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


git-svn-id: http://core.svn.wordpress.org/trunk@41130 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-22 14:02:44 +00:00
John Blackbourn
28eda6f4bc 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

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


git-svn-id: http://core.svn.wordpress.org/trunk@41129 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-22 11:52:48 +00:00
John Blackbourn
9891448a42 Media: Rename several attachment related parameters from $post_id to $attachment_id for clarity, and improve related
documentation.

See #41017

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


git-svn-id: http://core.svn.wordpress.org/trunk@41128 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-22 11:12:44 +00:00
Boone Gorges
c080c0a2ea Introduce paged argument to WP_Comment_Query.
Using `paged` with `number` allows developers to request
paginated comment results without having to do a manual offset
calculation.

Props AdamWills.
Fixes #38268.
Built from https://develop.svn.wordpress.org/trunk@41287


git-svn-id: http://core.svn.wordpress.org/trunk@41127 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-21 15:35:46 +00:00
Drew Jaynes
1770cc7b87 Docs: Fix a typo in the DocBlock description for add_shortcode() introduced in [41281].
Props grapplerulrich.
See #37222.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41126 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-20 20:38:42 +00:00
Drew Jaynes
0eecbf8baf Docs: Clarify that get_comments_number() can return either a numeric string (for compatibility reasons) or 0 if the post doesn't exist.
Also update the hook doc for the `get_comments_number` filter to reflect the mixed type for `$count`.

Props kiranpotphode for the initial patch.
Fixes #38369.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41125 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-20 20:13:47 +00:00
Drew Jaynes
f94c77661d Docs: Improve the return description for get_post_format_slugs() to note that the array contains slugs as both keys and values.
Props danielbachhuber.
Fixes #38611.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41124 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-20 20:03:54 +00:00
Drew Jaynes
15373a020d Docs: Clarify that the second parameter passed to a shortcode callback is the shortcode content or null, rather than the content the shortcode was found in.
See #37222.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41123 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-20 19:56:45 +00:00
Drew Jaynes
b2b6f48127 Shortcodes: Rename the $func parameter for add_shortcode() to $callback to improve clarity.
See #37222. See #41017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41122 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-20 19:48:45 +00:00
Drew Jaynes
33997cc66c Docs: Improve documentation for add_shortcode() by:
* Removing inline examples already listed in the Code Reference
* Improving the summary and description to explain how tag conflicts are handled
* Supplement the docs for the `$func` parameter by describing the three arguments passed to a shortcode callback.

Props grapplerulrich for the initial patch.
Fixes #37222.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41121 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-20 19:44:42 +00:00
Drew Jaynes
abf8e91521 Docs: Add a note to the register_taxonomy() DocBlock that the object types defined in $object_type when modifying an already-registered taxonomy will be overwritten.
Props danielbachhuber and BjornW for the initial patches.
Fixes #34413.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41120 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-20 19:23:47 +00:00
John Blackbourn
bc15cff6f4 Build/Test tools: Revert [41278] because the PHP 5.2 environment on Travis doesn't support OpenSSL, hence the tests fail.
See #41676

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


git-svn-id: http://core.svn.wordpress.org/trunk@41119 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-20 12:59:43 +00:00
John Blackbourn
33570415d1 Build/Test tools: Don't skip tests which rely on OpenSSL when the openssl extension isn't loaded.
See #41676

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


git-svn-id: http://core.svn.wordpress.org/trunk@41118 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-20 12:31:43 +00:00
Pascal Birchler
eccf27c514 Build/Test Tools: Remove unneeded commas to fix JSHint error introduced
in [41271].

See #30666.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41117 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-20 09:13:44 +00:00
Drew Jaynes
ffa7e7d4ab Docs: Improve the usefulness and accuracy of the file header for wp-cron.php.
Props stevenlinx for the initial patch.
Fixes #31401.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41116 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-20 04:37:45 +00:00
Drew Jaynes
78da113bd0 Docs: Add a missing return description for the deprecated get_screen_icon() function.
See #41017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41115 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-20 04:04:44 +00:00
Drew Jaynes
510fb1fe85 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41114 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-20 04:03:45 +00:00
Drew Jaynes
a1ceeba8ac Docs: Explicitly deprecate the add_tab(), remove_tab(), and print_tab_image() methods for WP_Customize_Image_Control, originally soft-deprecated in 4.1.
Props jrf.
See #41121.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41113 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-20 03:38:46 +00:00
Drew Jaynes
d2b78649a2 Docs: Document user object parameters for a variety of functions in wp-includes/user.php as WP_User type instead of the more generic object type.
Props sebastianpisula.
Fixes #40945.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41112 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-19 20:19:44 +00:00
Aaron Jorbin
7f7d4ef451 Build/Test Tools: Add banner to minified CSS files
Patches occasionally come in on generated files. We should be kind to new contributors and give them a hint that these files are auto generated.

Props drewapicture, samuelsidler, netweb, valendesigns, kpdesign, nacin, jorbin
Fixes #30666

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


git-svn-id: http://core.svn.wordpress.org/trunk@41111 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-19 20:10:47 +00:00
John Blackbourn
2916cd9417 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

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


git-svn-id: http://core.svn.wordpress.org/trunk@41110 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-19 13:30:43 +00:00
Felix Arntz
755a926b65 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41109 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-19 10:39:44 +00:00
Felix Arntz
f6ebc1a80c 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41108 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-18 18:31:44 +00:00
Felix Arntz
c14e0a0527 Post Thumbnails: Pass post ID to post_thumbnail_size filter.
In addition to the enhancement, tests for the filter usage including the new parameter have been added.

Props NathanAtmoz.
Fixes #39030.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41107 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-18 18:19:44 +00:00
Konstantin Obenland
7414759f92 Widgets: Add tests for retrieve_widgets().
Helps with maintaining back compat when making changes in the future.

See #39693.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41106 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-18 15:04:43 +00:00
Adam Silverstein
a806e2d3b3 Docs: Improve JavaScript documentation in autosave.js.
Add and improve JSDOC blocks.

Props carolinegeven.
Fixes #41203.



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


git-svn-id: http://core.svn.wordpress.org/trunk@41105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-18 14:24:45 +00:00
Adam Silverstein
d856eda571 Docs: Improve JavaScript documentation in color-picker.js.
Add and improve JSDOC blocks.

Props carolinegeven, jjcomack, jipmoors.
Fixes #41063.



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


git-svn-id: http://core.svn.wordpress.org/trunk@41104 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-18 13:10:44 +00:00
Gary Pendergast
61d683989f Tests: Rename ignored tests in multisite.xml.
For  bonus :yolo: :friday:, this repeats [41262] for `multisite.xml`, which duplicates the ignored file list from `phpunit.xml.dist`.

See #41658.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41103 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-18 11:00:45 +00:00
Gary Pendergast
190012c409 Tests: Rename ignored tests in phpunit.xml.dist.
Some of the files renamed in [41261] are listed in `phpunit.xml.dist`, as they need to be ignore in PHP 5.2.

This followup commit changes `phpunit.xml.dist` to match their new names.

See #41658.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41102 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-18 10:27:43 +00:00
Gary Pendergast
01be3075b6 Tests: Rename tests with underscore in the name
There were a handful of files with an underscore in the name, which violated our naming scheme, and caused problems for anyone how enforced the scheme on their own systems.

This commit renames all of the files to the correct camelCase scheme.

Fixes #41658.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41101 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-18 09:58:46 +00:00
Weston Ruter
667f377cd0 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41100 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-17 23:37:43 +00:00
Andrew Ozz
b1d28c5e90 TinyMCE: Add the default link plugin without enabling it. This makes it easy for WordPress plugins to use it at places where wplink is not suitable, for example when initializing the editor from JS.
Props turtlepod.
Fixes #41590.
Built from https://develop.svn.wordpress.org/trunk@41259


git-svn-id: http://core.svn.wordpress.org/trunk@41099 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-17 21:04:45 +00:00
Drew Jaynes
d5e3ea444d 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41098 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-16 21:59:43 +00:00
Drew Jaynes
e80cf1d861 Canonical: Check first before attempting to include a 'path' value in the URL in strip_fragment_from_url().
Props Mte90.
Fixes #40542.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41097 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-16 21:11:43 +00:00
Weston Ruter
ea92bb5f10 Customize: Harden color control's logic for obtaining default value to prevent JS error when non-string default supplied.
Props andreagobetti, yonivh for testing.
Fixes #37174.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41096 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-16 19:04:47 +00:00
John Blackbourn
e06146a9b5 Options, Meta APIs: Update the multisite unit tests after [41254], [41164], and [41163].
This moves some more previously Multisite-only tests into the main test suite, and makes small adjustments to their assertions.

See #39118, #16470, #39117

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


git-svn-id: http://core.svn.wordpress.org/trunk@41095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-15 09:16:43 +00:00
John Blackbourn
b52e37f9bf 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

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


git-svn-id: http://core.svn.wordpress.org/trunk@41094 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-14 20:13:43 +00:00
John Blackbourn
b51f60de6d 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

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


git-svn-id: http://core.svn.wordpress.org/trunk@41093 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-14 19:42:43 +00:00
Weston Ruter
75ad3494a8 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-14 17:56:42 +00:00
Weston Ruter
ae47e05f74 Widgets: Suppress PHP warnings raised by DOMDocument::loadHTML() in WP_Widget_Text::is_legacy_instance() which could appear in Text widget forms.
Also explicitly use HTML5 doctype when parsing Text widget contents in legacy mode detection.

Amends [41050].
See #40951.
Fixes #41622.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41091 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-14 05:59:42 +00:00
Peter Wilson
d8bf666313 Emoji: Update Twemoji to 2.5.0.
Twemoji 2.3.0 has a rendering issue in Safari, emoji can sometimes be followed by U+FEOF (which is just a flag meaning "render the preceding character as emoji).

Twemoji wasn't catching this character correctly, and Safari rendered it incorrectly.

Twemoji 2.5.0 resolves this issue.

Fixes #41584.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41090 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-14 02:04:45 +00:00
Weston Ruter
18613c0010 Widgets: Add missing open class for expanded widgets in Customizer; utilize open class for expansion detection in Text and Media widgets.
Fixes #41625.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41089 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-13 06:25:43 +00:00
Weston Ruter
5c755f652b Customize: Prevent attachment deletions from silently failing in media modals opened for Media widgets.
Amends [40640].
See #32417.
Fixes #41609.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41088 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-13 06:11:43 +00:00
Weston Ruter
e956aa4176 Customize: Prevent wide widgets from being displayed as wide when Customizer is displayed in mobile breakpoint.
Fixes #41624.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41087 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-13 05:55:43 +00:00
Weston Ruter
a5d3688157 Customize: Update selector to add max-height/max-width for wide widgets to account for JS-driven Text widget and Media widgets.
Fixes #41623.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-13 05:42:42 +00:00
Weston Ruter
9c3cdaf3fb Widgets: Fix extensibility of Text widgets so that JS logic will initialize on subclassed widgets.
Amends [40631].
See #35243.
Fixes #41540.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-13 05:25:46 +00:00
Weston Ruter
300894da61 Customize: Prevent _delete_option_fresh_site() from hitting DB if fresh_site flag already cleared.
Amends [38991].
Props dlh, westonruter.
Fixes #41039.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-13 00:57:43 +00:00
Weston Ruter
6428de97a7 Customize: Fix PHP warning raised when deleting a setting from changeset via passing null as params in WP_Customize_Manager::save_changeset_post().
Props dlh.
Fixes #41621.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-12 21:21:48 +00:00
Felix Arntz
473e1ba73b Multisite: Remove references to $wpdb->siteid and use get_current_network_id() instead.
Props sathyapulse, spacedmonkey.
Fixes #41507.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41082 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-12 13:11:43 +00:00
Felix Arntz
820d3973a3 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-12 12:48:47 +00:00
Weston Ruter
f0ee106d86 Media: Upgrade MediaElement.js from 4.2.3 to 4.2.5.
Props rafa8626.
See #39686.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-12 06:20:44 +00:00
Adam Silverstein
f42a3a2440 Docs: Improve JavaScript documentation in audiovideo.manifest.js.
Add and improve JSDOC blocks.

Props nicollle, manuelaugustin.
Fixes #41602.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-11 20:37:45 +00:00
James Nylen
fce0b2dcd9 REST API: Always call rest_get_server() instead of accessing the $wp_rest_server global.
This is a consistency improvement and also a bug fix for fairly obscure cases involving modified WP load order.

Fixes #41555.

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


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

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

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


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


git-svn-id: http://core.svn.wordpress.org/trunk@41077 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-09 21:04:47 +00:00
Sergey Biryukov
5fe8d31118 Link Template: Allow the type argument to be passed through get_the_comments_pagination() as long as its value isn't array.
See [30820] for `get_the_posts_pagination().

Props jainnidhi, poena.
Fixes #39792.
Built from https://develop.svn.wordpress.org/trunk@41236


git-svn-id: http://core.svn.wordpress.org/trunk@41076 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-09 04:07:43 +00:00
Sergey Biryukov
dd330359eb Docs: Correct @param type for $term_id in get_term_children().
Props Soean, wido.
Fixes #41585.
Built from https://develop.svn.wordpress.org/trunk@41235


git-svn-id: http://core.svn.wordpress.org/trunk@41075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-08 20:53:46 +00:00
Sergey Biryukov
187b4ad48b Media: Pass shortcode attributes to wp_audio_shortcode_class and wp_video_shortcode_class filters.
Props sathyapulse.
Fixes #37329.
Built from https://develop.svn.wordpress.org/trunk@41234


git-svn-id: http://core.svn.wordpress.org/trunk@41074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-05 16:42:45 +00:00
Drew Jaynes
1a123e432f External Libraries: Update jQuery Form (unused in core) to the latest version, 4.2.1.
Fixes #41565.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-05 13:00:47 +00:00
John Blackbourn
41f71598f7 Formatting: Introduce get_the_post_type_description() to allow post type archive descriptions to be formatted the same as author and term archives.
Props henry.wright

Fixes #40040

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


git-svn-id: http://core.svn.wordpress.org/trunk@41072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-04 23:01:44 +00:00
John Blackbourn
c96b33e3a5 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

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


git-svn-id: http://core.svn.wordpress.org/trunk@41071 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-04 22:15:45 +00:00
John Blackbourn
c26b735c8a Multisite: Clarify descriptions of the wpmu_signup_blog_notification() and wpmu_signup_user_notification() functions.
See #41017

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


git-svn-id: http://core.svn.wordpress.org/trunk@41070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-04 14:21:43 +00:00
John Blackbourn
5062d7d134 Media: Move the Tests_Media::test_video_shortcode_body() method so it runs before other tests in the class that depend on it.
The following tests were never executed as they have `@depends` annotations which means they get skipped because the `test_video_shortcode_body()` test has not run by the time they run. Re-ordering the test methods fixes this.

* `test_wp_video_shortcode_with_empty_params()`
* `test_wp_video_shortcode_with_bad_attr()`
* `test_wp_video_shortcode_attributes()`
* `test_wp_video_shortcode_youtube_remove_feature()`
* `test_wp_video_shortcode_youtube_force_ssl()`
* `test_wp_video_shortcode_vimeo_force_ssl_remove_query_args()`
* `test_wp_video_shortcode_vimeo_adds_loop()`
* `test_wp_video_shortcode_vimeo_force_adds_loop_true()`

See #35367

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


git-svn-id: http://core.svn.wordpress.org/trunk@41069 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-04 14:06:43 +00:00
John Blackbourn
22779110c4 REST API: Populate some missing tests from test cases which extend the controller test case.
See #41463

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


git-svn-id: http://core.svn.wordpress.org/trunk@41068 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-04 13:56:46 +00:00
Andrea Fercia
a029f83fb5 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-03 22:12:43 +00:00
Felix Arntz
1d0478d4b1 REST API: Allow site administrators to edit user roles in multisite.
While site administrators cannot generally edit users in multisite, they have always been able to change the roles of users on their site. In the REST API however, this has not been possible so far. This changeset brings parity with how it is handled in the administration panel: A REST request to edit only a user's roles succeeds correctly, while a REST request to edit any further details of a user fails.

Props jnylen0.
Fixes #40263.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41066 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-03 21:59:44 +00:00
Felix Arntz
7e2ca92e69 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-03 21:41:45 +00:00
Andrea Fercia
19aab9d3d6 REST API: Make jshint happy again after [41222].
See #40919.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41064 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-03 20:36:42 +00:00
James Nylen
0ef4d4289f REST API: Exclude numeric parameters from regex parsing
The list of endpoint parameters should only include explicitly named and requested parameters.

Props flixos90, rmccue, jnylen0.
Fixes #40704.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41063 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-03 19:55:43 +00:00
James Nylen
17c48865db REST API: Add QUnit tests for api-request.js
These should have been included in [41206].

See #40919.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41062 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-03 19:47:45 +00:00
John Blackbourn
4981452aba General: Fix more instances of inconsistent parameters passed to various filters, plus fix some filter docs.
See #38462, #41017

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


git-svn-id: http://core.svn.wordpress.org/trunk@41061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-03 16:13:44 +00:00
John Blackbourn
38f91be819 General: Fix a typo introduced in [41219].
See #38462

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


git-svn-id: http://core.svn.wordpress.org/trunk@41060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-03 15:46:44 +00:00
John Blackbourn
b140e8f574 General: Fix various instances of incorrect filter docs and incorrect filter and action parameters.
Props keesiemeijer for identifying the issues

See #38462

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


git-svn-id: http://core.svn.wordpress.org/trunk@41059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-03 15:43:43 +00:00
Drew Jaynes
8e71c49a12 Docs: Add missing documentation for the $data parameter for WP_Http::browser_redirect_compatibility().
Props ronakganatra for the initial patch.
Fixes #41380.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41058 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-03 15:24:44 +00:00
John Blackbourn
375f495231 General: Add missing parameters to instances of the the_permalink filter.
This ensures every instance of this filter receives the same parameters.

Props keesiemeijer for identifying the issue

See #38462

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


git-svn-id: http://core.svn.wordpress.org/trunk@41057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-03 14:59:44 +00:00
John Blackbourn
4cdbe950e9 Docs: Add a missing docblock for the the_content_rss filter.
See #38462, #41017

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


git-svn-id: http://core.svn.wordpress.org/trunk@41056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-03 14:46:43 +00:00
John Blackbourn
d510413811 Docs: Fix various filter documentation.
See #38462, #41017

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


git-svn-id: http://core.svn.wordpress.org/trunk@41055 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-03 14:34:44 +00:00
John Blackbourn
763ac66754 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

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


git-svn-id: http://core.svn.wordpress.org/trunk@41054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-03 13:49:43 +00:00
John Blackbourn
dee0e3a67b Users: Switch to using array style filters for the newly introduced filters in wp_password_change_notification() and wp_new_user_notification().
This introduces three new filters, replacing those that were introduced in [41153]:

* `wp_password_change_notification_email`
* `wp_new_user_notification_email_admin`
* `wp_new_user_notification_email`

Props pbearne

Fixes #38068

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


git-svn-id: http://core.svn.wordpress.org/trunk@41053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-03 13:21:46 +00:00
John Blackbourn
c184d766e9 Docs: Correct and improve the documentation for the send_confirmation_on_profile_email() function and the new_user_email_content filter.
See #41017

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


git-svn-id: http://core.svn.wordpress.org/trunk@41049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-02 20:43:44 +00:00
John Blackbourn
e0c397bdfa Docs: Correct and improve the documentation for the update_option_new_admin_email() function and the new_admin_email_content filter.
See #41017

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


git-svn-id: http://core.svn.wordpress.org/trunk@41048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-02 20:04:43 +00:00
James Nylen
e77ac0c6eb Remove unnecessary semicolon
See #40919.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-02 17:16:44 +00:00
James Nylen
c91b130b53 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.

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


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

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

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


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

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


git-svn-id: http://core.svn.wordpress.org/trunk@41044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-02 05:11:44 +00:00
Drew Jaynes
0401cee8b3 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-01 20:44:43 +00:00
John Blackbourn
ed60c36fb8 Formatting: Add the $number and $decimals arguments to the number_format_i18n filter.
Props alpipego

Fixes #41505

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


git-svn-id: http://core.svn.wordpress.org/trunk@41039 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-01 14:38:48 +00:00
Weston Ruter
7af3b92736 Media: Upgrade MediaElement.js from 2.22.0 to 4.2.3.
Props rafa8626, grosbouff, westonruter, azaozz, Plastikschnitzer for testing.
See #39686.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-01 04:43:51 +00:00
Andrea Fercia
59279ab349 Menus: Improve the responsive view for the Menu Name field and Save button.
Props punit5658.
Fixes #41499.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-31 21:22:44 +00:00
Scott Taylor
6bcf4d6f63 Media: update the getID3 library to version 1.9.14 to avoid fatal errors in PHP7.
Props MyThemeShop for the initial patch.
Fixes #41496.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41036 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-31 19:50:45 +00:00
Drew Jaynes
82d0a53e77 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41035 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-30 15:46:43 +00:00
Drew Jaynes
4835f7e817 Docs: Add a missing description for the $wpdb global notation in the DocBlock for WP_Importer::stop_the_insanity().
Props tejas5989.
Fixes #41447.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-30 15:43:42 +00:00
Drew Jaynes
8fd5ec4e62 Docs: Use a third-person singular verb in the summary for _wp_customize_publish_changeset().
Also adding missing `@since` and `@access` tags. Introduced in 4.7, see [38810].

See #41017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41033 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-30 15:34:42 +00:00
Drew Jaynes
6ce9846893 Docs: Document use of the $wpdb and $wp_customize globals in _wp_customize_publish_changeset().
Props sagarladani for the initial patch.
Fixes #41479.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41032 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-30 15:31:42 +00:00
Boone Gorges
42ac7e7e13 Taxonomy: Introduce pre_term_link filter.
This filter allows developers to filter the taxonomy permalink
structure before a term's permalink is generated. It parallels
the 'pre_post_link' filter for the 'post' post type.

Props nikeo.
Fixes #39601.
Built from https://develop.svn.wordpress.org/trunk@41191


git-svn-id: http://core.svn.wordpress.org/trunk@41031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-30 15:10:44 +00:00
Boone Gorges
c657a2c060 Comments: Ignore the 'fields' parameter in the comment query cache.
`WP_Comment_Query` always queries runs an ID query, and so is unaffected
by the 'fields' parameter. As such, 'fields' can be ignored when building
a cache key for the results of the ID query.

Props spacedmonkey.
Fixes #41348.
Built from https://develop.svn.wordpress.org/trunk@41190


git-svn-id: http://core.svn.wordpress.org/trunk@41030 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-30 14:56:41 +00:00
Sergey Biryukov
e412ea2e6b Docs: Replace HTTP links to stackoverflow.com in DocBlocks with HTTPS.
Update the Nginx "Missing (disappearing) HTTP Headers" link.

Props johnpgreen.
Fixes #41331.
Built from https://develop.svn.wordpress.org/trunk@41189


git-svn-id: http://core.svn.wordpress.org/trunk@41029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-30 14:52:44 +00:00
Boone Gorges
f1fb17fbb5 Ensure that an assertion takes place in Tests_Comment_Query::test_comment_query_should_be_cached().
Missed during [37608]. See #36906.

Fixes #41357.
Built from https://develop.svn.wordpress.org/trunk@41188


git-svn-id: http://core.svn.wordpress.org/trunk@41028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-30 14:43:42 +00:00
Sergey Biryukov
3d26fab9f6 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.
Built from https://develop.svn.wordpress.org/trunk@41187


git-svn-id: http://core.svn.wordpress.org/trunk@41027 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-30 14:41:42 +00:00
Drew Jaynes
7f5e00ba29 Docs: Remove an unrelated description about post meta from the DocBlock for add_user_meta().
Clean up syntax.

See #41017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-30 14:32:45 +00:00
Sergey Biryukov
a6e0b16749 Tests: Fully reset MockPHPMailer between tests.
Props pessoft.
Fixes #41485.
Built from https://develop.svn.wordpress.org/trunk@41185


git-svn-id: http://core.svn.wordpress.org/trunk@41025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-29 20:53:42 +00:00
Sergey Biryukov
6a74b306da 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.
Built from https://develop.svn.wordpress.org/trunk@41184


git-svn-id: http://core.svn.wordpress.org/trunk@41024 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-29 20:35:45 +00:00
Pascal Birchler
66a3b24b72 Permalinks: Remove unnecessary semicolon after [41182].
See #29872.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41023 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-28 17:55:46 +00:00
Pascal Birchler
fd07b2254d 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41022 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-28 17:43:45 +00:00
Sergey Biryukov
2b1644b974 Docs: Add a @staticvar entry for $first_dropdown in WP_Widget_Categories::widget().
Props ajayghaghretiya1.
Fixes #41473.
Built from https://develop.svn.wordpress.org/trunk@41181


git-svn-id: http://core.svn.wordpress.org/trunk@41021 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-28 14:25:42 +00:00
Sergey Biryukov
acb9773212 Users: After [41027], assign $author_posts_url outside of the condition to simplify the logic.
See #38085.
Built from https://develop.svn.wordpress.org/trunk@41180


git-svn-id: http://core.svn.wordpress.org/trunk@41020 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-28 14:21:45 +00:00
Weston Ruter
18fd50d2b6 Media: Improve acceptance of YouTube /embed/ URLs when inserting in media modal.
Props timmydcrawford.
Fixes #41201.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-28 02:36:46 +00:00
John Blackbourn
df808fc42d General: Move the __autoload() compat function into its own file to prevent deprecated notices being thrown by the compiler in PHP 7.2.
The `__autoload()` function is deprecated in PHP 7.2, which means WordPress' own `__autoload()` compat function for PHP 5.2 needs to be moved into a separate file to prevent the PHP 7.2 compiler from complaining.

Props ayeshrajans

See #40109

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


git-svn-id: http://core.svn.wordpress.org/trunk@41018 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-28 01:15:52 +00:00
John Blackbourn
4f2ef5438f Build/Test Tools: More PHP 7.2 tweaks for Travis CI.
See #40109

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


git-svn-id: http://core.svn.wordpress.org/trunk@41017 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-27 21:32:40 +00:00
John Blackbourn
9ae6e6fb54 REST API: Add some missing assertions to various REST API tests.
See #41463

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


git-svn-id: http://core.svn.wordpress.org/trunk@41016 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-27 19:04:44 +00:00
Aaron Jorbin
89fa297113 Build/Test Tools: Add PHP 7.2 to test matrix
PHP has branched 7.2 and master is now 7.3. This change ensures that 7.2 is tested. As 7.2 is still in development and is not ready for production, failures are allowed.

See #40109.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41015 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-27 17:38:42 +00:00
John Blackbourn
219de8acd5 General: Avoid counting uncountable values when reading theme directories, and in some unit tests.
See #40109

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


git-svn-id: http://core.svn.wordpress.org/trunk@41014 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-27 17:00:44 +00:00
John Blackbourn
96183d09bd Formatting: Update the author description tests since the formatting change made in [41172].
See #40040

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


git-svn-id: http://core.svn.wordpress.org/trunk@41013 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-27 16:06:55 +00:00
John Blackbourn
01e64d9ed0 Formatting: Add formatting and texturization to author descriptions so they match the formatting of term descriptions.
Props henry.wright

Fixes #40040

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


git-svn-id: http://core.svn.wordpress.org/trunk@41012 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-27 15:10:42 +00:00
John Blackbourn
fb515a8a63 Users: Further fixes to entitiy decoding in the user email address change confirmation email, and the corresponding tests.
See #16470, #40015

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


git-svn-id: http://core.svn.wordpress.org/trunk@41011 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-27 14:59:43 +00:00
John Blackbourn
efa54e6cdb Users: Update some tests for admin email change confirmation emails after [41164].
See #40015, #39117

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


git-svn-id: http://core.svn.wordpress.org/trunk@41010 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-27 14:34:42 +00:00
John Blackbourn
2e767d2e1a Build/Test Tools: Clarify the error message when running the test suite without the WordPress Importer plugin present in the test suite.
See #41345

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


git-svn-id: http://core.svn.wordpress.org/trunk@41009 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-27 14:01:42 +00:00
Drew Jaynes
8c7f5367c0 Docs: Remove some more top-level @aacess tags from function DocBlocks.
See #414532.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41008 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-27 08:19:43 +00:00
John Blackbourn
6a16d726ef Options, Meta APIs: Fix a typo introduced in [41164].
See #39117

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


git-svn-id: http://core.svn.wordpress.org/trunk@41007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-27 03:12:44 +00:00
John Blackbourn
ff20054573 Users: Add the new email address to the email address change notification email.
Fixes #39112

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


git-svn-id: http://core.svn.wordpress.org/trunk@41006 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-27 02:57:43 +00:00
John Blackbourn
30d5450508 Users: Re-add entity decoding to the site name before it's used in the email address change confirmation email.
This was accidentally removed in [41163].

See #40015, #16470

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


git-svn-id: http://core.svn.wordpress.org/trunk@41005 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-27 02:55:43 +00:00
John Blackbourn
b9b4776800 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

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


git-svn-id: http://core.svn.wordpress.org/trunk@41004 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-27 02:24:42 +00:00
John Blackbourn
62fe4be994 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

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


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

See #41452.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-27 00:41:44 +00:00
Drew Jaynes
1a28ec87e1 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-27 00:40:43 +00:00
John Blackbourn
32128ffd45 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

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


git-svn-id: http://core.svn.wordpress.org/trunk@41000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-26 23:28:46 +00:00
John Blackbourn
be94fa5483 Toolbar: Add View User and Edit User links to the admin toolbar to ease navigation between a user's archives and the user editing screen.
Props georgestephanis, lessbloat, johnbillion

Fixes #20307

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


git-svn-id: http://core.svn.wordpress.org/trunk@40999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-26 16:45:44 +00:00
John Blackbourn
6b22dbe59a Login and Registration: Introduce a username_exists filter, which allows for control over registration of usernames.
Props shamim51

Fixes #39320

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


git-svn-id: http://core.svn.wordpress.org/trunk@40998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-26 16:25:40 +00:00
Sergey Biryukov
c7feb8387a 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.
Built from https://develop.svn.wordpress.org/trunk@41157


git-svn-id: http://core.svn.wordpress.org/trunk@40997 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-26 13:39:44 +00:00
Sergey Biryukov
7d2b400876 Users: Use esc_url() instead of esc_attr() to escape the value of the srcset attribute in get_avatar().
Props joemcgill, henry.wright.
Fixes #41215.
Built from https://develop.svn.wordpress.org/trunk@41156


git-svn-id: http://core.svn.wordpress.org/trunk@40996 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-26 13:22:44 +00:00
Gary Pendergast
a89f1e469b REST API: Update the fixture data for wp-api.js tests.
[41139] changed how the REST API URL is generated, but included an incorrect version of `wp-api-generated.js`.

This updates the generator to create the correct `wp-api-generated.js`, and updates ``wp-api-generated.js`.

See #40886.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40994 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-26 03:53:42 +00:00
John Blackbourn
b6ca2d77a8 Users: Introduce filters for the contents of email notifications for new user registrations and password resets.
Introduces:

* `wp_password_change_notification_subject`
* `wp_password_change_notification_message`
* `wp_password_change_notification_headers`
* `wp_new_user_notification_admin_subject`
* `wp_new_user_notification_admin_message`
* `wp_new_user_notification_admin_headers`
* `wp_new_user_notification_subject`
* `wp_new_user_notification_message`
* `wp_new_user_notification_headers`

Props pbearne, dipesh.kakadiya

Fixes #38068

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


git-svn-id: http://core.svn.wordpress.org/trunk@40993 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-26 00:54:43 +00:00
Sergey Biryukov
760d2b3771 I18N: Use a consistent context for Visual and Text editor tab labels.
Props pedromendonca.
Fixes #41438.
Built from https://develop.svn.wordpress.org/trunk@41152


git-svn-id: http://core.svn.wordpress.org/trunk@40992 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-25 22:58:41 +00:00
Sergey Biryukov
4e4df0e6c9 Docs: Use 3-digit, x.x.x style semantic versioning for @since 4.8.0 entries.
See #41017.
Built from https://develop.svn.wordpress.org/trunk@41151


git-svn-id: http://core.svn.wordpress.org/trunk@40991 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-25 22:48:42 +00:00
John Blackbourn
2dfea4210b 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

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


git-svn-id: http://core.svn.wordpress.org/trunk@40990 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-25 17:43:42 +00:00
Andrea Fercia
de31d6f81c Widgets: make the Recent Posts widget output '(no title)' for posts without a title.
Since WordPress 2.3, the Recent Posts widget used to output the post ID for posts
with an empty title. Using '(no title)' seems a best option and is consistent with
what's already used in other similar cases.

Props antonrinas, Ankit K Gupta.
Fixes #35709.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40989 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-25 16:13:45 +00:00
Andrea Fercia
ac82a26fc5 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40988 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-25 16:05:44 +00:00
Sergey Biryukov
c957321007 Docs: Correct @global entry for $cat_id in WP_Links_List_Table::column_categories().
Props tejas5989.
Fixes #41436.
Built from https://develop.svn.wordpress.org/trunk@41147


git-svn-id: http://core.svn.wordpress.org/trunk@40987 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-25 13:19:42 +00:00
Sergey Biryukov
37a04795b2 Docs: Add a @global entry for $wpdb in _get_cron_lock.
Props tejas5989.
Fixes #41433.
Built from https://develop.svn.wordpress.org/trunk@41146


git-svn-id: http://core.svn.wordpress.org/trunk@40986 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-25 12:56:43 +00:00
Sergey Biryukov
0a24e8d1cd Docs: Add @access entry for WP_Comment_Query::fill_descendants().
Props umangvaghela123.
Fixes #41435.
Built from https://develop.svn.wordpress.org/trunk@41145


git-svn-id: http://core.svn.wordpress.org/trunk@40985 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-25 12:54:45 +00:00
Weston Ruter
4042c0b416 TinyMCE: Fix styling of selected state for linked images containing captions.
Props azaozz.
Fixes #41408.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-25 02:19:42 +00:00
Gary Pendergast
7819daefd2 REST API: Always add index.php to the REST URL when pretty permalinks are disabled.
When pretty permalinks are disabled, the web server will internally forward requests to `index.php`. Unfortunately, nginx only forwards HTTP/1.0 methods: `PUT`, `PATCH`, and `DELETE` methods will return a 405 error.

To work around this nginx behaviour, including `index.php` in the REST URL skips the internal redirect.

Fixes #40886.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40979 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-25 00:50:43 +00:00
John Blackbourn
b4c2f16d01 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

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


git-svn-id: http://core.svn.wordpress.org/trunk@40978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-25 00:24:43 +00:00
Weston Ruter
8648fc0bff Customize: Update Text widget starter content to utilize visual mode.
Amends [38991].
Props dlh, westonruter.
See #35243, #38114.
Fixes #41410.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40976 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-24 23:25:44 +00:00
Weston Ruter
4886abf23e Widgets: Improve notice in Text widget's legacy mode.
Also fixes phpunit test which broke in [41132].

Props melchoyce, westonruter, gk.loveweb.
See #41394, #35243, #40951, #40907.
Fixes #41386.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40974 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-24 23:11:43 +00:00
Weston Ruter
ddca4ceff1 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40972 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-24 22:46:42 +00:00
John Blackbourn
d8151e9dd1 Networks and Sites: Introduce an AYS when bulk deleting sites from the Sites screen in Network Admin.
Props flixos90, MaximeCulea

Fixes #41177

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


git-svn-id: http://core.svn.wordpress.org/trunk@40971 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-24 22:41:42 +00:00
John Blackbourn
06e6edbd61 Comments: Ensure the correct comment ID is passed to the get_comment_author_url filter.
Props dominik.schwind

Fixes #41334

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


git-svn-id: http://core.svn.wordpress.org/trunk@40967 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-24 22:03:45 +00:00
Sergey Biryukov
8c55e79bef Docs: Correct @access entry for ::load() in WP_Image_Editor, WP_Image_Editor_GD, and WP_Image_Editor_Imagick.
Props upadalavipul.
Fixes #41423.
Built from https://develop.svn.wordpress.org/trunk@41125


git-svn-id: http://core.svn.wordpress.org/trunk@40965 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-24 14:11:44 +00:00
Sergey Biryukov
bed4804424 Tests: Fix typo in Tests_Functions_AllowedProtocols::data_example_urls().
Props redrambles.
Fixes #41415.
Built from https://develop.svn.wordpress.org/trunk@41124


git-svn-id: http://core.svn.wordpress.org/trunk@40964 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-24 10:03:44 +00:00
Sergey Biryukov
00b91b3003 Docs: Add a @global entry for $wpdb in WP_Comment_Query::fill_descendants().
Props jontyravi.
Fixes #41412.
Built from https://develop.svn.wordpress.org/trunk@41123


git-svn-id: http://core.svn.wordpress.org/trunk@40963 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-23 10:40:45 +00:00
John Blackbourn
2d464d4286 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

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


git-svn-id: http://core.svn.wordpress.org/trunk@40962 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-23 01:14:43 +00:00
John Blackbourn
1d71fa865c Login and Registration: Correctly encode the redirect location URL when it's passed as a query parameter to the lost password URL.
Props adhun

Fixes #40728

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


git-svn-id: http://core.svn.wordpress.org/trunk@40961 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-23 01:06:42 +00:00
John Blackbourn
2efb81d453 Administration: Send an appropriate HTTP response status code when an invalid action is passed to admin-ajax.php.
Props ryanrolds, ayeshrajans

Fixes #41269

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


git-svn-id: http://core.svn.wordpress.org/trunk@40960 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-23 00:21:42 +00:00
John Blackbourn
a4a0f65a8a Docs: Correct some inline docs for the Ajax test case.
See #41017

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


git-svn-id: http://core.svn.wordpress.org/trunk@40959 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-23 00:02:46 +00:00
Weston Ruter
f3ec3c36a0 Widgets: Fix typo in phpunit test for Custom HTML widget in [41116].
Fixed was applied in 4.8 branch via [41117].
See #41392.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40958 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-21 21:22:42 +00:00
Weston Ruter
f283e9d81f Widgets: Include widget_text class name on Custom HTML widget wrapper for theme styling compatibility, in addition to previously-added textwidget class on nested content container.
Amends [40893], [41115].
See #40907.
Fixes #41392 for trunk.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-21 21:02:43 +00:00
Weston Ruter
048ac7df67 Widgets: Improve theme styling compatibility for Custom HTML widget by adding container with textwidget class.
The same styling from the Text widget should apply to the Custom HTML widget since users are expected to copy HTML from the (legacy) Text widget into the latter.

Amends [40893].
See #40907.
Fixes #41392.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40955 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-21 18:13:45 +00:00
Sergey Biryukov
e8e68a50f8 Docs: Correct $term_id parameter description in wp_xmlrpc_server::get_term_custom_fields() and ::set_term_custom_fields().
Props upadalavipul.
Fixes #41397.
Built from https://develop.svn.wordpress.org/trunk@41114


git-svn-id: http://core.svn.wordpress.org/trunk@40954 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-21 13:40:43 +00:00
Sergey Biryukov
118dba300e Docs: Add @staticvar entries for $cache and $tested_paths in wp_upload_dir().
Props ajayghaghretiya1.
Fixes #41395.
Built from https://develop.svn.wordpress.org/trunk@41113


git-svn-id: http://core.svn.wordpress.org/trunk@40953 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-21 10:15:44 +00:00
K. Adam White
6aaba32b36 WP-API JS Client: Interpret Settings resource as a model.
The REST API does not provide a mechanism to distinguish between endpoints representing models and those representing collections, so the Backbone client must make that distinction internally. Previously wp-api.js accounted for `/users/me`, but not for `/settings`. This patch updates the logic so that `/settings` is properly registered as a Backbone model.

When calling `wp.api.init`, additional endpoints can be specified to be models using the `modelEndpoints` argument.

Props @adamsilverstein.
Fixes #41056.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-20 20:26:45 +00:00
Sergey Biryukov
970afde4c0 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.
Built from https://develop.svn.wordpress.org/trunk@41111


git-svn-id: http://core.svn.wordpress.org/trunk@40951 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-20 14:02:44 +00:00
Sergey Biryukov
4653f8bcfa 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.
Built from https://develop.svn.wordpress.org/trunk@41110


git-svn-id: http://core.svn.wordpress.org/trunk@40950 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-20 13:47:43 +00:00
Sergey Biryukov
3946198df8 Docs: Add @staticvar entries for get_html_split_regex() and _get_wptexturize_split_regex().
Props ajayghaghretiya1.
Fixes #41385.
Built from https://develop.svn.wordpress.org/trunk@41109


git-svn-id: http://core.svn.wordpress.org/trunk@40949 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-20 13:38:44 +00:00
Sergey Biryukov
24f6903c4d Docs: Add @access entries for WP_Upgrader_Skin::set_upgrader(), ::request_filesystem_credentials(), and ::decrement_update_count().
See #41383.
Built from https://develop.svn.wordpress.org/trunk@41108


git-svn-id: http://core.svn.wordpress.org/trunk@40948 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-20 13:35:43 +00:00
Sergey Biryukov
8728f8ae1e Docs: Add @access entry for Automatic_Upgrader_Skin::request_filesystem_credentials().
Props rushabh4486.
Fixes #41383.
Built from https://develop.svn.wordpress.org/trunk@41107


git-svn-id: http://core.svn.wordpress.org/trunk@40947 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-20 13:33:43 +00:00
Sergey Biryukov
f8155cedb2 Docs: Add @access entries for Bulk_Upgrader_Skin::before() and ::after().
Props rushabh4486.
Fixes #41384.
Built from https://develop.svn.wordpress.org/trunk@41106


git-svn-id: http://core.svn.wordpress.org/trunk@40946 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-20 13:25:42 +00:00
Sergey Biryukov
54b8dafd62 Docs: Change @version entry for WP_Http::buildCookieHeader() to @since.
See #41381.
Built from https://develop.svn.wordpress.org/trunk@41105


git-svn-id: http://core.svn.wordpress.org/trunk@40945 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-20 13:15:43 +00:00
Sergey Biryukov
2026da9512 Docs: Add @access entries for WP_Http::block_request(), ::handle_redirects(), and ::is_ip_address().
Props ronakganatra.
Fixes #41381.
Built from https://develop.svn.wordpress.org/trunk@41104


git-svn-id: http://core.svn.wordpress.org/trunk@40944 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-20 13:14:44 +00:00
Sergey Biryukov
47bf429c0b Docs: Add @access entries for before() and after() methods in Bulk_Plugin_Upgrader_Skin and Bulk_Theme_Upgrader_Skin.
See #41365.
Built from https://develop.svn.wordpress.org/trunk@41103


git-svn-id: http://core.svn.wordpress.org/trunk@40943 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-20 12:09:43 +00:00
Sergey Biryukov
90372258a0 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.
Built from https://develop.svn.wordpress.org/trunk@41102


git-svn-id: http://core.svn.wordpress.org/trunk@40942 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-20 12:06:43 +00:00
Sergey Biryukov
27c38e9b6f Docs: Add @access entries for feedback() and error() methods in WP_Upgrader_Skin, Bulk_Upgrader_Skin, and Language_Pack_Upgrader_Skin.
See #41365.
Built from https://develop.svn.wordpress.org/trunk@41101


git-svn-id: http://core.svn.wordpress.org/trunk@40941 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-20 12:00:43 +00:00
Sergey Biryukov
5734818e35 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.
Built from https://develop.svn.wordpress.org/trunk@41100


git-svn-id: http://core.svn.wordpress.org/trunk@40940 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-20 11:54:43 +00:00
Sergey Biryukov
feeab7ef05 Docs: Correct @access entry for Custom_Image_Header::default_headers.
Props rushabh4486.
Fixes #41378.
Built from https://develop.svn.wordpress.org/trunk@41099


git-svn-id: http://core.svn.wordpress.org/trunk@40939 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-20 11:48:45 +00:00
James Nylen
f48ed236ff About page: Add a privacy policy.
Props MattyRob, johnbillion, swissspidy.
Fixes #40794.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40936 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-19 21:42:42 +00:00
Weston Ruter
8b3d2e0876 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-19 20:49:45 +00:00
Andrew Ozz
a798266ba3 TinyMCE: remove unused code from the wpeditimage plugin.
Fixes #41369.
Built from https://develop.svn.wordpress.org/trunk@41092


git-svn-id: http://core.svn.wordpress.org/trunk@40932 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-19 13:41:46 +00:00
Sergey Biryukov
9ed31682db Docs: Add @access entry for Automatic_Upgrader_Skin::feedback().
Props akbarhusen.
Fixes #41365.
Built from https://develop.svn.wordpress.org/trunk@41091


git-svn-id: http://core.svn.wordpress.org/trunk@40931 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-19 11:14:45 +00:00
James Nylen
793dd51f88 Tests: Be more helpful when the wordpress-importer plugin is missing.
Link to some documentation that explains the problem and how to resolve it.

Props enrico.sorcinelli.
Fixes #41345.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40930 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-19 10:38:47 +00:00
Weston Ruter
9330e39b3d Widgets: Check for existence of wp.customize.state before attempting to access in Text widget.
Amends [40631].
See #35243.
Fixes #41361 for trunk.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40928 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-18 22:36:42 +00:00
Weston Ruter
1a005d853f Widgets: Replace adding balanceTags on widget_custom_html_content filter in favor of just applying widget_text filters in the Custom HTML widget.
Ensures that users who copy HTML from the Text widget in legacy mode over to the Custom HTML widget will continue to get all of the same filters applied, including tag balancing and shortcodes, if a plugin added support. Plugins still have the `widget_text_content` and `widget_custom_html_content` filters they can use to target the specific widget types.

Amends [40893].
See #40951.
Fixes #40907 for trunk.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40926 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-18 22:11:44 +00:00
James Nylen
bcdbe8a0bf Build: Switch PHP 5.2 and 5.3 to Travis' Ubuntu precise image
Starting today, Travis will begin switching the default image to `trusty`, which does not support PHP 5.2 or 5.3.

This is not a full fix, because Travis will be dropping `precise` support entirely in September (https://github.com/travis-ci/travis-ci/issues/8072).  However, it buys us some time until then.

Props netweb.
Fixes #41292 for trunk.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40924 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-18 08:25:46 +00:00
Weston Ruter
770fb1b35c Widgets: Discount shortcodes and leading/trailing line breaks for triggering Text widget legacy mode.
Since plugin-added shortcode handling is just-in-time deferred to run after `wpautop`, there is no need to retain the presence of shortcodes to trigger legacy mode. Also updates Text widget legacy mode notice informing of Custom HTML widget.

Amends [41050].
Props westonruter, melchoyce.
Fixes #40951 for trunk.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40922 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-18 04:17:43 +00:00
Felix Arntz
21f6d256b5 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40917 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-17 20:53:45 +00:00
Felix Arntz
c939425137 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40916 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-17 20:23:43 +00:00
Felix Arntz
d4607c17b7 Multisite: Improve caching in WP_Network_Query by ignoring the $fields argument.
Prior to this change there were two different cache keys used for the same query. That is because regardless of the `$fields` argument, the query response will be the same. This was already fixed for `WP_Site_Query` in [41059].

Props spacedmonkey.
Fixes #41347.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40915 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-17 20:16:47 +00:00
Aaron Jorbin
50cb2c5e28 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.



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


git-svn-id: http://core.svn.wordpress.org/trunk@40912 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-16 01:15:46 +00:00
Adam Silverstein
499e2a0ff9 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40911 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-15 15:48:46 +00:00
Felix Arntz
6625f0c551 Multisite: Introduce a self_admin_url filter to adjust the URL to an administration panel.
Props j.hoffmann.
Fixes #37446.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40910 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-14 23:01:42 +00:00
Felix Arntz
af50e8eb2c Multisite: Improve caching in WP_Site_Query by ignoring the $fields argument.
Prior to this change there were two different cache keys used for the same query. That is because regardless of the `$fields` argument, the query response will be the same.

Props spacedmonkey.
Fixes #41197.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40909 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-14 21:25:44 +00:00
Felix Arntz
df8506f523 Multisite: Use get_network_option() for language in wpmu_create_blog().
Before this changeset, the language of a new site would always result in the language of the current network, regardless of the `$site_id` parameter passed that actually determines the network for the site. Now the correct `WPLANG` value is used in such cases.

Alongside this change, a few minor documentation changes around the function have been made to account for the current naming conventions of sites and networks.

Props spacedmonkey.
Fixes #40503.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40908 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-14 21:08:43 +00:00
Weston Ruter
8db1f562e6 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40900 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-14 17:09:43 +00:00
Weston Ruter
93637a5729 REST API: Ensure maxwidth and maxheight params are forwarded to oEmbed provider in proxy requests.
Also correct phpdoc return tag on `WP_oEmbed_Controller::get_proxy_item()` and remove dead code in oEmbed controller phpunit tests.

Amends [40628].
See #40450.
Fixes #41299.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40897 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-14 16:05:43 +00:00
Gary Pendergast
ecec228c50 Emoji: Store the results of the emoji_url and emoji_ext filters in statics.
Previously, these filters were being run once per post, but the changes in [41043] caused them to be run once per emoji found.

We will not stand idly by while this kind of unfair performance penalty is placed on the emoji literate. The filters are now run once only, emoji aficionados everywhere can rest easy, knowing their posts will be just as performant as their emoji-less cousins.

Props ocean90 for noticing this severe oversight.
See #35293.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40896 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-14 12:45:44 +00:00
Gary Pendergast
0fcd27ec31 Emoji: Fix some failing unit tests in PHP 5.2 and 5.3.
- Older versions of PHP don't know how to `html_entity_decode()` emoji.
- The fall back regex was a little too broad, catching characters that aren't emoji.

See #35293.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40895 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-14 11:50:43 +00:00
Gary Pendergast
b13bab3e53 Emoji: Port the Twemoji regex to PHP.
Previously, `wp_encode_emoji()` and `wp_staticize_emoji()` used inaccurate regular expressions to find emoji, and transform then into HTML entities or `<img>`s, respectively. This would result in emoji not being correctly transformed, or occasionally, non-emoji being incorrectly transformed.

This commit adds a new `grunt` task - `grunt precommit:emoji`. It finds the regex in `twemoji.js`, transforms it into a PHP-friendly version, and adds it to `formatting.php`. This task is also automatically run by `grunt precommit`, when it detects that `twemoji.js` has changed.

The new regex requires features introduced in PCRE 8.32, which was introduced in PHP 5.4.14, though it was also backported to later releases of the PHP 5.3 series. For versions of PHP that don't support this, it will fall back to an updated version of the loose-matching regex.

For short posts, the performance difference between the old and new regex is negligible. As the posts get longer, however, the new method is exponentially faster.

Fixes #35293.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40893 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-14 05:47:49 +00:00
Drew Jaynes
beb67c9512 Docs: Improve the DocBlock summary for WP_Query::parse_orderby().
See #41017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40892 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-13 15:44:41 +00:00
Drew Jaynes
e1a227cf11 Docs: Document usage of the $wpdb global in WP_Query::parse_search() and WP_Query::parse_orderby().
Props avinapatel.
Fixes #41313.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40891 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-13 15:42:44 +00:00
Sergey Biryukov
e42553dbea Docs: Add a @global entry for $tinymce_version in _WP_Editors::editor_js().
Props jontyravi.
Fixes #41311.
Built from https://develop.svn.wordpress.org/trunk@41040


git-svn-id: http://core.svn.wordpress.org/trunk@40890 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-13 14:33:40 +00:00
Sergey Biryukov
8cfdf4dd3a Docs: Add a @global entry for $wpdb in is_user_member_of_blog().
Props ajayghaghretiya1.
Fixes #41308.
Built from https://develop.svn.wordpress.org/trunk@41039


git-svn-id: http://core.svn.wordpress.org/trunk@40889 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-13 13:54:41 +00:00
Boone Gorges
65e2935636 Taxonomy: Avoid duplicates when querying for terms in taxonomies registered with $args parameter.
[40514] introduced a bug that caused term queries to return some duplicates
when the `$taxonomies` array contained only taxonomies that were originally
registered with an `$args` array. We fix this bug by ensuring that
recursive `get_terms()` queries stop when all queried `$taxonomies` have
already been referenced.

Props bor0, atanasangelovdev.
Fixes #41010.
Built from https://develop.svn.wordpress.org/trunk@41037


git-svn-id: http://core.svn.wordpress.org/trunk@40887 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-13 13:41:44 +00:00
Sergey Biryukov
3b9e61cdb1 Docs: Add missing @since tags for WP_Post properties and methods.
Props keesiemeijer.
Fixes #41306.
Built from https://develop.svn.wordpress.org/trunk@41036


git-svn-id: http://core.svn.wordpress.org/trunk@40886 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-13 12:08:41 +00:00
Weston Ruter
2ca21c444e REST API: Remove _wpnonce value from being used in hashed oEmbed proxy cache key.
Amends [40628].
Props r-a-y, westonruter.
See #40450.
Fixes #41048.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40885 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-12 22:51:40 +00:00
Drew Jaynes
597eeb9bb8 Docs: Use a hash notation for the $args parameter to describe the fields argument in the DocBlock for wp_get_post_terms().
Also, the `$taxonomy` parameter can accept either a string or array of taxonomies.

Props ohryan for the initial tip.
See #41017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40884 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-12 22:21:41 +00:00
Drew Jaynes
dfab72aa35 Docs: Default for the orderby argument in wp_list_categories() is actually 'name', not 'ID'.
Props uicestone.
See #41017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-12 22:06:39 +00:00
Sergey Biryukov
581707de6c Docs: Add a @global entry for $allowed_files in get_file_description().
Props div33, ajayghaghretiya1.
Fixes #41294.
Built from https://develop.svn.wordpress.org/trunk@41032


git-svn-id: http://core.svn.wordpress.org/trunk@40882 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-12 21:40:40 +00:00
Sergey Biryukov
058c2c5ca4 Docs: Fix typo in wp_suspend_cache_invalidation() description.
Props euthelup, milana_cap.
Fixes #41301.
Built from https://develop.svn.wordpress.org/trunk@41031


git-svn-id: http://core.svn.wordpress.org/trunk@40881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-12 21:26:44 +00:00
Sergey Biryukov
86f9360280 Docs: Add a @global entry for $wpdb in display_setup_form().
Props mitraval192.
Fixes #41300.
Built from https://develop.svn.wordpress.org/trunk@41030


git-svn-id: http://core.svn.wordpress.org/trunk@40880 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-12 21:03:42 +00:00
Peter Westwood
f3326b10af Tests: Rename this file to match our coding standards.
Built from https://develop.svn.wordpress.org/trunk@41029


git-svn-id: http://core.svn.wordpress.org/trunk@40879 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-12 20:56:45 +00:00
Weston Ruter
37cbe7add1 Widgets: Enqueue assets needed by media and text widgets in their _register_one() methods.
The `WP_Widget::_register_one()` method is more guaranteed to be called as opposed to its wrapper `WP_Widget::_register()` which plugins may bypass for performance reasons.

Amends [40631], [40640].
See #35243, #32417.
Fixes #41021.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40878 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-11 22:47:43 +00:00
Sergey Biryukov
6724151d41 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.
Built from https://develop.svn.wordpress.org/trunk@41027


git-svn-id: http://core.svn.wordpress.org/trunk@40877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-11 13:30:44 +00:00
Sergey Biryukov
a545745a54 Shortcodes: Allow using single quotes for empty value attributes.
Props enrico.sorcinelli.
Fixes #37304.
Built from https://develop.svn.wordpress.org/trunk@41026


git-svn-id: http://core.svn.wordpress.org/trunk@40876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-11 00:54:41 +00:00
Sergey Biryukov
f75e623eae 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.
Built from https://develop.svn.wordpress.org/trunk@41022


git-svn-id: http://core.svn.wordpress.org/trunk@40872 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-10 23:05:40 +00:00
Adam Silverstein
5cfbf0519b Media: library grid view - improve browser history support.
Set view state properly when navigating history using the browser back/next button in the media library (grid view). Correctly handle navigating, search, image detail view and image edit mode. Also handle bookmarking/reloading.

Props kucrut, joemcgill, afercia.
Fixes #31846.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-10 19:08:41 +00:00
Weston Ruter
1af3aa0000 Customize: Restrict click target of menu deletion, moving to button from its container.
Props westonruter, afercia.
Fixes #40981.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40870 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-10 18:40:44 +00:00
Andrea Fercia
b8e2496645 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40869 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-09 11:12:43 +00:00
Adam Silverstein
f858551592 Date/Time: Add unit tests for the human_time_diff function.
Verify that `human_time_diff` works as expected for minute, hour and day intervals. Test that rounding works as expected when the time difference is near the rounding margin.

Props SGr33n.
Fixes #38773.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-07 17:08:45 +00:00
Sergey Biryukov
96ceffa552 Media: Use a filename instead of a URL in image header tests to avoid triggering an outbound HTTP request causing an ImageMagick exception on some configurations.
Props danielbachhuber.
Fixes #41216.
Built from https://develop.svn.wordpress.org/trunk@41017


git-svn-id: http://core.svn.wordpress.org/trunk@40867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-07 00:07:40 +00:00
Sergey Biryukov
452871e0c3 Media: Correct the order of arguments passed to assertions in Tests_Image_Header.
Props danielbachhuber.
See #41216.
Built from https://develop.svn.wordpress.org/trunk@41016


git-svn-id: http://core.svn.wordpress.org/trunk@40866 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-06 23:58:41 +00:00
Sergey Biryukov
6b0c0592de Docs: Update the DocBlock for _WP_Editors::wp_fullscreen_html() after [32677].
See #30949.
Built from https://develop.svn.wordpress.org/trunk@41015


git-svn-id: http://core.svn.wordpress.org/trunk@40865 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-06 23:44:40 +00:00
Sergey Biryukov
6dc56c4558 Docs: Update the list of static variables in wptexturize() DocBlock after [32863].
Props ajayghaghretiya1.
Fixes #41260.
Built from https://develop.svn.wordpress.org/trunk@41014


git-svn-id: http://core.svn.wordpress.org/trunk@40864 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-06 21:02:42 +00:00
Drew Jaynes
fdaf531325 Options: Pass $default as a new parameter to the pre_option_{$option} and pre_site_option_{$option} filters.
This change standardizes some language in the parameter descriptions between the two hook docs in an effort to reduce confusion between the `$pre_option` pseudo-parameters and the new `$default` ones. `$pre_option` is the truthy value used to short-circuit the `get_*option()` call, `$default` is the value passed to the `get_*option()` returned in the event that 1) a short circuit isn't performed, 2) the option doesn't exist.

Props sc0ttkclark.
Fixes #41254.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40863 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-06 15:12:44 +00:00
Weston Ruter
6b907d8437 Customize: Prevent edge case fatal error when attempting to save changes to a changeset that had previously been corrupted.
Check return value of `WP_Customize_Manager::get_changeset_post_data()` and return if error instead of assuming it is an array.

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

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


git-svn-id: http://core.svn.wordpress.org/trunk@40862 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-06 07:05:43 +00:00
Ryan McCue
51ba397e29 REST API: Fix brittle search test.
This was previously searching for the user ID, which isn't really what it was meant to do. As a result, the test can break if that number appears in any other user information.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-06 01:35:41 +00:00
Joe McGill
37b500c4bd Sanity check $uploaderToggler in wp.media.view.UploaderInline.
This ensures `$uploaderToggler` exists before checking length so any views
extending or scripts accessing this view, won't encounter errors that stop execution.

Props Blackbam, yahil.
Fixes #41231.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-06 00:41:41 +00:00
Sergey Biryukov
d8c50c7a12 Menus: Make sure current-menu-parent and current-menu-ancestor classes are properly set for parent items of post type archive submenu items.
Props mrwweb, ajoah, welcher.
Fixes #39800.
Built from https://develop.svn.wordpress.org/trunk@41008


git-svn-id: http://core.svn.wordpress.org/trunk@40858 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-05 21:31:44 +00:00
Sergey Biryukov
2ca39ce60d Docs: Add a @global entry for $tinymce_version in _WP_Editors::default_settings().
Props tejas5989.
Fixes #41244.
Built from https://develop.svn.wordpress.org/trunk@41007


git-svn-id: http://core.svn.wordpress.org/trunk@40857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-05 18:55:44 +00:00
James Nylen
1ef845b268 Ensure that wp-api.js test fixtures do not change with WP_TESTS_* constants.
Previously, changing these constants in `wp-tests-config` would cause PHPUnit to regenerate `wp-api-generated.js` with different values.

This commit uses the existing mechanism to also "freeze" all values that would change as a result of changing these constants.

Fixes #41123.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40856 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-05 09:30:42 +00:00
Sergey Biryukov
30bad141ad Docs: Add a @global entry for $wpdb in WP_Network_Query::get_network_ids().
Props afzalmultani.
Fixes #41238.
Built from https://develop.svn.wordpress.org/trunk@41005


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


git-svn-id: http://core.svn.wordpress.org/trunk@40854 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-05 09:21:41 +00:00
Sergey Biryukov
b916e8c727 Docs: Add a @global entry for $wp in redirect_canonical().
Props afzalmultani.
See #41238.
Built from https://develop.svn.wordpress.org/trunk@41003


git-svn-id: http://core.svn.wordpress.org/trunk@40853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-05 09:19:43 +00:00
Sergey Biryukov
dbba2af814 Docs: Add a @global entry for $wp_widget_factory in WP_Customize_Widgets::get_selective_refreshable_widgets().
Props jankimoradiya.
Fixes #41243.
Built from https://develop.svn.wordpress.org/trunk@41002


git-svn-id: http://core.svn.wordpress.org/trunk@40852 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-05 08:23:41 +00:00
Weston Ruter
7b28ff2f2a 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40851 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-05 00:44:41 +00:00
Weston Ruter
046fb8a987 Widgets: Let Custom HTML widget be "wide" as the Text widget is.
Also update `WP_Customize_Widgets::$core_widget_id_bases` with the new list of core widgets.

Props obenland, westonruter.
See #40907, #40951.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40850 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-04 21:01:41 +00:00
Boone Gorges
fa2f4b047a Avoid PHP notices when checking termmeta capabilities against a non-existent term.
Previously, checks like `current_user_can( 'edit_term_meta', $term_id )`
returned the proper value, but generated a PHP notice due to the fact
that `get_term( $term_id )` could, in certain instances, return
`WP_Error` objects.

Props caercam.
Fixes #40891.
Built from https://develop.svn.wordpress.org/trunk@40999


git-svn-id: http://core.svn.wordpress.org/trunk@40849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-04 19:59:40 +00:00
Drew Jaynes
64cb817527 Docs: Add a missing return notation and to the DocBlock for WP_Session_Tokens::get_instance().
Also adds an inline reference to the `session_token_manager` hook in the description.

Props Shelob9 for the initial patch.
Fixes #40102.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40848 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-04 17:16:42 +00:00
Sergey Biryukov
c6ab84c4c4 General: Always use colon instead of a semicolon in switch() control structures.
Props jrf.
Fixes #41234.
Built from https://develop.svn.wordpress.org/trunk@40997


git-svn-id: http://core.svn.wordpress.org/trunk@40847 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-04 09:52:41 +00:00
Andrew Ozz
8c47285f4e TinyMCE: fix adding the <!-- more --> tag when the editor is inline.
Props iseulde.
Fixes #41230.
Built from https://develop.svn.wordpress.org/trunk@40996


git-svn-id: http://core.svn.wordpress.org/trunk@40846 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-03 21:41:41 +00:00
Andrew Ozz
dcc372e098 Customizer: improve setting the TinyMCE modals z-index.
Props westonruter, greuben.
See #41158.
Built from https://develop.svn.wordpress.org/trunk@40995


git-svn-id: http://core.svn.wordpress.org/trunk@40845 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-03 21:18:44 +00:00
Boone Gorges
dc35b759be Introduce wp_get_object_terms_args filter.
This filter allows developers to modify the arguments passed to
`wp_get_object_terms()` before the query is run.

Props enrico.sorcinelli.
Fixes #35925.
Built from https://develop.svn.wordpress.org/trunk@40994


git-svn-id: http://core.svn.wordpress.org/trunk@40844 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-02 18:29:42 +00:00
Peter Wilson
2b25a87d1b Capabilities: Prevent users having the do_not_allow capability.
Meta capabilities use the capability `do_not_allow` to indicate a user should be blocked from performing a particular action. This ensures users can not have the capability as it would cause unexpected behaviour.

Props johnbillion.
Fixes #41059.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-02 05:16:45 +00:00
Sergey Biryukov
6fda2e67b0 Docs: Add a @global entry for $wp_filter in wp_start_object_cache().
Props bhaveshkhadodara.
Fixes #41222.
Built from https://develop.svn.wordpress.org/trunk@40992


git-svn-id: http://core.svn.wordpress.org/trunk@40842 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 22:13:41 +00:00
Andrew Ozz
65f1051697 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.
Built from https://develop.svn.wordpress.org/trunk@40991


git-svn-id: http://core.svn.wordpress.org/trunk@40841 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 21:31:47 +00:00
Andrew Ozz
16167ffe41 Text widget: bump the TinyMCE modals z-index to 500001 so they show in the Customizer.
Props greuben.
Fixes #41158 for trunk.
Built from https://develop.svn.wordpress.org/trunk@40990


git-svn-id: http://core.svn.wordpress.org/trunk@40840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 20:33:41 +00:00
Drew Jaynes
5c075e5af7 Docs: Remove a few more superfluous @package WordPress and @subpackage notations outside of file headers missed in [40988].
See #41017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 17:11:41 +00:00
Drew Jaynes
1d95dcfa2c 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 16:58:42 +00:00
Drew Jaynes
ae017f435a Docs: Convert an @uses tag in the class DocBlock for Walker_Nav_Menu_Edit to @see.
See #41017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40837 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 16:49:40 +00:00
Drew Jaynes
bd2173f42c Docs: Remove an unnecessary @package tag from the DocBlock for post_preview().
See #41017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 16:39:41 +00:00
Drew Jaynes
ba40430e89 Docs: Add a valid return type for post_preview() and improve the DocBlock summary.
See #41017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40835 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 16:37:42 +00:00
Boone Gorges
26fcea496d Introduce most_used taxonomy label, for text on 'Most Used' metabox tab.
Props mdifelice, jlambe.
Fixes #41150.
Built from https://develop.svn.wordpress.org/trunk@40984


git-svn-id: http://core.svn.wordpress.org/trunk@40834 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 14:46:41 +00:00
Drew Jaynes
5fa2de51ef General: Ensure $description gets initialized in get_the_archive_description() if the post type archive conditional is true and the description isn't set.
Props henrywright.
See #38487.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40833 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 14:23:41 +00:00
Boone Gorges
cb81009729 Allow user searches to match the display_name field.
Props bcole808, pcarvalho.
Fixes #39643.
Built from https://develop.svn.wordpress.org/trunk@40982


git-svn-id: http://core.svn.wordpress.org/trunk@40832 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 14:22:41 +00:00
Boone Gorges
6995731f12 Allow metadata to be updated via wp_update_comment().
Passing an array of `comment_meta` into `wp_update_comment()` will
now update corresponding metadata. Similar functionality already
exists in `wp_insert_comment()`.

Props dshanske, kraftbj.
Fixes #36784.
Built from https://develop.svn.wordpress.org/trunk@40981


git-svn-id: http://core.svn.wordpress.org/trunk@40831 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 13:36:41 +00:00
Boone Gorges
def98d511a Users: Allow data to be filtered before updating or creating a user.
Props DaveFX.
Fixes #40545.
Built from https://develop.svn.wordpress.org/trunk@40980


git-svn-id: http://core.svn.wordpress.org/trunk@40830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 13:30:42 +00:00
Boone Gorges
ed9d4b9408 Taxonomy: Ignore cached term value when it doesn't match the queried taxonomy.
When a cache entry is found that matches the requested `$term_id`, but
doesn't match an explicitly provided `$taxonomy`, that cache entry
should be ignored.

Props GunGeekATX.
Fixes #40671.
Built from https://develop.svn.wordpress.org/trunk@40979


git-svn-id: http://core.svn.wordpress.org/trunk@40829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 11:46:41 +00:00
Boone Gorges
848bcf3b28 Introduce $comment_count param for WP_Query.
This parameter allows querying for posts with a specific value of
`comment_count`. It is also possible to query for posts that match
a `comment_count` comparison by passing an array with 'value' and
'compare' operators (eg `array( 'compare' => '>', 'value' => 5 )`).

Props ramon fincken.
Fixes #28399.
Built from https://develop.svn.wordpress.org/trunk@40978


git-svn-id: http://core.svn.wordpress.org/trunk@40828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 11:25:44 +00:00
Drew Jaynes
d6f7788935 Remove an unnecessary initialization of $description due to the else condition in get_the_archive_description().
See [40976]. See #38487.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40827 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 05:19:41 +00:00
Drew Jaynes
f6b5c794bf General: Add support for the post type archive description to get_the_archive_description(), and thereby also the_archive_description().
Props henrywright.
Fixes #38487.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40826 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 05:15:46 +00:00
Drew Jaynes
0fe9fb4a16 Link Template: Clarify documentation for the $id parameter in get_post_permalink(), get_edit_post_link(), edit_post_link(), and get_delete_post_link(), to reflect that either a post ID or WP_Post object is accepted.
Separately, use `$post` for checking the post status and retrieving the page_uri in `get_post_permalink()` instead of referencing back to the original `$id` parameter.

Props GunGeekATX for the initial patch.
Fixes #40780.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 03:29:42 +00:00
Drew Jaynes
903d23be34 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 03:02:41 +00:00
Drew Jaynes
25370ba481 Docs: Add a @property-read notation for the read-only WP_Term::$data property.
See [35269], #34348 and #41017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-30 17:04:40 +00:00
Drew Jaynes
4b0e64aa8c Docs: Add missing @since, @access, and @global notations to the DocBlock for WP_Query::parse_search_order().
Props dixitadusara.
Fixes #41045.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40822 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-30 16:08:44 +00:00
Drew Jaynes
66e6776a5e Docs: Add full parameter and return documentation for WP_Text_Diff_Renderer_Table::interleave_changed_lines().
Props coffee2code.
Fixes #38520.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40821 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-30 05:29:41 +00:00
Drew Jaynes
b13aa27cf4 Docs: Use third-person singular verbs in the summaries for wp_unschedule_hook() and wp_clear_scheduled_hook().
See #41017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-30 04:54:41 +00:00
Drew Jaynes
36759db92e Docs: Clarify accepted types and values for $menu parameters in several contexts:
* `wp_nav_menu()`
* `wp_get_nav_menu_object()` and its filter `wp_get_nav_menu_object`
* `is_nav_menu()`
* `wp_delete_nav_menu()`
* `wp_get_nav_menu_items()`

Props dimadin.
Fixes #38166.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40819 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-30 04:49:40 +00:00
Drew Jaynes
7001a3cce6 Tests: Add @method notations to factor class DocBlocks as a way to indicate expected return types from factory methods for the benefit of IDEs.
Props jdgrimes.
Fixes #37867.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-30 04:36:41 +00:00
Drew Jaynes
d829ec4cf2 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40817 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-30 04:18:43 +00:00
Drew Jaynes
af5b2ca7f5 Docs: Add more useful summaries to the DocBlocks for boolean $is_* properties in WP_Query.
Props megane9988 for the initial patch.
Fixes #34726.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-30 03:44:46 +00:00
Sergey Biryukov
641a4b643f Cron API: Introduce wp_unschedule_hook() to clear all events attached to a hook.
This complements `wp_clear_scheduled_hook()`, which only clears events attached with specific arguments.

Props arena, mordauk, jrf.
Fixes #18997.
Built from https://develop.svn.wordpress.org/trunk@40965


git-svn-id: http://core.svn.wordpress.org/trunk@40815 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-30 00:22:44 +00:00
Drew Jaynes
1fb8cbe8de Docs: Don't reference non-existent hooks inline in the DocBlock descriptions for the following template functions:
* `get_index_template()`
* `get_404_template()`
* `get_author_template()`
* `get_category_template()`
* `get_tag_template()`
* `get_taxonomy_template()`
* `get_date_template()`
* `get_home_template()`
* `get_front_page_template()`
* `get_page_template()`
* `get_search_template()`
* `get_single_template()`
* `get_embed_template()`
* `get_singular_template()`
* `get_attachment_template()`

As mentioned when these dynamic hook references were originally fixed in [33274], we can't link to non-existent hooks inline because the Code Reference auto-linker won't pick up on the dynamic-ness of the hook, it'll just try to link to a hook reference that doesn't exist. In these cases, we need to be generic and provide context for the value of `$type`.

See [38418] for where the original fix was reversed. See this changeset for reversing the reversal.

Props donutz, milana_cap.

Fixes #41198.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40814 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-29 16:05:41 +00:00
Drew Jaynes
8ccc74c054 Docs: Don't reference non-existent hooks inline in the DocBlock description for get_archive_template().
Also removes extra curly braces from the dynamic hook references added in [40962] to aid future re-parsing.

See #41198.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40813 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-29 15:47:40 +00:00
Drew Jaynes
1e32ebe87d Docs: Don't reference non-existent hooks inline in the DocBlock description for get_post_type_archive_template().
Props milana_cap.
See #41198.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40812 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-29 15:39:40 +00:00
James Nylen
8f6088ba6e REST API: Add a filter to allow modifying the response *after* embedded data is added.
Fixes #38964.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-29 13:17:43 +00:00
Sergey Biryukov
165807d39f 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.
Built from https://develop.svn.wordpress.org/trunk@40960


git-svn-id: http://core.svn.wordpress.org/trunk@40810 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-29 00:04:43 +00:00
Sergey Biryukov
11bae4ded3 Docs: Add a @global entry for $post variable in wp_post_preview_js().
Props avinapatel.
Fixes #41194.
Built from https://develop.svn.wordpress.org/trunk@40959


git-svn-id: http://core.svn.wordpress.org/trunk@40809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-28 12:55:43 +00:00
Sergey Biryukov
c6289b7440 Docs: Add missing backtick character in export_wp() DocBlock.
Props pbiron.
Fixes #41178.
Built from https://develop.svn.wordpress.org/trunk@40958


git-svn-id: http://core.svn.wordpress.org/trunk@40808 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-27 00:58:41 +00:00
Sergey Biryukov
01a6f4d38e 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.
Built from https://develop.svn.wordpress.org/trunk@40957


git-svn-id: http://core.svn.wordpress.org/trunk@40807 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-27 00:34:41 +00:00
Sergey Biryukov
25e94961b4 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.
Built from https://develop.svn.wordpress.org/trunk@40956


git-svn-id: http://core.svn.wordpress.org/trunk@40806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-27 00:27:39 +00:00
Sergey Biryukov
d08982bdbc Docs: Remove inaccurate parts of get_header, get_footer, and get_sidebar hooks documentation.
These sentences suggested that the hooks allow a specific template file to be used in place of the default file, which is not the case.

Props desrosj.
Fixes #40892.
Built from https://develop.svn.wordpress.org/trunk@40955


git-svn-id: http://core.svn.wordpress.org/trunk@40805 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-26 20:56:42 +00:00
Sergey Biryukov
62947553c5 Login and Registration: Prevent the enable_login_autofocus filter DocBlock from spilling into JS code.
Props chris@vendiadvertising.com.
Fixes #41176.
Built from https://develop.svn.wordpress.org/trunk@40954


git-svn-id: http://core.svn.wordpress.org/trunk@40804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-26 20:37:42 +00:00
Felix Arntz
5650910c50 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40803 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-26 19:20:40 +00:00
Drew Jaynes
78dba2fefd Docs: List out accepted values for the $field parameter in get_the_author_meta().
Props choongsavvii.
Fixes #38258.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40802 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-26 18:24:40 +00:00
Drew Jaynes
faab7f4533 Docs: Improve and clarify the DocBlock summary for wpmu_log_new_registrations().
Props daymobrew.
Fixes #39922.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-26 18:05:41 +00:00
Drew Jaynes
474711aac1 Docs: Adjust notation for the $context parameter in the DocBlocks for the wp_kses_allowed_html() function and its associated wp_kses_allowed_html filter.
`$context|$allowedtags` can be either a string or array.

Props bor0.
Fixes #40575.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40800 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-25 22:16:40 +00:00
Drew Jaynes
75acd01f98 Docs: Notate format_for_editor() as the replacement function in the DocBlock for the deprecated wp_richedit_pre().
Props rabmalin.
See #41121. Fixes #40709.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40799 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-25 22:10:41 +00:00
Drew Jaynes
07f01a2e10 Docs: Replace a variety of http links referenced in inline docs with their https counterparts (where possible).
Props johnpgreen.
Fixes #40732.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40798 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-25 22:06:41 +00:00
Drew Jaynes
97ef1ca74b Docs: Add missing deprecation, introduction, and summary information to the DocBlock for WP_Admin_Bar::recursive_render().
Props coffee2code.
Fixes #40840.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40797 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-25 21:58:41 +00:00
Drew Jaynes
3a3e133aaf Docs: Clarify that the $post parameters for the get_the_modified_date and get_the_modified_time filters can also be of type null.
Props dlh.
Fixes #40845.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40796 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-25 21:50:40 +00:00
Drew Jaynes
30719312fb Docs: Add a clarification to the description about what the $output parameter in the embed_html filter doc represents.
Props musus.
Fixes #37752.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40795 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-25 21:46:39 +00:00
Drew Jaynes
22f76adc8c Docs: Add full documentation for members in the labels object returned by get_taxonomy_labels().
Props truongwp.
Fixes #41108.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40794 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-25 21:42:43 +00:00
Drew Jaynes
f6bf00d378 Docs: Add a note to the DocBlock for wp_signon() mentioning that it doesn't handle setting the current user.
Also outlines the conditions that must be met for is_user_logged_in() to work with it.

Part props SergeyBiryukov.
Fixes #28116.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40793 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-25 20:08:40 +00:00
Drew Jaynes
de7499f88f Docs: Add full documentation for arguments accepted by wp_get_nav_menu_items().
Also provide differentiation between arguments as passed to `get_posts()` vs used for ordering outputted menu items.

By and large, arguments in the `$args` array are intended to directly affect how nav_menu_item posts are retrieved. When the default ARRAY_A is used for 'output', the 'order' and 'orderby' arguments are essentially ignored, instead giving preference to a hard-coded order of 'ASC' and an orderby value derived from the non-get_posts() argument 'output_key'.

Fixes #15533.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-25 19:37:39 +00:00
Weston Ruter
b7ca48fff0 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40791 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-25 18:48:41 +00:00
John Blackbourn
a507248146 Users: Use more appropriate HTTP status codes for errors relating to user management.
Also re-uses one error message string.

Props tuanmh

Fixes #40230

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


git-svn-id: http://core.svn.wordpress.org/trunk@40790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-25 18:46:44 +00:00
Weston Ruter
46551a898a 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40789 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-25 07:24:41 +00:00
Drew Jaynes
ae690a3fdf Scripts: Correctly reference WP_Scripts::print_extra_script() as the replacement for the deprecated WP_Scripts::print_scripts_l10n() method, rather than a nonexistent global print_extra_script() function.
Props fergbrain.
See #41121.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40788 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-25 07:20:41 +00:00
Drew Jaynes
4c60260c29 Docs: Fix alignment of the $output parameter in the hook doc for the do_shortcode_tag filter.
See #41017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-25 07:06:22 +00:00
Peter Wilson
cc82d38f47 Emoji: Fix typo in browserSupportsEmoji() comment.
Fairies not Faries, introduced in [40850].

Fixes #41157.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40786 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-25 07:05:42 +00:00
Weston Ruter
980f342ad6 Customize: Ensure header_image_data setting exists before attempting to use it.
Amends [27497].
Props Collizo4sky.
Fixes #41007.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-25 07:04:42 +00:00
Sergey Biryukov
332884f8dc Docs: Add a missing quote in user-agent argument description in WP_Http::request().
Props ixkaito.
Fixes #41154.
Built from https://develop.svn.wordpress.org/trunk@40934


git-svn-id: http://core.svn.wordpress.org/trunk@40784 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-25 07:00:42 +00:00
Drew Jaynes
82ed0bdd11 Docs: Improve description wording for get_template_part() in regard to overloading by child themes.
Also, update the summary to use a third-person singular verb.

Props ixmati.
See #41017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-25 06:56:40 +00:00
Drew Jaynes
6146ba0b33 Docs: Clarify the description for esc_html__() to note that the original text will be escaped on return if there is no translation, or the text domain isn't loaded.
Props brianlayman.
See #41017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40782 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-25 06:41:41 +00:00
Drew Jaynes
c5da335097 Docs: Fix a typo in the description for the get_previous_post_link() $link parameter. The default value is '%title', not '%title%'.
Props kmgalanakis.
See #41017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40781 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-25 06:20:43 +00:00
Drew Jaynes
fafa1dfa07 Docs: Add more complete documentation about expected values in the $meta parameter for wpmu_create_blog().
See #41017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40780 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-25 05:48:45 +00:00
Drew Jaynes
acea6cbad8 Improve the usefulness of several _deprecated_function() calls by passing known replacement functions, methods, or hooks.
Props jrf.
See #41121.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-25 00:05:44 +00:00
Sergey Biryukov
c0cf33b8f5 Import: Increase color contrast for "This importer is not installed" message on Multisite.
Remove `.not-installed-main-site` class introduced in [38075], but never used.

Props nishitlangaliya, mbootsman.
Fixes #41117.
Built from https://develop.svn.wordpress.org/trunk@40928


git-svn-id: http://core.svn.wordpress.org/trunk@40778 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-24 18:07:43 +00:00
Andrew Ozz
7f6ae69843 TinyMCE: fix directionality settings for RTL languages.
Props westonruter, sa3idho.
Fixes #40972 for trunk.
Built from https://develop.svn.wordpress.org/trunk@40927


git-svn-id: http://core.svn.wordpress.org/trunk@40777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-24 09:19:43 +00:00
Weston Ruter
a46d94efeb Widgets: Rename "HTML Code" widget to "Custom HTML" widget.
Correspondingly renames files, ID base from `html_code` to `custom_html`, and the filter from `widget_html_code_content` to `widget_custom_html_content`.

See #40907.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-24 00:00:45 +00:00
Sergey Biryukov
cf458a871d Docs: Document tags_input parameter in wp_insert_post().
Props barryceelen.
Fixes #41137.
Built from https://develop.svn.wordpress.org/trunk@40925


git-svn-id: http://core.svn.wordpress.org/trunk@40775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-23 21:27:44 +00:00
Boone Gorges
779788d8d6 When querying for terms, do not assume that $taxonomies is a 0-indexed array.
In [25108], the logic of term queries was modified to avoid assuming
that the `taxonomies` array was numerically indexed. See #23506. This
fix was inadvertantly reverted during the refactor in [25162].

Props david.binda.
Fixes #41113.
Built from https://develop.svn.wordpress.org/trunk@40924


git-svn-id: http://core.svn.wordpress.org/trunk@40774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-23 02:06:42 +00:00
Boone Gorges
8951af8ebb Introduce loop_no_results action.
This action fires when a `WP_Query` query returns no results.

Props mgibbs189.
Props #40850.
Built from https://develop.svn.wordpress.org/trunk@40923


git-svn-id: http://core.svn.wordpress.org/trunk@40773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-23 01:55:44 +00:00
Drew Jaynes
3a6985de96 Docs: Standardize and add missing deprecation notations in DocBlocks for the following functions:
* `post_form_autocomplete_off()`
* `_rotate_image_resource()`
* `_flip_image_resource()`
* `wp_get_sites()`
* `deactivate_sitewide_plugin()`

Props jrf.
See #41121.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-22 17:48:45 +00:00
Boone Gorges
2ebc1fb143 Cache results in get_objects_in_term().
This helps to reduce database queries when generating nav menus.

Props spacedmonkey.
Fixes #37094.
Built from https://develop.svn.wordpress.org/trunk@40921


git-svn-id: http://core.svn.wordpress.org/trunk@40771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-22 03:19:44 +00:00
Boone Gorges
8ca91024e8 Improve cache invalidation when splitting shared terms.
This changeset addresses two related issues:

* When splitting shared terms from hierarchical taxonomies, the process of regenerating the taxonomy hierarchy (`_get_taxonomy_hierarchy()`) requires recursive calls to `get_terms()` in order to descend the tree. By waiting until all shared terms in a term group have been invalidated before regenerating their taxonomy hierarchies, we avoid certain race conditions.
* Previously, a coding error prevented single-term caches from being invalidated for children of split terms. This error dates from [31418].

See #37189.
Built from https://develop.svn.wordpress.org/trunk@40920


git-svn-id: http://core.svn.wordpress.org/trunk@40770 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-21 04:12:44 +00:00
Boone Gorges
989427d598 Introduce clean_taxonomy_cache() function.
Previously, taxonomy-wide caches were cleaned only inside of
`clean_term_cache()`. This made it hard to clean taxonmy caches
in isolation from specific taxonomy terms.

Props spacedmonkey.
See #37189.
Built from https://develop.svn.wordpress.org/trunk@40919


git-svn-id: http://core.svn.wordpress.org/trunk@40769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-21 04:04:41 +00:00
Boone Gorges
f730861b90 Use WP_Term_Query when transforming tax queries.
This change allows tax query transformations to be cached.

Props spacedmonkey.
Fixes #37038.
Built from https://develop.svn.wordpress.org/trunk@40918


git-svn-id: http://core.svn.wordpress.org/trunk@40768 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-21 03:57:42 +00:00
Sergey Biryukov
3a190792ba Docs: Add missing @param and @return descriptions for has_term_meta(), wp_delete_category(), and wp_term_is_shared().
Props keesiemeijer.
Fixes #41096.
Built from https://develop.svn.wordpress.org/trunk@40917


git-svn-id: http://core.svn.wordpress.org/trunk@40767 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-20 18:28:46 +00:00
Boone Gorges
92175dbd33 Add term meta support to XML-RPC addTerm and editTerm endpoints.
This changeset also includes the new function `has_term_meta()`, a
counterpart to `has_meta()` (for posts).

Props enrico.sorcinelli.
Fixes #35991.
Built from https://develop.svn.wordpress.org/trunk@40916


git-svn-id: http://core.svn.wordpress.org/trunk@40766 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-18 10:40:46 +00:00
Peter Wilson
395ff7aebe Docs: Add wp-admin/js/media.js documentation.
Props jipmoors, jjcomack, diedeexterkate.
Fixes #41072.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40765 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-15 15:37:53 +00:00
Peter Wilson
952975fd0d Docs: Add wp-admin/js/custom-background.js documentation.
Props jipmoors.
Fixes #41067.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40764 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-15 13:24:41 +00:00
Sergey Biryukov
c569080cd1 Docs: Add documentation for wp-admin/js/comment.js.
Props ireneyoast, andizer, jipmoors.
Fixes #41065.
Built from https://develop.svn.wordpress.org/trunk@40913


git-svn-id: http://core.svn.wordpress.org/trunk@40763 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-15 13:02:40 +00:00
Sergey Biryukov
3abb3087df Docs: Correct parameter description for posts_join filter.
Props anhskohbo.
Fixes #40991.
Built from https://develop.svn.wordpress.org/trunk@40912


git-svn-id: http://core.svn.wordpress.org/trunk@40762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-15 12:46:41 +00:00
Sergey Biryukov
e441ee48d2 I18N: Add @global entry for $wp_locale in wp_maybe_decline_date().
Props Dency.
Fixes #41046.
Built from https://develop.svn.wordpress.org/trunk@40911


git-svn-id: http://core.svn.wordpress.org/trunk@40761 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-15 12:24:41 +00:00
Sergey Biryukov
d14cc278ff Editor: Correct $settings parameter description in _WP_Editors::editor().
Props truongwp.
Fixes #40963.
Built from https://develop.svn.wordpress.org/trunk@40910


git-svn-id: http://core.svn.wordpress.org/trunk@40760 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-15 12:19:40 +00:00
Sergey Biryukov
f1740f3702 I18N: Correct translator comment for response error message in WP_Community_Events::get_events().
Props Soean, tfirdaus.
Fixes #40939.
Built from https://develop.svn.wordpress.org/trunk@40909


git-svn-id: http://core.svn.wordpress.org/trunk@40759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-15 12:07:41 +00:00
Sergey Biryukov
0990313c25 Twenty Sixteen: Allow category display in post preview even when there is only one category.
Props lancewillett, davidakennedy.
Fixes #39531.
Built from https://develop.svn.wordpress.org/trunk@40908


git-svn-id: http://core.svn.wordpress.org/trunk@40758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-15 12:06:41 +00:00
John Blackbourn
a72ec29c4d General: Introduce a wp_is_mobile filter for controlling whether a request should be treated as coming from a mobile device.
Props PressLabs

Fixes #41023

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


git-svn-id: http://core.svn.wordpress.org/trunk@40757 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-15 12:05:42 +00:00
John Blackbourn
523b08600f Database: Add documentation for the allowed utf8mb4_520 value when detecting features with wpdb::has_cap().
Props rcutmore

Fixes #41044

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


git-svn-id: http://core.svn.wordpress.org/trunk@40756 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-15 12:00:43 +00:00
Sergey Biryukov
4398862f3d I18N: Add context for News blog URL in 'WordPress Events and News' dashboard widget.
Props zodiac1978.
Fixes #40929.
Built from https://develop.svn.wordpress.org/trunk@40905


git-svn-id: http://core.svn.wordpress.org/trunk@40755 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-15 11:52:43 +00:00
Dominik Schilling
6a3be0ea29 Twenty Seventeen: Remove/merge unused variables in content-front-page.php.
#wceu2017

Props dingo_bastard, mariusvetrici.
Fixes #39771.
Built from https://develop.svn.wordpress.org/trunk@40904


git-svn-id: http://core.svn.wordpress.org/trunk@40754 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-15 10:20:42 +00:00
Boone Gorges
736e6a2977 Simplify documentation for wp_dropdown_categories().
Props ArnaudBan.
Fixes #41058.
Built from https://develop.svn.wordpress.org/trunk@40903


git-svn-id: http://core.svn.wordpress.org/trunk@40753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-15 09:39:42 +00:00
Adam Silverstein
7846cdc632 Media: Disable the edit image->replace button when no item selected.
On the edit media screen, ensure that the 'replace' button is disabled until a media item is selected. Fix an issue where clicking the button with no item selected threw a JavaScript error and failed to work.

Props timmydcrawford, subrataemfluence, psiico.
Fixes #40589.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40752 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-15 09:38:46 +00:00
Pascal Birchler
b0fed2af63 Embeds: Update oEmbed endpoint URL for VideoPress.
Props NomNom99.
Fixes #41019.
Built from https://develop.svn.wordpress.org/trunk@40901


git-svn-id: http://core.svn.wordpress.org/trunk@40751 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-15 05:38:45 +00:00
Drew Jaynes
39d2d9f19e Docs: Include 'parent' as an acceptable entry for the $orderby argument in WP_Term_Query.
h/t kalor.
See #41017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40750 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-13 03:11:40 +00:00
Drew Jaynes
fe163ec82a Docs: Clarify that get_the_author_meta() can also return an empty string.
h/t aurovrata.
See #41017

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


git-svn-id: http://core.svn.wordpress.org/trunk@40749 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-13 02:33:42 +00:00
Drew Jaynes
a64aa2115d Docs: Correct a typo in the sort_column argument description for wp_page_menu().
h/t spacegrrl.
See #41017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40748 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-13 01:11:43 +00:00
Andrea Fercia
f28f4fc637 Accessibility: Avoid a keyboard trap on the permalink custom structure setting.
Using the `focus` event on the permalink custom structure field made impossible
to navigate through all the form fields using only the keyboard without actually
selecting the custom structure setting. Instead, using click and input preserves
the original functionality when using any kind of pointing or input device.

Also changes `attr()` to `prop()`` as recommended for a `checked` property.

Fixes #40982.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40747 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-12 14:09:43 +00:00
Weston Ruter
2327afb5fe Customize: Restore right border on footer actions.
Fixes regression introduced in [40511].

Props timmydcrawford.
See #32296.
Fixes #40978.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40746 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-12 00:17:44 +00:00
Sergey Biryukov
5041510529 Docs: Remove duplicate @return keyword in WP_Community_Events::get_request_args.
Props ketuchetan.
Fixes #40973.
Built from https://develop.svn.wordpress.org/trunk@40895


git-svn-id: http://core.svn.wordpress.org/trunk@40745 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-11 11:10:43 +00:00
Sergey Biryukov
678b53cb45 Docs: Add missing opening quote for 'home' in {$type}_template_hierarchy and {$type}_template filters documentation.
Props tmatsuur, truongwp.
Fixes #40962.
Built from https://develop.svn.wordpress.org/trunk@40894


git-svn-id: http://core.svn.wordpress.org/trunk@40744 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-10 22:48:44 +00:00
Weston Ruter
38db73cff8 Widgets: Add widget dedicated for HTML Code, taking over this role of the Text widget.
Props westonruter, timmydcrawford.
See #40951, #35243.
Fixes #40907.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-09 23:54:42 +00:00
Weston Ruter
011d33e95b Media: Restrict appending loop parameter to Vimeo URLs specifically and not all external URLs in Video widget (via shortcode).
Fixes issue where Video widgets embedding external files fail to get recognized due to the presence of the `loop` param after the video filename, even though it has a recognized extension. Regardless, the `loop` param is only present to fix a Vimeo issue in ME.js 2.x.

Props timmydcrawford.
Amends [40640].
See #39686, #39994.
Fixes #40977.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-09 19:29:43 +00:00
Aaron Jorbin
9cff8ff056 About Page: update CSS with prefixes
Seconded by melchoyce.

See #40721.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40735 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-08 04:51:42 +00:00
Aaron Jorbin
efc146a3ca Bundled Themes - Bump themes in preparation for 4.8
Change version numbers in stylesheets, fix typo in Twenty Fourteen readme and update copyright dates for themes. Twentysixteen wasn't updated this cycle.

See #40745 for changes that helped push this along.
Fixes #40905.
Props davidakennedy, mrahmadawais, maedahbatool.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-08 04:40:43 +00:00
Sergey Biryukov
04c688ad52 Docs: Add missing closing quote for 'Restore' in post_row_actions and page_row_actions filters documentation.
See #26397.
Built from https://develop.svn.wordpress.org/trunk@40882


git-svn-id: http://core.svn.wordpress.org/trunk@40732 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-07 23:11:43 +00:00
Mel Choyce
1f2231fccc About: Swap out images and videos for CDN versions, and add responsive images.
Props: joemcgill, pento.
See #40721. 

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


git-svn-id: http://core.svn.wordpress.org/trunk@40731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-07 22:07:40 +00:00
Dominik Schilling
ec0918a6a7 Upgrade: Add wp-includes/js/tinymce/plugins/wpembed to $_old_files.
See #39513.
Fixes #40942.
Built from https://develop.svn.wordpress.org/trunk@40879


git-svn-id: http://core.svn.wordpress.org/trunk@40729 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-07 21:32:44 +00:00
Andrea Fercia
1d34043e8c Dashboard: Better titles for the Recent Drafts widget.
- changes "Drafts" to "Your Recent Drafts" to clarify displayed drafts are the ones from the current user
- clarifies and simplifies the "View all" link

Props soniakash, sudar, bhargavbhandari90, zachwtx, johnroper100, rcutmore.
Fixes #37595.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40727 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-05 12:00:43 +00:00
Adam Silverstein
c7f7e76515 Media: Fix an issue selecting media when clicking item edges.
Adjust targeting of the click handler for media item selection so clicking edges of media items properly selects them.

Props circlecube, psiico.
Fixes #40578.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-05 00:49:43 +00:00
John Blackbourn
2607373832 Build/Test Tools: I don't know how this happened.
See #39822

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


git-svn-id: http://core.svn.wordpress.org/trunk@40723 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-02 14:11:42 +00:00
John Blackbourn
f5230de682 Build/Test Tools: Fix PHP 5.2 compatibility for grandchild methods which expect exceptions to be raised.
This is due to `is_callable( 'parent::setExpectedException' )` not being supported on PHP 5.2 when the method being checked only exists on the grandparent class.

Props jdgrimes

See #39822

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


git-svn-id: http://core.svn.wordpress.org/trunk@40722 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-02 13:18:45 +00:00
Ella Iseulde Van Dorpe
ff8af70bf1 Trunk is really 4.9-alpha now
Built from https://develop.svn.wordpress.org/trunk@40871


git-svn-id: http://core.svn.wordpress.org/trunk@40721 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-01 22:08:40 +00:00
Ella Iseulde Van Dorpe
9fed860b33 Trunk is now 4.9-alpha
Built from https://develop.svn.wordpress.org/trunk@40870


git-svn-id: http://core.svn.wordpress.org/trunk@40720 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-01 21:48:40 +00:00
Ella Iseulde Van Dorpe
84d9597ce4 Bump version after RC2
Built from https://develop.svn.wordpress.org/trunk@40868


git-svn-id: http://core.svn.wordpress.org/trunk@40718 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-01 21:22:40 +00:00
Ella Iseulde Van Dorpe
c44ba7cfa9 Bump version for WordPress 4.8 RC2
Built from https://develop.svn.wordpress.org/trunk@40867


git-svn-id: http://core.svn.wordpress.org/trunk@40717 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-01 20:40:45 +00:00
Dominik Schilling
55497ccfd1 I18N: Improve translator comments for strings in the community events widget.
Props dimadin, iandunn.
Fixes #40865.
Built from https://develop.svn.wordpress.org/trunk@40866


git-svn-id: http://core.svn.wordpress.org/trunk@40716 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-01 09:49:42 +00:00
Dominik Schilling
7737e48a21 About: Sync tagline from about page with credits and freedoms.
See #40721.
Built from https://develop.svn.wordpress.org/trunk@40865


git-svn-id: http://core.svn.wordpress.org/trunk@40715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-01 09:24:43 +00:00
Dominik Schilling
0e82284d87 Multisite: Revert indentation of the sample page content added in [40296].
Props swissspidy.
Fixes #40895.
Built from https://develop.svn.wordpress.org/trunk@40864


git-svn-id: http://core.svn.wordpress.org/trunk@40714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-01 09:16:40 +00:00
Mel Choyce
d69e67581f About: Finalize strings.
Props: bridgetwillard, jenblogs4u, michelleweber, flixos90, johnbillion, francina, voldemortensen, melchoyce.
See #40721.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-01 03:14:41 +00:00
Andrew Ozz
56101fc06a TinyMCE: Force urlencoding of commas in URLs added by plugins to prevent warnings about missing stylesheets.
Fixes #40893.
Built from https://develop.svn.wordpress.org/trunk@40862


git-svn-id: http://core.svn.wordpress.org/trunk@40712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-31 22:04:43 +00:00
Mel Choyce
69a7ab7d37 About: Add Link Boundary video and update poster image.
See #40721.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40711 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-31 18:02:44 +00:00
Andrew Ozz
9799bf93f5 TinyMCE: update to 4.6.3. Fixes few more edge cases with link boundaries. Changelog: https://www.tinymce.com/docs/changelog/#version463-may302017
Fixes #40890.
Built from https://develop.svn.wordpress.org/trunk@40856


git-svn-id: http://core.svn.wordpress.org/trunk@40707 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-30 23:35:41 +00:00
John Blackbourn
95cf5aa7c9 Build/Test Tools: Add a missing class to the PHPUnit 6 back compat.
See #39822

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


git-svn-id: http://core.svn.wordpress.org/trunk@40704 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-30 22:07:41 +00:00
Konstantin Obenland
fd77b45b57 Twenty Sixteen: Add missing binary files
They slipped through the cracks when applying/creating patches.

See [40851], #36497.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40703 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-30 21:53:40 +00:00
Konstantin Obenland
d22061139e Importing Twenty Sixteen, default theme for 2016.
Fixes #36497.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-30 21:21:43 +00:00
Gary Pendergast
930d29f267 Emoji: Fix the flag and emoji5 tests not working correctly.
Fixes the UN flag not being correctly compared to itself, introduced in [40837].

Replaces the bearded person check with a male fairy. Emoji 5 does not have gendered bearded people, so we needed to switch it out to use the ZWJ check for a broken render.

Props peterwilsoncc for the code and commit message.
Fixes #40858.



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


git-svn-id: http://core.svn.wordpress.org/trunk@40701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-29 03:21:42 +00:00
Mel Choyce
530577a670 About: Introduce design and add link to Media Widgets API dev note.
Props: ryelle rclations melchoyce westonruter.
See #40721.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40700 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-27 15:04:43 +00:00
Andrew Ozz
5136fe6ca6 TinyMCE: update to the TINY-1079 (latest) branch. Fixes several edge cases including the errors thrown when moving the caret with the arrow keys around nested <a><code> elements.
Fixes #40874 #40868.
Built from https://develop.svn.wordpress.org/trunk@40848


git-svn-id: http://core.svn.wordpress.org/trunk@40699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-27 02:09:45 +00:00
Weston Ruter
91f544da29 Widgets: Normalize YouTube and Vimeo URLs in video shortcode (primarily for Video widget) to work around ME.js 2.22 bug.
Props timmydcrawford, jnylen0, westonruter.
See #32417, #39994.
Fixes #40866.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-26 23:10:44 +00:00
Andrew Ozz
91090572fe Bump version after RC1.
Built from https://develop.svn.wordpress.org/trunk@40846


git-svn-id: http://core.svn.wordpress.org/trunk@40697 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-25 20:34:41 +00:00
Matias Ventura
fe37d6f1de WordPress 4.8 RC1.
Built from https://develop.svn.wordpress.org/trunk@40845


git-svn-id: http://core.svn.wordpress.org/trunk@40696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-25 18:45:42 +00:00
James Nylen
8bf130d64a Revert [40842] due to failing tests.
See #19629.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-25 18:28:43 +00:00
John Blackbourn
f750a800d0 REST API: In the admin area, ensure the REST API endpoint URL is forced to https when necessary.
In this situation, a site which uses `http` on the front end but `https` in the admin area is more likely to have a working REST API endpoint URL when used in the admin area.

Props mohanjith, westonruter, jnylen0

Fixes #36451

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


git-svn-id: http://core.svn.wordpress.org/trunk@40694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-25 18:02:41 +00:00
Mike Schroder
2117fa8cee Media: Introduce tests for media_sideload_image().
Adds basic tests for `media_sideload_image()`, including testing
the return arguments.

Props westonruter, mikeschroder.
Fixes #19629.
Built from https://develop.svn.wordpress.org/trunk@40842


git-svn-id: http://core.svn.wordpress.org/trunk@40693 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-25 18:01:46 +00:00
Andrew Ozz
b015889bb8 About: Further polish for Under The Hood.
Props: melchoyce apmarshall obenland. General props for the About page: hedgefield reportermike.
See #40721.
Built from https://develop.svn.wordpress.org/trunk@40841


git-svn-id: http://core.svn.wordpress.org/trunk@40692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-25 17:53:40 +00:00
Adam Silverstein
5f411ba353 Plugins: fix regression in search input field size.
Fix a formatting regression introduced in [40792] which attempted to resize the input for mobile, see #40130.

Props leemon, juhise, voldemortensen.
Fixes #40857. 


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


git-svn-id: http://core.svn.wordpress.org/trunk@40691 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-25 15:22:42 +00:00
Konstantin Obenland
71cd7287ba Default themes: Improve styles for 4.8 widgets
Mostly adds styles for lists and mediaelement.js instances within widgets.
Adds size classname to image widget so themes can customize their display.

Props Soean, obenland, celloexpressions, ocean90, karmatosed.
Fixes #40745.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40690 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-25 15:19:42 +00:00
Konstantin Obenland
25c2b2cab7 About: Further polish for feature descriptions.
Also adds Under The Hood content.

Props apmarshall, azaozz, iandunn, bridgetwillard, melchoyce.
See #40721.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-25 15:11:42 +00:00
Peter Wilson
03f483215d Emoji: Add Emoji 5 support.
Updates Twemoji to 2.3.0 to include Emoji 5 support.

The pride flag test is replaced with a test for the English flag, a five character sub-devision locale. The UN flag test is retained as the most recent two character locale.

An Emoji 5 "bearded person" replaces both Emoji 4 tests.

Fixes #40858.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40688 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-25 07:18:45 +00:00
Weston Ruter
bb2e8b0d63 Widgets: Ensure that audio and video files appear in media library browser upon upload.
Props timmydcrawford.
Amends [40640].
See #32417, #39994, #39995.
Fixes #40803.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-25 03:20:41 +00:00
Weston Ruter
8307924de6 Widgets: Supply missing descriptions for instance schema fields in media widgets.
Reuse translated strings from media templates.

Amends [40640].
See #32417.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-25 02:59:44 +00:00
Andrew Ozz
a8309f80c3 TinyMCE: update to 4.6.2. Changelog: https://www.tinymce.com/docs/changelog/#version462-may232017.
Fixes #40859 #40756.
Built from https://develop.svn.wordpress.org/trunk@40834


git-svn-id: http://core.svn.wordpress.org/trunk@40685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-25 01:14:43 +00:00
Weston Ruter
478d7730b6 Widgets: Prevent multiple items from being selectable when first populating a media widget.
Amends [40640].
Props obenland, timmydcrawford.
See #32417.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-24 05:31:42 +00:00
Konstantin Obenland
92d6abac47 Themes: Skip tests if ReflectionMethod::setAccessible is unavailable
See [40825].

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


git-svn-id: http://core.svn.wordpress.org/trunk@40683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-23 22:16:42 +00:00
Konstantin Obenland
265787774e Themes: More unit tests for Custom Header
Custom Header functionality is largely untested. This adds tests for existing
behavior as well as changes introduced in [39227].

Props bradyvercher.
See #38639.
Fixes #39241.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-23 20:56:41 +00:00
Adam Silverstein
5cc6c39430 Themes: improve browser history support on new themes page.
When closing the theme preview, restore the previously selected tab. Avoid an issue where duplicate entries in the history prevented navigation. When re-opening the preview, remove bound event handlers before re-adding them.

Props afercia.
Fixes #36613.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40681 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-23 20:32:44 +00:00
Andrea Fercia
3aabc09e9c Administration: Fix some HTML validation errors.
Fixes some minor HTML issues in the admin and, most notably, changes the rel
attribute used in the List Tables from `rel="permalink"` to `rel="bookmark"`.

Props mihai2u, pento, arena, topher1kenobe, michalzuber, stubgo.
Fixes #37004.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-23 17:58:43 +00:00
Sergey Biryukov
da0a505497 Administration: Update the docs for wp_check_browser_version().
Correct `update_url` key name, add missing `platform` key.

Props coffee2code.
Fixes #40839.
Built from https://develop.svn.wordpress.org/trunk@40822


git-svn-id: http://core.svn.wordpress.org/trunk@40679 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-23 00:17:42 +00:00
Weston Ruter
6e935e7f20 Widgets: Further refine WP JS coding style in media widgets code.
Props afercia.
See #32417.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40678 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-22 22:05:42 +00:00
Weston Ruter
e083a1aff7 Post-4.8 Beta 2 bump.
Built from https://develop.svn.wordpress.org/trunk@40820


git-svn-id: http://core.svn.wordpress.org/trunk@40677 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-22 21:43:42 +00:00
Weston Ruter
979677bcfb WordPress 4.8 Beta 2 ([40807] again)
Built from https://develop.svn.wordpress.org/trunk@40819


git-svn-id: http://core.svn.wordpress.org/trunk@40676 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-22 21:14:40 +00:00
Andrea Fercia
2cbd9cf75e Themes: Improve the theme Custom Logo accessibility.
Uses the Site title as fallback value for the Custom Logo alt attribute when the original alt attribute is empty.

Props sami.keijonen, joedolson, sstoqnov, nobremarcos, gma992, LiamMcArthur, jjcomack.
Fixes #38768.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40675 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-22 20:29:42 +00:00
Andrea Fercia
bdad500af7 Widgets: Remove the title attributes used in the Tag cloud widget.
- improves accessibility using an aria-label attribute to match the information conveyed visually with the one exposed to assistive technologies
- adds an option in the widget to display the item counts, consistently with what other widgets already do (Archives, Categories)

Props adamsoucie, emirpprime, Samantha Miller., MikeLittle, rianrietveld, sami.keijonen, adamsilverstein, westonruter, afercia.
See #24766.
Fixes #35566.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40674 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-22 20:24:41 +00:00
James Nylen
252ab08d88 REST API: Fix changing parameters with set_param() for some requests.
Prior to this commit, `WP_Rest_Request::get_param()` traversed through the parameter order but `WP_Rest_Request::set_param()` did not. For JSON requests (and likely other situations as well), this meant that changing a parameter with `set_param()` would have no effect on `get_param()`.

Props TimothyBlynJacobs.
Fixes #40344.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-22 16:16:42 +00:00
Dominik Schilling
24a7666e69 About: Remove a stray quotation mark.
Props odysseygate.
See #40721.
Fixes #40837.
Built from https://develop.svn.wordpress.org/trunk@40814


git-svn-id: http://core.svn.wordpress.org/trunk@40672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-22 15:02:43 +00:00
Weston Ruter
3d9e57f534 Media: Remove core embedding support for WMV and WMA files since MediaElement.js has discontinued supporting them.
Plugins may continue to add embedding support for these file formats by re-adding them via the `wp_video_extensions` and `wp_audio_extensions` filters while also implementing fallback rendering routines via the `wp_video_shortcode_override` and `wp_audio_shortcode_override` filters.

See #39994, #39995.
Fixes #40819.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40671 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-22 05:39:44 +00:00
Andrea Fercia
b5eeb88286 Widgets: clarify some context information for translators.
Props Italian polyglots team.
Amends [40640].
See #32417, #39993, #39994, #39995.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40670 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-21 20:44:45 +00:00
Dominik Schilling
96549c5022 Widgets: Remove unused JS variable to fix JSHint error introduced in [40640].
See #39994.
Built from https://develop.svn.wordpress.org/trunk@40811


git-svn-id: http://core.svn.wordpress.org/trunk@40669 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-20 09:45:42 +00:00
Weston Ruter
039397721e Widgets: Introduce isHostedVideo method on VideoWidgetControl to allow plugins to extend for recognizing services beyond YouTube and Vimeo.
Also update jshint configuration in Gruntfile to include the widget scripts among the JS files linted.

Props timmydcrawford.
See #39994.
Fixes #40808.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40668 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-20 04:18:41 +00:00
Mike Schroder
db5091eaa1 Media: Decode HTML entities in author_name before sending to JS.
In `wp_prepare_attachment_for_js()`:
- Normalize behavior when author does not exist by returning '(no author)' for `authorName` in these cases.
- Decode HTML entities in `author_name`.
- Add tests for both of the above.

Props arshidkv12, ocean90, sloisel, mikeschroder.
Fixes #39955.
Built from https://develop.svn.wordpress.org/trunk@40809


git-svn-id: http://core.svn.wordpress.org/trunk@40667 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-20 02:23:43 +00:00
Weston Ruter
5c671464de Revert [40807] unbumping from 4.8 Beta 2 back to Beta 1 due to aborted release.
Built from https://develop.svn.wordpress.org/trunk@40808


git-svn-id: http://core.svn.wordpress.org/trunk@40666 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 23:00:43 +00:00
Weston Ruter
48578765ec WordPress 4.8 Beta 2
Built from https://develop.svn.wordpress.org/trunk@40807


git-svn-id: http://core.svn.wordpress.org/trunk@40665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 22:02:41 +00:00
Weston Ruter
123158e7d8 Widgets: Revert [40251] pending more accessible solution for showing default widget titles rather than using placeholders.
See #39909.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 20:45:40 +00:00
James Nylen
df5b8dcc82 REST API: Avoid sending blank Last-Modified headers with authenticated requests.
This commit adds a new `WP_REST_Server#remove_header` method and uses it to clear the `Last-Modified` header when the "no caching" headers are sent (by default for all authenticated REST API requests).  This matches the behavior of the `nocache_headers` function used in other parts of WordPress.

Previously, the REST API would send an empty `Last-Modified` header in this situation.  Under some server and browser configurations, this causes browsers to cache authenticated REST API requests, which is undesirable.

Props iv3rson76, zinigor, rmccue, jnylen0.
Fixes #40444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40663 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 20:27:44 +00:00
Weston Ruter
e8e5a71a85 Docs: Improve phpdoc for WP_Customize_Manager, WP_Customize_Control, WP_Customize_Setting, and WP_Customize_Selective_Refresh.
Props 4nickpick, sagarprajapati, ketuchetan, BharatKambariya, mrahmadawais, westonruter.
Fixes #39671.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40662 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 20:25:41 +00:00
Sergey Biryukov
2c5e9a34b2 Dashboard: Change the cache key for dashboard RSS widget; remove the unnecessary database upgrade routine.
Props iandunn, ocean90.
See #40702.
Built from https://develop.svn.wordpress.org/trunk@40803


git-svn-id: http://core.svn.wordpress.org/trunk@40661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 19:14:42 +00:00
Sergey Biryukov
a2788b09d5 Dashboard: Append the current locale to dashboard RSS widget cache key in wp_dashboard_rss_control(), for consistency with the changes to wp_dashboard_cached_rss_widget() in [33183] and [33192].
See #32804, #40702.
Built from https://develop.svn.wordpress.org/trunk@40802


git-svn-id: http://core.svn.wordpress.org/trunk@40660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 19:00:44 +00:00
Andrew Ozz
a89f203b21 TinyMCE: fix selecting the link node after creating a link by pasting an URL.
Props iseulde.
Fixes #40818.
Built from https://develop.svn.wordpress.org/trunk@40801


git-svn-id: http://core.svn.wordpress.org/trunk@40659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 18:55:44 +00:00
Joe McGill
7d43d71800 Media: Ensure WP_Screen sets post type on wp-admin/upload.php.
The post type property is set to 'attachment' when on the upload screen.

Props postpostmodern.
Fixes #39509.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 18:29:42 +00:00
Andrea Fercia
1a8f7ab144 Dashboard: Don't trigger an Events search when the search field is empty.
Fixes #40816.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 17:27:43 +00:00
Konstantin Obenland
92642624fd About: Optimize strings for l10n
Uses html entities for quotes and adds translator comment for event links.

Props ocean90.
See #40721.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40656 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 16:45:44 +00:00
Andrea Fercia
e008a5c7db Themes: Improve the theme installer Favorites and Feature Filter tabs alignment.
Props nitin kevadiya, darshan02, mp518.
Fixes #40315.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40655 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 16:18:41 +00:00
Konstantin Obenland
359cc45e08 Docs: Improve inline docs for inlineEditPost.
Props jjcomack, rensw90.
Fixes #39823.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40654 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 15:45:42 +00:00
Konstantin Obenland
14d0491fbf Twenty Seventeen: Remove uneccessary return statement
Props truongwp.
Fixes #40516.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40653 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 15:19:41 +00:00
Andrea Fercia
36d25d3960 Dashboard: Improve the Events widget spinner position after [40789].
Props iandunn.
Fixes #40735.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 14:44:41 +00:00
Dominik Schilling
97e98a80f6 Dashboard: Use get_user_locale() for the news feed cache key.
Since the feed URL can be localized the cache key has to be built with the same locale as the current user is using.

Props iandunn.
Fixes #40417.
Built from https://develop.svn.wordpress.org/trunk@40793


git-svn-id: http://core.svn.wordpress.org/trunk@40651 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 14:36:42 +00:00
Adam Silverstein
5ddd3f92e8 Media: make search input full width on mobile.
Props abhishekfdd.
Fixes #40130.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40650 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 13:45:42 +00:00
Konstantin Obenland
34e2a6110e About: Let's get a headstart on 4.8 about strings
Strings have been reviewed and are ready for translation—design will come soon.

Props bridgetwillard, jenblogs4u, michelleweber, ryelle, melchoyce.
See #40721.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40649 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 11:55:44 +00:00
Andrew Ozz
7a9ce6d03f Dashboard: Improve the handling of locations determined by geolocating the IP address and by entering a city name. Fix couple of edge cases, and some names.
Props iandunn coreymckrill.
Fixes #40702.
Built from https://develop.svn.wordpress.org/trunk@40790


git-svn-id: http://core.svn.wordpress.org/trunk@40648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 05:48:42 +00:00
Andrew Ozz
daab579a88 Dashboard:
- Close the form after obtaining a valid location.
- Fix focusing the toggle button after closing the form.
- Fix aria attribute values.
- Fix positions in IE11.
- Some JS and CSS cleanup.

Props afercia, coreymckrill.
Fixes #40735.
Built from https://develop.svn.wordpress.org/trunk@40789


git-svn-id: http://core.svn.wordpress.org/trunk@40647 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 04:01:41 +00:00
Weston Ruter
bd990d7c4e Docs: Add missing @since tags and phpdoc descriptions to the Custom_Image_Header class.
Amends [27497].
Props tejas5989, riddhiehta02, westonruter.
See #21785.
Fixes #40231.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 03:53:43 +00:00
Andrew Ozz
d7c37de2de Editor: When stripping paragraph tags, and there is a <br> at the beginning or the end, merge them and keep the paragraph, not the <br>.
Props rellect.
Fixes #37066.
Built from https://develop.svn.wordpress.org/trunk@40787


git-svn-id: http://core.svn.wordpress.org/trunk@40645 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-18 22:55:42 +00:00
Andrew Ozz
b398ccf2a1 TinyMCE: fix pasting while an image with caption is selected. The image and the caption should be replaced with the pasted content.
Fixes #40809.
Built from https://develop.svn.wordpress.org/trunk@40786


git-svn-id: http://core.svn.wordpress.org/trunk@40644 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-18 22:25:41 +00:00
Weston Ruter
e62f6ac8fe Widgets: Ensure title field for media widget will update with sanitized value after change event in addition to input event.
Aligns behavior of field with Text widget and other widgets whereby the server-sanitized title (via the `widget-update` request) is supplied into the field after the `change` event.

See #32417.
Fixes #40805.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40643 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-18 21:04:41 +00:00
Weston Ruter
698c6de4da Widgets: Use "Add Audio" for button in Audio widget instead of generic "Add File".
Props juhise.
See #39995.
Fixes #40797.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40642 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-18 18:34:42 +00:00
Matias Ventura
aee7e6a1bf TinyMCE: Provide styles for link and code boundaries.
The new version of TinyMCE introduces a cursor-boundary feature for some formatting elements but, by default, it does not provide much in the way of styles. This tweaks their appearance in the WordPress custom skin to match the intended design of the feature.

Props joen.
Fixes #40767.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40641 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-18 17:52:42 +00:00
James Nylen
21b1135b1c REST API: Do not set X-WP-Deprecated* headers as often.
Only set these headers if (1) `WP_DEBUG` is enabled and (2) headers have not already been sent.

Previously, this code could generate warnings by trying to set a header after response data has already been sent.  This happens when code attached to the `shutdown` filter calls a deprecated function, for example.

Also, these headers are unlikely to be useful in the majority of cases; let's only send them if `WP_DEBUG` is enabled.

Props kraftbj, jnylen0, ocean90, rmccue.
Fixes #40787.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-18 17:49:42 +00:00
Konstantin Obenland
8ef02e5ec7 Dashboard: Combine methods to retreive IP
They're only used in one place, no reason to be so verbose about it.

See #40702.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40639 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-18 17:34:42 +00:00
Jeremy Felt
fd63ede892 Multisite: Handle both role change selections in site-users.php.
Previously, a role selected below the list table would not apply on save. This aligns the behavior with `wp-admin/users.php` and allows role changes from both selections, deferring to the bottom selection when both are populated.

Props desrosj.
Fixes #40113.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40638 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-18 17:08:43 +00:00
Andrea Fercia
591f423132 Administration: Use consistent spacing for form elements in the Discussion Settings screen.
Props sagarjadhav.
Fixes #31594.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40637 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-18 15:55:44 +00:00
John Blackbourn
64d65f007d Login and Registration: Add some margin to notices on the login screen so multiple notices remain separated.
Fixes #39971

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


git-svn-id: http://core.svn.wordpress.org/trunk@40636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-18 15:40:41 +00:00
Konstantin Obenland
83187e8ea0 Dashboard: Document request proxy for events.
Documents the reason why the request is proxied through WP, instead of being
made directly to api.wordpress.org.

Props iandunn, michelleweber.
See #40702.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40635 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-18 14:44:43 +00:00
Konstantin Obenland
9bbbc719d4 Dashboard: Properly localize data for events
Moves localization to script-loader and removes dependency for two strings.

Props dd32, iandunn.
See #40702.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-18 14:34:43 +00:00
Pascal Birchler
bb1207cf5a Media: Correct a translatable string for MediaElement.js.
Adds the needed context to the string "None". Introduced in [38089].

Props leewillis77.
See #37394.
Fixes #40800.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40633 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-18 11:06:44 +00:00
Konstantin Obenland
7cae389acc Dashboard: Always pass the IP when getting events
Allows the API to determine event locations more accurately.

Props iandunn.
See #40702.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-18 07:31:43 +00:00
Konstantin Obenland
71adf97a35 Upgrade: Use correct commit no. to trigger upgrade
Props iandunn.
See [40607], #40702.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-17 22:03:46 +00:00
Weston Ruter
764d8b521f Media: Trim whitespace in URLs provided for external embeds.
Also avoid showing error notice in media widget when URL field is empty.

Props timmydcrawford, westonruter.
Fixes #40771.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-17 01:59:42 +00:00
Weston Ruter
509e706c13 Customize: Run a partial's fallback behavior (full refresh) when selective refresh fails due to a script error.
This ensures that 3rd-party scripts that users paste into Text widgets will gracefully recover and result in the expected preview.

See #27355.
Fixes #40658.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40629 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-17 00:01:40 +00:00
Pascal Birchler
8c7ea71edb Media: Simplify upload error message construction.
Built from https://develop.svn.wordpress.org/trunk@40736


git-svn-id: http://core.svn.wordpress.org/trunk@40594 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-16 17:58:41 +00:00
Aaron Campbell
38347d7c58 Add nonce for updating file system credentials.
Built from https://develop.svn.wordpress.org/trunk@40723


git-svn-id: http://core.svn.wordpress.org/trunk@40581 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-16 14:48:44 +00:00
Weston Ruter
4eb107cd52 Customize: Fix phpunit tests after [40704] due to logic inversion error.
Built from https://develop.svn.wordpress.org/trunk@40716


git-svn-id: http://core.svn.wordpress.org/trunk@40579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-16 14:34:42 +00:00
Dominik Schilling
3d10fef22d Customize: Igore invalid customization sessions.
Built from https://develop.svn.wordpress.org/trunk@40704


git-svn-id: http://core.svn.wordpress.org/trunk@40567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-16 12:07:43 +00:00
Pascal Birchler
3d95e3ae81 Adjust post meta checks
Built from https://develop.svn.wordpress.org/trunk@40692


git-svn-id: http://core.svn.wordpress.org/trunk@40555 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-16 08:46:42 +00:00
Pascal Birchler
76d77e927b Improve redirect handling
Built from https://develop.svn.wordpress.org/trunk@40689


git-svn-id: http://core.svn.wordpress.org/trunk@40552 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-16 08:38:42 +00:00
Pascal Birchler
e88a48a066 Whitelist post arguments in XML-RPC
Built from https://develop.svn.wordpress.org/trunk@40677


git-svn-id: http://core.svn.wordpress.org/trunk@40540 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-16 08:09:42 +00:00
Weston Ruter
d8f94986b2 Customize: Keep alive auto-drafts created for page/post stubs when parent changeset is updated, and delete when changeset is garbage-collected.
Props utkarshpatel, westonruter.
See #31089.
Fixes #39715.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40539 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-16 05:37:44 +00:00
Weston Ruter
7f008a21de Widgets: Add missing wp-editor-area CSS class for textarea in the TinyMCE-extended Text widget to ensure proper styles are applied.
Removes extra border around TinyMCE-wrapped `textarea` and removes gap at bottom due to lack of `display:block`.

Props johnjamesjacoby, westonruter.
See #35243.
Fixes #40755.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40538 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-16 00:11:41 +00:00
Weston Ruter
5e67d6d81f Widgets: Remove image sizes generated during media widget phpunit tests from being version controlled.
Amends [40640].
See #32417.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40537 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-15 22:59:42 +00:00
Weston Ruter
97e376ca39 Widgets: Ensure return value of widget_text filter is not dropped but passed into widget_text_content filter for rendering.
Amends [40631].
Props vijustin, swissspidy, westonruter.
See #35243.
Fixes #40772.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40536 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-15 22:36:41 +00:00
Mel Choyce
66d3a486f6 Plugins: Fix plugin name display on Chrome 58 and above.
On Chrome 58 and above, plugin names within the plugin details modal were collapsed down into an ellipsis. This fix rewrites the CSS to make sure the titles are always shown.

Props mrwweb, afercia, Presskopp.
Fixes #40579.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-15 20:13:42 +00:00
Weston Ruter
9cb2cbc26f Customize: Fix alignment of natural-width media buttons in site icon control.
Amends [40653].
Props afercia.
Fixes #40220.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-15 18:51:41 +00:00
Weston Ruter
8a29b28a98 Widgets: Prevent image title attribute from being populated from attachment title by default upon selection.
Props westonruter, timmydcrawford.
See #39993.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-15 18:42:44 +00:00
Konstantin Obenland
68588821c3 Dashboard: Community events formatting improvements
Props Soean.
See #40702.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-15 09:44:43 +00:00
Rachel Baker
580cf33c81 Taxonomy: Remove extraneous ' included in Term delete markup.
Unmatched single quotation mark after the delete link href was introduced in r40655.

Props Chouby.
Fixes #9777.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-14 19:50:44 +00:00
Rachel Baker
195b227357 Formatting: Increase minimum characters allowed in is_email() to 6.
Brings the minimum characters expected for a valid email address to six, which matches the expectations in `wp_handle_comment_submission()` and REST API email arguments.

Props rmccue, lukecavanagh, rachelbaker, desrosj, sudar.
Fixes #38708.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-14 04:20:43 +00:00
Rachel Baker
9c2f5c18ce Comments: Correct the $post_id parameter passed to the 'comments_open' and 'pings_open' filters.
Fixes bug where previously the `$post_id` function argument was passed to the '_open' filters, instead of the result of the `get_post()` call. If the current post is not found, the `$post_id` filter parameter will be 0.

Props johnbillion, shulard, rachelbaker.
Fixes #40286.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40529 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-14 03:50:42 +00:00
Peter Wilson
62de6cc7ec Menus: Prevent empty class attribute following [40537].
Prevents an empty class attribute, `class=""`, from appearing in the HTML if a developer removes all classes using the `nav_menu_submenu_css_class` filter.

Props Kopepasah.
Fixes #36163.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-14 03:38:48 +00:00
Rachel Baker
868312d995 Comments: Update arguments passed to the 'comment_text' filter in check_comment().
Pass null or empty values for the missing $comment and $args parameters of the 'check_comment' filter in `check_comment()`.

Props boonebgorges, vaishu.agola27, SergeyBiryukov.
Fixes #38314. 

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


git-svn-id: http://core.svn.wordpress.org/trunk@40527 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-14 03:06:45 +00:00
Andrew Ozz
48339ed3d2 Bump version after beta-1
Built from https://develop.svn.wordpress.org/trunk@40663


git-svn-id: http://core.svn.wordpress.org/trunk@40526 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-13 00:21:41 +00:00
Andrew Ozz
28f2840bcb Bump version, beta-1
Built from https://develop.svn.wordpress.org/trunk@40662


git-svn-id: http://core.svn.wordpress.org/trunk@40525 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-12 23:17:45 +00:00
Andrew Ozz
964c0710f0 Revert [40256] for now as some tests are failing in some environments.
See #20383.
Built from https://develop.svn.wordpress.org/trunk@40661


git-svn-id: http://core.svn.wordpress.org/trunk@40524 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-12 22:50:41 +00:00
Weston Ruter
3ce794812d Widgets: Fix deferred rendering of controls for media widgets until container element fully expands.
Adds omitted call to `renderWhenAnimationDone()` which was missed when this code was copied from the Text widget.

Amends [40656].
See #40750.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40523 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-12 22:01:42 +00:00
Adam Silverstein
498613ccd7 Media: Fix improper use of jQuery hasClass method.
The jQuery `hasClass` method accepts a class name without a prefix '.' (period). Remove an errant class name with a '.' in `wp-mediaelement.js` that broke the selector in certain circumstances.

Props kostasx, Presskopp.
Fixes #40354.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-12 20:53:45 +00:00
Adam Silverstein
8b60430aee Customizer: Fix an issue with menu classes in the customizer preview.
In customizer preview, strip changeset uuid in menu urls before comparing with current url to determine menu item classes.

In the customizer, menu items now contain a changeset uuid as part of their urls. Strip the changeset uuid off the url before comparing with current url (which lacks the changeset uuid).

Props priyankabehera155, jipmoors.
Fixes #39758.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40521 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-12 20:35:43 +00:00
Adam Silverstein
cb2eac9e06 Users: Update name in toolbar when changing user display name.
When changing the user name in Users -> Your Profile, update the name displayed in the toolbar dynamically using JavaScript.

Props menakas, lukecavanagh, maguiar.
Fixes #40342.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40520 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-12 20:06:42 +00:00
Weston Ruter
020ffded1a Widgets: Defer rendering controls for media widgets until container element fully expands.
Fixes issue with MediaElement.js failing to build the player in an animating container that doesn't have established dimensions.
Also utilizes MediaElement.js for the video widget instead of using a native player.

See #32417.
Fixes #40750.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40519 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-12 19:56:43 +00:00
Adam Silverstein
d1ec180619 Taxonomy: Add a "delete" button on term edit page.
Add a 'delete' link next to the update button on the term edit screen so you can delete a term while you are reviewing it's details. 

Props cklosows, bradt, ocean90, johnbillion, DrewAPicture, ryan, MatheusGimenez, maguiar.
Fixes #9777.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-12 19:26:41 +00:00
Andrew Ozz
6f4a1049a8 TinyMCE: do not override line-height for paragraphs and headings in 4.6+, makes them hard to read.
Fixes #40743.
Built from https://develop.svn.wordpress.org/trunk@40654


git-svn-id: http://core.svn.wordpress.org/trunk@40517 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-12 18:06:40 +00:00
Andrea Fercia
705ecf3312 Customize: Make the media control buttons natural-width.
Natural-width buttons are better for translations, and don't feel as
overpowering as the half-width (and full-width) buttons.

Props melchoyce, timmydcrawford, afercia.
Fixes #40220.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-12 17:50:44 +00:00
Andrea Fercia
430422b0b7 Login and Registration: Add a filter to disable the initial auto-focus on the login screen.
Fixes #40301.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-12 17:12:46 +00:00
Konstantin Obenland
7328d561b1 Dashboard: Persist location for community events
Fixes a bug where cached events & location data was not accessible because the
cache key could not be regenerated without latitude and longitude information.

Discovered and fixed during #wcber contributor day.

Props soean, kubik-rubik, obenland.
See #40702.
 

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


git-svn-id: http://core.svn.wordpress.org/trunk@40514 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-12 15:53:46 +00:00
Joe McGill
2b206fa18d Improve wording of the AYS warning when permanently deleting uploads, tags, posts.
This is a follow up on [40283], which cleans up the wording.

Props azaozz, swissspidy, ocean90.
Fixes #39712.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-12 12:50:42 +00:00
Dominik Schilling
b43250116f Import: Replace assert() calls with PHPUnit's assertTrue() method.
Calling `assert()` with a string argument will be deprecated in PHP 7.2.

See #40109.
Built from https://develop.svn.wordpress.org/trunk@40649


git-svn-id: http://core.svn.wordpress.org/trunk@40512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-12 07:38:41 +00:00
Andrea Fercia
8a07db035d Add missing semicolons after [40646].
See #40453.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40511 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-12 07:05:41 +00:00
Andrea Fercia
55b6ee7e56 Media: Clean-up some MediaElementJS CSS: no more needed after [40642].
See #40707, #32417, #39994, #39995, #30281.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40510 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-12 07:00:45 +00:00
Andrea Fercia
bab7eb143e Accessibility: Change the "Show details" links in the update core screen to buttons.
These controls toggle the visibility of the update progress: they perform an action
therefore they should be buttons. Also:
- uses `aria-expanded` to communicate the toggle button state
- removes some inline JavaScript
- when clicking the toggle buttons, the progress details get moved with JavaScript after the button: this helps users of assistive technologies in finding them and makes the UI a bit more intuitive

Props Cheffheid, afercia.
See #26504.
Fixes #40453.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40507 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 23:50:41 +00:00
Andrew Ozz
8c46657c9d TinyMCE: update to 4.6.1. Changelog: https://www.tinymce.com/docs/changelog/#version461-may102017
Fixes #40727.
Built from https://develop.svn.wordpress.org/trunk@40645


git-svn-id: http://core.svn.wordpress.org/trunk@40506 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 23:12:40 +00:00
Andrew Ozz
da92cce494 TinyMCE: prevent removing of the temp link element when opening the advanced link dialog to insert new link.
Part props figureone for finding the cause.
Fixes #40558.
Built from https://develop.svn.wordpress.org/trunk@40644


git-svn-id: http://core.svn.wordpress.org/trunk@40505 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 23:04:40 +00:00
Andrea Fercia
274596b8ef Accessibility: Add "(opens in a new window)" screen reader text to the "News-Nearby Events" dashboard widget footer links.
- standardizes similar messages in core to always use `(opens in a new window)`
- adds translators comments
- hides the dashicons with `aria-hidden="true"`, see #40428

Fixes #40733.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40504 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 22:47:41 +00:00
Andrea Fercia
691d649329 Media: Remove the custom styling for the MediaElementJS controls offscreen text.
This offscreen text is not meant to be revealed on focus and just acts as fallback
for assistive technologies that don't support `aria-label` and `role="slider"`.
Also, revealing it on focus has proven over time to be very fragile and to cause
unexpected layout issues.

See #30281.
Fixes #40707.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40503 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 22:29:42 +00:00
Weston Ruter
26a5058f43 Widgets: Utilize WP REST API oEmbed proxy endpoint in media widgets.
Props timmydcrawford.
See #32417, #40450.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40502 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 21:24:42 +00:00
Weston Ruter
31d4d81039 Widgets: Introduce media widgets for images, audio, and video with extensible base for additional media widgets in the future.
The last time a new widget was introduced, Vuvuzelas were a thing, Angry Birds started taking over phones, and WordPress stopped shipping with Kubrick. Seven years and 17 releases without new widgets have been enough, time to spice up your sidebar!

Props westonruter, melchoyce, obenland, timmydcrawford, adamsilverstein, gonom9, wonderboymusic, Fab1en, DrewAPicture, sirbrillig, joen, matias, samikeijonen, afercia, celloexpressions, designsimply, michelleweber, ranh, kjellr, karmatosed.
Fixes #32417, #39993, #39994, #39995.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40501 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 21:11:44 +00:00
Pascal Birchler
763f09fb7e Upgrade/Install: After [40638], make sure wp_is_file_mod_allowed() actually returns the right value.
See #38673.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40500 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 19:54:43 +00:00
Pascal Birchler
33047ba14e Upgrade/Install: After [40394], rename wp_disallow_file_mods() to wp_is_file_mod_allowed().
This makes it more clear what this function is about.

Props Mte90.
Fixes #38673.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40499 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 19:24:41 +00:00
Dominik Schilling
77858f4b92 KSES: Support 'tag' => true as a shorthand for 'tag' => array() in wp_kses_attr().
`Automatic_Upgrader_Skin::feedback()` had always assumed that this is already the case, now it is.

See #20017.
Fixes #40680.
Built from https://develop.svn.wordpress.org/trunk@40637


git-svn-id: http://core.svn.wordpress.org/trunk@40498 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 19:23:43 +00:00
Pascal Birchler
9af735e863 Themes: Avoid PHP warnings in the admin when no theme directory exists.
Props iseulde, chris_dev, swissspidy.
Fixes #35521.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40497 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 19:21:44 +00:00
Pascal Birchler
0b1e3a05f7 Posts, Post Types: Add initial tests for get_post_type_labels().
See #38218.
Fixes #38157.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40496 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 19:19:42 +00:00
Pascal Birchler
fc1350ebe5 Administration: Ensure validateForm also validates other input fields.
With this change, textareas and select inputs will be checked as well.

Props shadyvb.
Fixes #37540.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40495 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 19:18:42 +00:00
Dominik Schilling
0cd74a6d6e Plugins: Don't strip line breaks and blockquote elements in the plugin information modal.
Fixes #40679.
Built from https://develop.svn.wordpress.org/trunk@40633


git-svn-id: http://core.svn.wordpress.org/trunk@40494 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 19:16:42 +00:00
Pascal Birchler
c000e99d6f Mail: Ensure entities are decoded in email change notifications on Multisite.
Adds new tests to ensure this bug does not pop up again.

Props stephenharris.
Fixes #40015.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 19:15:44 +00:00
Weston Ruter
40ebb188cd Widgets: Extend the Text widget with TinyMCE.
Introduces rich text formatting: bold, italic, lists, links.

Props westonruter, azaozz, timmydcrawford, obenland, melchoyce.
See #35760.
Fixes #35243.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40492 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 18:55:43 +00:00
James Nylen
8561cb0516 REST API: Update wp-api.js fixtures after string changes.
See #39178.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40491 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 18:41:41 +00:00
James Nylen
ace96e26aa REST API: Tests: Remove and prohibit errors when generating wp-api.js fixtures.
During a PHPUnit test suite run, a file named `wp-api-generated.js` is created which contains some response objects that serve as fixtures for the `wp-api.js` client unit tests.

Previously, some of these API responses were actually error objects, which isn't what we want for testing.  This commit fixes the existing error responses and prevents this situation in the future.

Fixes #40734.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40490 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 18:32:43 +00:00
James Nylen
589c4b4b2d REST API: Add endpoint for proxying requests to external oEmbed providers.
This endpoint is a prerequisite for the media widgets work (see https://github.com/xwp/wp-core-media-widgets).

Also use the new endpoint in the media modal instead of the `parse-embed` AJAX action.

Props westonruter, timmydcrawford, swissspidy, jnylen0.
Fixes #40450.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40489 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 18:18:46 +00:00
Weston Ruter
2353930f90 Customize: Wait for processing state to clear before starting to captureSettingModifiedDuringSave.
See #32941.
Fixes #40729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40488 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 06:42:43 +00:00
Peter Wilson
746edb23f2 Emoji: Update Twemoji to version 2.2.5
Updates Twemoji and adds a second Emoji 4 test to include a shrugging man. Emoji 4 is being implemented gradually, while some browsers now support the female technologist, the indifferent shrugging man is breaking things with his presence.

Props peterwilsoncc, pento for code review.
Fixes #40615.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40487 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 04:26:41 +00:00
Andrew Ozz
57ef33fa2a Editor: manually trigger change event when text is modified from JS.
Props westonruter.
Fixes #40726.
Built from https://develop.svn.wordpress.org/trunk@40615


git-svn-id: http://core.svn.wordpress.org/trunk@40485 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 00:29:41 +00:00
Gary Pendergast
59c721dda0 Build/Test: Revert that failing test.
Now that Travis has confirmed that it is sending messages to Slack when a test fails, we no longer need a failing test.

The failing test added in [40613] is reverted, as Travis has failed to fail at notifying us about failing tests.

See #40712.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40484 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 00:16:41 +00:00
Gary Pendergast
33e2f5fe9a Build/Test: Add an intentionally failing test.
To ensure that Travis is sending messages to Slack, a test needs to fail, so here's a failing test.

This failing test (and no other failing tests) will be reverted once Travis confirms that it isn't failing to message Slack about failing tests.

See #40712.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40483 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-10 23:37:43 +00:00
Felix Arntz
0f4725a0e3 Multisite: Adjust site count of the correct network after having created a new site.
Prior to this change, after creating a site, the network site count was always refreshed on the current network, regardless of whether the site was created on a different network. With the recent changes, particularly [40591], it is now possible to update the site count for a specific `$network_id`, so this changeset makes use of the new parameter.

Fixes #38699.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40482 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-10 23:22:42 +00:00
Felix Arntz
5310efaf61 Multisite: Fix usage of incorrect site_count network option name in unit tests.
The unit tests introduced as part of [40486] used the wrong `site_count` network option name instead of `blog_count`. This did not cause actual issues in the tests, but deleting the option was supposed to verify that it is properly recreated afterwards. The usage of the wrong name made these tests less useful, so this changeset fixes it.

Fixes #40725.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40481 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-10 23:13:41 +00:00
Felix Arntz
051f291861 Multisite: Fix unstable unit test for get_blog_count().
The unit test introduced in [40370] used the strict `assertSame()` check while comparison a count with the value of an option, which under most conditions is not an integer. While the test passed on some setups, it failed on others. This changeset ensures that `assertEquals()` is used to make the test stable.

Fixes #40724.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40480 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-10 23:03:43 +00:00
Peter Wilson
6c23b4750c Emoji: Clear canvas between flag tests.
Clear the canvas following the two flag tests following [40582].

Fixes #40616.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40479 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-10 22:44:40 +00:00
Weston Ruter
7349c22b73 Customize: Fix clearing of fresh_site option flag when editing sidebars on widgets admin screen.
Amends [38991].
See #38114, #38533.
Fixes #40722.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40478 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-10 21:25:41 +00:00
Andrew Ozz
b952bf4eae Dashboard: Update the existing WordPress News dashboard widget to also include upcoming meetup events and WordCamps near the current user’s location.
Props @afercia, @andreamiddleton, @azaozz, @camikaos, @coreymckrill, @chanthaboune, @courtneypk, @dd32, @iandunn, @iseulde, @mapk, @mayukojpn, @melchoyce, @nao, @obenland, @pento, @samuelsidler, @stephdau, @tellyworth.
See #40702.
Built from https://develop.svn.wordpress.org/trunk@40607


git-svn-id: http://core.svn.wordpress.org/trunk@40477 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-10 20:04:42 +00:00
James Nylen
802c923873 REST API: Improve a few more strings added after the 4.7 string freeze.
See #39178.

See also #40720 for potential follow-up steps.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40476 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-10 19:41:41 +00:00
James Nylen
7d337c1327 REST API: Add author, modified, and parent sort order options for posts.
These (and a few others that can be revisited later if needed) were present in
beta versions of the WP REST API but were removed during the merge to WP 4.7.

Props ChopinBach, jnylen0.
Fixes #38693.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40475 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-10 18:52:44 +00:00
Gary Pendergast
30bdd11fd5 Build/Test: Post Travis results to Slack from WordPress/wordpress-develop
Now that the `WordPress/wordpress-develop` GitHub repo is syncing correctly, we can use it for Travis integration.

Props jorbin for getting the ball rolling so long ago, unprops jorbin because his Travis build can finally be retired.

Fixes #40712.


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


git-svn-id: http://core.svn.wordpress.org/trunk@40474 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-10 10:29:44 +00:00
Ryan McCue
3ecfb4b222 Options/Meta: Document valid types for registration.
In 4.7, the REST API introduced types for options and meta passed into the registration functions. This adds the documentation for those types.

Props iandunn, priyankabehera155.
Fixes #40318.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40473 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-10 06:10:43 +00:00
Ryan McCue
131518542e REST API: Include featured_media in embed responses.
Props kadamwhite, jnylen0, westonruter.
Fixes #39805.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40472 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-10 04:46:43 +00:00
Ryan McCue
ba94bd62a0 REST API: Set global $post when preparing revisions.
For compatibility with filters on hooks on content filters (such as shortcodes), we need to set the global. This mirrors the Posts controller.

Props pdufour, jnylen0.
Fixes #40626.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40471 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-10 04:32:39 +00:00
Ryan McCue
027e8d9218 REST API: Allow "Origin: null" from file: URLs.
Browsers send an "Origin: null" header value for file and data URLs, as they can be generated by any document, and their origin is not guaranteed. Since we want to allow any URL to access the API (intentionally disabling the CORS protections), we need to special-case the non-URL "null" value.

Props joehoyle.
Fixes #40011.

Built from https://develop.svn.wordpress.org/trunk@40600


git-svn-id: http://core.svn.wordpress.org/trunk@40470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-10 04:22:43 +00:00
Andrew Ozz
19ed296008 Editor: Update wp.editor.remove() to use the new Quicktags instance removep().
Fixes: #35760
Built from https://develop.svn.wordpress.org/trunk@40599


git-svn-id: http://core.svn.wordpress.org/trunk@40469 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-10 02:50:44 +00:00
Andrew Ozz
0b2f789e93 Editor: Add init and remove methods to Quicktags.
Props helgatheviking azaozz.
Fixes #26183 #40708.
Built from https://develop.svn.wordpress.org/trunk@40598


git-svn-id: http://core.svn.wordpress.org/trunk@40468 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-10 02:47:42 +00:00
Mike Schroder
391145df30 Media: Optionally return attachment id from media_sideload_image().
Introduces option to `$return` parameter to return the attachment id created after a successful image sideload.

Props slbmeh, kawauso, alexkingorg, SergeyBiryukov, georgestephanis, DrewAPicture, nacin, trepmal, mattheu, kraftbj, whyisjake, dotancohen, MrGregWaugh, danielbachhuber.
Fixes #19629.
Built from https://develop.svn.wordpress.org/trunk@40597


git-svn-id: http://core.svn.wordpress.org/trunk@40467 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-09 23:26:42 +00:00
Felix Arntz
d5ae7e682e Multisite: Fix filter hooks for the updating network count functions.
[40591] and [40593] introduced a `$network_id` parameter for `wp_maybe_update_network_site_counts()` and `wp_maybe_update_network_user_counts()`, as well as [40486] previously added it to `wp_update_network_counts()`. This changeset ensures the filter hooks in `ms-default-filters.php` do not pass any parameter to them that might conflict with their actual `$network_id` parameter, which caused unit test failures before.

Fixes #40703.

Built from https://develop.svn.wordpress.org/trunk@40596


git-svn-id: http://core.svn.wordpress.org/trunk@40466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-09 17:15:43 +00:00
Jeremy Felt
5b3d397133 Multisite: Check only valid looking emails against banned domain list.
If an email address is missing an `@`, we can't assume enough to check it against a list of domain names.

Additional validation of email should happen in `is_email()` before being passed to `is_email_address_unsafe()`.

Fixes #39915.

Built from https://develop.svn.wordpress.org/trunk@40595


git-svn-id: http://core.svn.wordpress.org/trunk@40465 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-09 16:55:40 +00:00
Jeremy Felt
3600dc562e Multisite: Validate email before checking against banned domains.
Previously, an invalid email could result in an undefined index when attempting to determine the email domain.

Props ocean90.
See #39915.

Built from https://develop.svn.wordpress.org/trunk@40594


git-svn-id: http://core.svn.wordpress.org/trunk@40464 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-09 16:33:46 +00:00
Felix Arntz
d92dbd24fc Multisite: Add $network_id parameter to wp_maybe_update_network_user_counts().
This allows calling the function for a specific network correctly, for example after a user has been created for it or been removed from it.

Fixes #40385. See #38699.

Built from https://develop.svn.wordpress.org/trunk@40593


git-svn-id: http://core.svn.wordpress.org/trunk@40463 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-09 16:08:43 +00:00
Felix Arntz
314f2aecec Multisite: Add missing documentation for new $network_id parameter of wp_maybe_update_network_site_counts().
This was overlooked in [40591].

See #40384.

Built from https://develop.svn.wordpress.org/trunk@40592


git-svn-id: http://core.svn.wordpress.org/trunk@40462 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-09 16:02:46 +00:00
Felix Arntz
93b8b9bb4e Multisite: Add $network_id parameter to wp_maybe_update_network_site_counts().
This allows calling the function for a specific network correctly, for example after a site has been created for it or been removed from it.

Fixes #40384. See #38699.

Built from https://develop.svn.wordpress.org/trunk@40591


git-svn-id: http://core.svn.wordpress.org/trunk@40461 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-09 16:00:44 +00:00
Felix Arntz
039d49a68a Multisite: Add $network_id parameter to wp_is_large_network().
Now that `get_blog_count()` and `get_user_count()` both support passing a `$network_id` parameter (see [40370] and [40371]), similar functionality is now available for `wp_is_large_network()`. In addition, the filter `wp_is_large_network` now accepts the network ID as its fourth parameter.

This changeset furthermore introduces unit tests for the `wp_is_large_network()` function and its filter.

Fixes #40489.

Built from https://develop.svn.wordpress.org/trunk@40590


git-svn-id: http://core.svn.wordpress.org/trunk@40460 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-09 15:51:47 +00:00
Felix Arntz
a3797875bf Multisite: Introduce minimum_site_name_length filter.
Prior to this change, the minimum site name length checked in `wpmu_validate_blog_signup()` was set to a fixed value of 4. The new filter allows tweaking this value, as there may be cases where shorter site names may be required.

Fixes #39676.

Built from https://develop.svn.wordpress.org/trunk@40589


git-svn-id: http://core.svn.wordpress.org/trunk@40459 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-09 14:59:47 +00:00
Andrew Ozz
cbf3b2cff5 Editor: Add wp.editor.remove() for editors that were dynamically instantiated from JS.
Fixes: #35760
Built from https://develop.svn.wordpress.org/trunk@40588


git-svn-id: http://core.svn.wordpress.org/trunk@40458 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-09 03:41:42 +00:00
Andrew Ozz
ec622956c8 TinyMCE: improve adding of custom UI to the MCE Factory.
Props iseulde.
Fixes #40690.
Built from https://develop.svn.wordpress.org/trunk@40587


git-svn-id: http://core.svn.wordpress.org/trunk@40457 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-09 01:40:46 +00:00
Andrea Fercia
cc9d3cfbb3 Themes: Fix missing search field in the Theme Install screen after [40572].
Props desrosj, cristianozanca for reporting.
Fixes #34881.

Built from https://develop.svn.wordpress.org/trunk@40586


git-svn-id: http://core.svn.wordpress.org/trunk@40456 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-08 15:59:44 +00:00
Andrew Ozz
d7c32f6937 Fix linting errors in tinymce-obsolete.js.
See #40690.
Built from https://develop.svn.wordpress.org/trunk@40585


git-svn-id: http://core.svn.wordpress.org/trunk@40455 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-08 06:06:42 +00:00
Andrew Ozz
122cf8b8d3 TinyMCE: remove the pre-4.6.0 tests. Move regression testing for obsolete tags and attributes to the default QUnit tests.
See #40690.
Built from https://develop.svn.wordpress.org/trunk@40584


git-svn-id: http://core.svn.wordpress.org/trunk@40454 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-08 05:37:14 +00:00
Andrew Ozz
dd0d110520 TinyMCE: update to 4.6.0. Has many new features and bug fixes, changelog: https://www.tinymce.com/docs/changelog/#version460-may42017.
Fixes #40690.
Built from https://develop.svn.wordpress.org/trunk@40583


git-svn-id: http://core.svn.wordpress.org/trunk@40453 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-08 05:32:46 +00:00
Gary Pendergast
1b85aa404d Emoji: Make the UN flag test more accurate.
Previously, the UN flag test relied on the image being produced to be quite small. Unfortunately, the Chrome PNG encoder seems to have changed recently, and it now produces a relatively large image.

For a better test, we can compare the rendering of [U] + [N] against [U] + zero width space + [N].

Fixes #40616.


Built from https://develop.svn.wordpress.org/trunk@40582


git-svn-id: http://core.svn.wordpress.org/trunk@40452 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-08 05:04:52 +00:00
John Blackbourn
127abe718b Users: Correct a permission check when showing the User item in the + New admin toolbar menu.
Props dlh
Fixes #39252

Built from https://develop.svn.wordpress.org/trunk@40581


git-svn-id: http://core.svn.wordpress.org/trunk@40451 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-07 17:42:45 +00:00
John Blackbourn
9c7c11f268 Users: Clear the user settings cookies when clearing auth cookies.
This prevents lingering cookies when logging out and when switching between user accounts.

Props soulseekah, shanee
Fixes #32567

Built from https://develop.svn.wordpress.org/trunk@40580


git-svn-id: http://core.svn.wordpress.org/trunk@40450 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-07 16:54:42 +00:00
Andrea Fercia
98402b7c15 Administration: Restore missing spinner when installing a new language.
Fixes #40478.

Built from https://develop.svn.wordpress.org/trunk@40579


git-svn-id: http://core.svn.wordpress.org/trunk@40449 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-07 12:01:42 +00:00
Andrea Fercia
fe96a729a0 Accessibility: Make the Get Shortlink button be a real button.
Worth noting, as of WordPress 4.4, the Get Shortlink button is hidden by default
but it can be restored via filters.

Props Cheffheid.
See #26504.
Fixes #40448.

Built from https://develop.svn.wordpress.org/trunk@40578


git-svn-id: http://core.svn.wordpress.org/trunk@40448 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-07 11:47:41 +00:00
Joe Hoyle
b0a327cf3c REST API: WP_REST_Request::remove_header() should canonicalize header names.
When headers are stored in WP_REST_Request internally they are canonicalized. This step already happens on setting / getting headers in any way, but was missed when implementing remove_header().

Props TimothyBlynJacobs.
Fixes #40347.

Built from https://develop.svn.wordpress.org/trunk@40577


git-svn-id: http://core.svn.wordpress.org/trunk@40447 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-07 04:09:41 +00:00
Pascal Birchler
7fd55738be Administration: Remove unit and prefixed version from a CSS declaration.
The prefixed version gets added by Autoprefixer already.

Props MatheusFD.
Fixes #35358.

Built from https://develop.svn.wordpress.org/trunk@40576


git-svn-id: http://core.svn.wordpress.org/trunk@40446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-06 14:37:44 +00:00
Pascal Birchler
064e62cbea Cron API: Add a new wp_doing_cron() helper function.
This replaces `DOING_CRON` checks via the constant.

Props tfrommen.
Fixes #39591.

Built from https://develop.svn.wordpress.org/trunk@40575


git-svn-id: http://core.svn.wordpress.org/trunk@40445 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-06 14:30:40 +00:00
Pascal Birchler
e1d5fd1c6b Embeds: Add screencast.com to oEmbed provider whitelist.
Props ENDif Media.
Fixes #38367.

Built from https://develop.svn.wordpress.org/trunk@40574


git-svn-id: http://core.svn.wordpress.org/trunk@40444 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-06 14:25:45 +00:00
Andrea Fercia
88e515fac0 Accessibility: Improve the suggested image size text in the media views.
Adds `pixels` as unit, avoiding abbreviation for a clearer pronunciation by screen
readers. Also, adds the word `by` instead of the special character `times`.

Props Presskopp, stormrockwell.
Fixes #38932.

Built from https://develop.svn.wordpress.org/trunk@40573


git-svn-id: http://core.svn.wordpress.org/trunk@40443 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-05 23:29:44 +00:00
Andrea Fercia
471f1e7201 Accessibility: Wrap the installed themes search field within a form element.
Valid code is important not just to formally meet the specification, but also to
ensure user agents, including assistive technologies, can accurately interpret
and parse content. When HTML elements are not used in the recommended way,
user agents may render them in unexpected ways. It can also become a problem for
compatibility with older or even future browsers, devices, or other software.
See W3C WCAG 4.1.1.

Props takayukister, aryamaaru.
Fixes #34881.

Built from https://develop.svn.wordpress.org/trunk@40572


git-svn-id: http://core.svn.wordpress.org/trunk@40442 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-05 19:02:45 +00:00
Adam Silverstein
428afdaa5a REST API: Improve strings added after 4.7 string freeze.
Clarify the `rest_orderby_include_missing_include` error message.

Props PranaliPatel.
Fixes #39178.

Built from https://develop.svn.wordpress.org/trunk@40571


git-svn-id: http://core.svn.wordpress.org/trunk@40441 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-05 18:49:47 +00:00
Andrea Fercia
3dab32af54 Accessibility: Improve the color contrast ratio of the dismiss notice buttons.
Props chris_dev.
Fixes #39970.

Built from https://develop.svn.wordpress.org/trunk@40570


git-svn-id: http://core.svn.wordpress.org/trunk@40440 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-04 22:32:46 +00:00
Andrea Fercia
3c7698808f Customize: Fix a visual glitch on the widget control animation introduced in [40480].
Also, restores the original design intent that was meant to "compact widget-tops
on smaller laptops, but not tablets".

See #27112.
Fixes #31476.

Built from https://develop.svn.wordpress.org/trunk@40569


git-svn-id: http://core.svn.wordpress.org/trunk@40439 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-03 22:39:44 +00:00
Andrea Fercia
1ca3b70929 Accessibility: Avoid a keyboard trap on the date and time custom format settings.
Using the `focus` event on the date and time custom format fields made impossible
to navigate through all the form fields using only the keyboard without actually
selecting the custom format setting. Instead, using `click` and `input` preserves
the original functionality when using any kind of pointing or input device.

Fixes #40515.

Built from https://develop.svn.wordpress.org/trunk@40568


git-svn-id: http://core.svn.wordpress.org/trunk@40436 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-02 20:03:42 +00:00
Weston Ruter
91a8af0ef6 Customize: Allow select dropdowns to stretch full width in widened controls pane.
Props timmydcrawford.
Amends [40511].
Fixes #32296.

Built from https://develop.svn.wordpress.org/trunk@40567


git-svn-id: http://core.svn.wordpress.org/trunk@40435 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-02 19:30:46 +00:00
Sergey Biryukov
4995062686 Menus: Introduce page_menu_link_attributes filter in Walker_Page::start_el() for the HTML attributes applied to a page menu item's anchor element.
This complements the `nav_menu_link_attributes` filter used in `Walker_Nav_Menu::start_el()`.

Props pbiron.
Fixes #40359.
Built from https://develop.svn.wordpress.org/trunk@40565


git-svn-id: http://core.svn.wordpress.org/trunk@40434 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-01 23:32:42 +00:00
John Blackbourn
42845bcb2d Build/Test Tools: Automatically skip tests in the ms-required and ms-excluded groups.
This removes the need to manually call `$this->skipWithMultisite()` and `$this->skipWithoutMultisite()` from within the test when the test only runs without Multisite or only runs on Multisite, respectively.

Props jdgrimes for the suggestion.

Fixes #40531

Built from https://develop.svn.wordpress.org/trunk@40564


git-svn-id: http://core.svn.wordpress.org/trunk@40433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-01 20:35:44 +00:00
John Blackbourn
282408b6c0 Users: Add two missing special cases to the capability tests for non-logged-in users.
Also updates a `expectedIncorrectUsage` notation.

See #37405

Built from https://develop.svn.wordpress.org/trunk@40563


git-svn-id: http://core.svn.wordpress.org/trunk@40432 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-01 16:19:44 +00:00
John Blackbourn
d24f1f5864 Build/Test Tools: Pin the WordPress Importer plugin to version 0.6.3 when testing on Travis.
Fixes #40620

Built from https://develop.svn.wordpress.org/trunk@40562


git-svn-id: http://core.svn.wordpress.org/trunk@40431 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-01 11:30:43 +00:00
John Blackbourn
d1647d0b8c Build/Test Tools: Add object-cache.php to the unit test suite.
This removes an unnecessary external dependency from the Travis tests.

Fixes #40619

Built from https://develop.svn.wordpress.org/trunk@40561


git-svn-id: http://core.svn.wordpress.org/trunk@40430 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-01 11:21:44 +00:00
John Blackbourn
eb4db0e19c Users: Ensure user counts remain accurate if users are added to or removed from the users table without corresponding usermeta entries being added or removed.
This has a slight performance impact on sites with a large number of users when the `time` strategy is used for counting users. Hopefully this impact will be negated by enhancements proposed in #38741.

Props psoluch, dots, boonebgorges, ptbello, tharsheblows

Fixes #29785

Built from https://develop.svn.wordpress.org/trunk@40560


git-svn-id: http://core.svn.wordpress.org/trunk@40429 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-30 13:03:41 +00:00
John Blackbourn
224b88ca42 Posts, Post Types: Revert [40558] pending investigation.
See #18375

Built from https://develop.svn.wordpress.org/trunk@40559


git-svn-id: http://core.svn.wordpress.org/trunk@40428 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-30 11:19:45 +00:00
John Blackbourn
53acb5b6d4 Posts, Post Types: Correct the attachment post type template unit test introduced in [38951].
Also adds additional assertions for the templates.

See #18375

Built from https://develop.svn.wordpress.org/trunk@40558


git-svn-id: http://core.svn.wordpress.org/trunk@40427 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-29 21:16:45 +00:00
Boone Gorges
fb0a08c8be Fix broken check_comment() test.
The test `Tests_Comment_CheckComment::test_should_return_true_when_content_does_not_match_moderation_keys()`
did not, in fact, test for a `true` value, but for a false one.
Switching to `assertTrue()` caused a failure, because the test comment
triggered the 'comment_moderation' test. As in other tests in the file,
the solution is to force 'comment_moderation' to 0 for the purposes of
the test.

Introduced in [32519].

Props stephdau.
Fixes #40584.
Built from https://develop.svn.wordpress.org/trunk@40557


git-svn-id: http://core.svn.wordpress.org/trunk@40426 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-27 16:23:47 +00:00
Andrea Fercia
f1be128cde Widgets: Improve the News dashboard widget no-js notice.
In the rare case this notice was displayed, it was unstyled. Uses the notice 
error style to make it prettier and consistent with other no-js notices.
Also, some CSS clean-up.

Fixes #40529.

Built from https://develop.svn.wordpress.org/trunk@40556


git-svn-id: http://core.svn.wordpress.org/trunk@40425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-25 16:42:44 +00:00
John Blackbourn
d3c74e8ce9 Feeds: Remove an incorrect usage of sizeof() in a helper class used during unit testing of XML element handling.
This also helps tidy up the test output when running PHP 7.2.

See #40109

Built from https://develop.svn.wordpress.org/trunk@40555


git-svn-id: http://core.svn.wordpress.org/trunk@40424 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-24 01:23:43 +00:00
John Blackbourn
89b358082e Build/Test Tools: Remove HHVM from the test infrastructure on Travis.
Fixes #40548

Built from https://develop.svn.wordpress.org/trunk@40546


git-svn-id: http://core.svn.wordpress.org/trunk@40422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-24 00:28:44 +00:00
John Blackbourn
79ca3ca178 REST API: Remove a useless unit test.
See #35907, #38373

Built from https://develop.svn.wordpress.org/trunk@40545


git-svn-id: http://core.svn.wordpress.org/trunk@40421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-23 22:20:41 +00:00
John Blackbourn
37aed623c0 Build/Test Tools: Remove more unnecessary test skipping when erroneous situations occur.
See #40533

Built from https://develop.svn.wordpress.org/trunk@40544


git-svn-id: http://core.svn.wordpress.org/trunk@40420 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-23 22:12:42 +00:00
John Blackbourn
1ad93e1db9 Build/Test Tools: Introduce skipWithoutMultisite() and skipWithMultisite() methods into the test suite.
This brings much needed uniformity to test skipping when a test requires Multisite or when a test should be excluded from running when Multisite is enabled.

Used in conjunction with the `@group ms-required` and `@group ms-excluded` notation, this removes a significant number of skipped tests from the default test suite run.

Fixes #40531

Built from https://develop.svn.wordpress.org/trunk@40543


git-svn-id: http://core.svn.wordpress.org/trunk@40419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-23 21:58:41 +00:00
John Blackbourn
29b3932430 Build/Test Tools: More tweaks to the deprecated calls assertion. This needs to be triggered when there are unexpected deprecated calls or wrongdoings too.
See #40538

Built from https://develop.svn.wordpress.org/trunk@40542


git-svn-id: http://core.svn.wordpress.org/trunk@40418 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-23 21:35:41 +00:00
John Blackbourn
0ec1f5aadf Build/Test Tools: Only perform an assertion for deprecated calls and wrongdoings if any are expected.
This avoids masking risky tests that don't otherwise perform an assertion.

See #40538

Built from https://develop.svn.wordpress.org/trunk@40541


git-svn-id: http://core.svn.wordpress.org/trunk@40417 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-23 21:29:43 +00:00
Sergey Biryukov
2e6e53d26f Help/About: Fix typo in help text on Reading Settings screen.
Props Arena94, bhargavbhandari90.
Fixes #40530.
Built from https://develop.svn.wordpress.org/trunk@40540


git-svn-id: http://core.svn.wordpress.org/trunk@40416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-23 14:34:42 +00:00
John Blackbourn
975d00bd54 Build/Test Tools: Move the setExpectedException() method into the WP_Ajax_UnitTestCase class to avoid a fatal error when PHPUnit 3.6 is in use.
This needs more investigation but it gets the test suite on PHP 5.2 passing again.

See #39822

Built from https://develop.svn.wordpress.org/trunk@40539


git-svn-id: http://core.svn.wordpress.org/trunk@40415 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-23 11:46:42 +00:00
John Blackbourn
36c977b9b1 Build/Test Tools: Add Composer files to the cache on Travis.
The Travis cache is specific to the branch and language version (PHP version), so this should speed up each subsequent build once the cache is primed.

Props netweb

Fixes #40539

Built from https://develop.svn.wordpress.org/trunk@40538


git-svn-id: http://core.svn.wordpress.org/trunk@40414 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-23 11:40:43 +00:00
Peter Wilson
717de16c68 Menus: Add filter to sub-menu class in nav menus.
Add new filter `nav_menu_submenu_css_class` to the `Walker_Nav_Menu::start_el()` method, allowing themers to modify the sub menu classes output by `wp_nav_menu()`.

Props: csloisel, darthaud, raisonon.
Fixes: #36163.

Built from https://develop.svn.wordpress.org/trunk@40537


git-svn-id: http://core.svn.wordpress.org/trunk@40413 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-23 07:16:43 +00:00
John Blackbourn
812ac18853 Build/Test Tools: Add support for PHPUnit 6+.
This adds a compatibility shim for the new namespaced structure of PHPUnit and the removed `setExpectedException()` method. In addition, this updates the Travis config so PHPUnit 6.1 is used where appropriate.

Props miyauchi, gitlost.

Fixes #39822

Built from https://develop.svn.wordpress.org/trunk@40536


git-svn-id: http://core.svn.wordpress.org/trunk@40412 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-23 02:06:40 +00:00
John Blackbourn
6bcec554c3 Build/Test Tools: Ensure that WP_UnitTestCase::expectedDeprecated() performs an assertion to avoid risky test notices.
See #40538

Built from https://develop.svn.wordpress.org/trunk@40535


git-svn-id: http://core.svn.wordpress.org/trunk@40411 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-23 01:45:43 +00:00
John Blackbourn
3b24784333 Build/Test Tools: Be strict about tests that do not test anything.
See #40538

Built from https://develop.svn.wordpress.org/trunk@40534


git-svn-id: http://core.svn.wordpress.org/trunk@40410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-23 01:25:42 +00:00
John Blackbourn
6e4b6591d8 Build/Test Tools: Remove unnecessary checks and skips that should instead cause failures if they ever fail.
See #40533

Built from https://develop.svn.wordpress.org/trunk@40533


git-svn-id: http://core.svn.wordpress.org/trunk@40409 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 22:55:40 +00:00
John Blackbourn
fe06ac7e39 Build/Test Tools: Convert more test skipping into hard failures. These dependencies should all be present when testing.
See #40533

Built from https://develop.svn.wordpress.org/trunk@40532


git-svn-id: http://core.svn.wordpress.org/trunk@40408 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 22:12:41 +00:00
John Blackbourn
f1fff0b06e Build/Test Tools: Convert more test skipping into hard failures. These dependencies should all be present when testing.
See #40533

Built from https://develop.svn.wordpress.org/trunk@40531


git-svn-id: http://core.svn.wordpress.org/trunk@40407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 22:01:42 +00:00
John Blackbourn
af587d874d Build/Test Tools: Correct an incorrect ms- group name.
See #40531

Built from https://develop.svn.wordpress.org/trunk@40530


git-svn-id: http://core.svn.wordpress.org/trunk@40406 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 21:44:42 +00:00
John Blackbourn
e76e3d459a Build/Test Tools: Partially revert [40524].
See #40533, #40535

Built from https://develop.svn.wordpress.org/trunk@40529


git-svn-id: http://core.svn.wordpress.org/trunk@40405 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 21:22:43 +00:00
John Blackbourn
69bb8fa5c9 Build/Test Tools: Add some locale debugging to the Travis config so we can determine which locales are available to test with.
See #40533, #19861

Built from https://develop.svn.wordpress.org/trunk@40528


git-svn-id: http://core.svn.wordpress.org/trunk@40404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 21:01:42 +00:00
John Blackbourn
ba88762aa3 Build/Test Tools: Enable verbose mode in PHPUnit so we can see which tests are being skipped, and now that the number of skipped tests has been lowered.
See #40533, #40531

Built from https://develop.svn.wordpress.org/trunk@40527


git-svn-id: http://core.svn.wordpress.org/trunk@40403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 20:25:39 +00:00
John Blackbourn
7696954d91 Build/Test Tools: Don't trigger a skipped test when the built version of wp-embed.min.js isn't present.
The grunt command assertion prior to the check for the existence of the file is enough to safeguard this test.

See #34698, #40533

Built from https://develop.svn.wordpress.org/trunk@40526


git-svn-id: http://core.svn.wordpress.org/trunk@40402 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 20:18:42 +00:00
John Blackbourn
0371277d5a Build/Test Tools: Replace test skipping with actual assertions when dealing with the DISALLOW_UNFILTERED_HTML, DISALLOW_FILE_MODS, and DISALLOW_FILE_EDIT constants.
If any of these constants are set during testing, they should cause the tests to fail, not to be skipped, otherwise we have a situation where failure conditions are never seen.

See #40533

Built from https://develop.svn.wordpress.org/trunk@40525


git-svn-id: http://core.svn.wordpress.org/trunk@40401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 20:13:42 +00:00
John Blackbourn
1cbc2c3857 Build/Test Tools: Remove more skipped tests that should actually be failures if their conditions aren't satisfied.
See #40533

Built from https://develop.svn.wordpress.org/trunk@40524


git-svn-id: http://core.svn.wordpress.org/trunk@40400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 19:43:41 +00:00
John Blackbourn
a0e67d3e16 Build/Test Tools: Remove ancient UT ticket handling.
See #40533

Built from https://develop.svn.wordpress.org/trunk@40523


git-svn-id: http://core.svn.wordpress.org/trunk@40399 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 19:39:43 +00:00
John Blackbourn
f12c419ee3 Build/Test Tools: Add some more tests to the ms-required and ms-excluded groups.
See #40531

Built from https://develop.svn.wordpress.org/trunk@40522


git-svn-id: http://core.svn.wordpress.org/trunk@40398 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 19:22:44 +00:00
John Blackbourn
af6c8d1bc6 Build/Test Tools: Remove a useless test.
See #33898, #40533

Built from https://develop.svn.wordpress.org/trunk@40521


git-svn-id: http://core.svn.wordpress.org/trunk@40397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 19:10:43 +00:00
John Blackbourn
17b73338f1 Build/Test Tools: Introduce ms-required and ms-excluded groups for tests.
Tests in the `ms-excluded` group are now excluded when running tests with multisite enabled, and tests in the `ms-required` group are excluded when running tests without multisite enabled. The end result is a significantly reduced number of skipped tests polluting PHPUnit's output, which means verbose mode can be used to more easily see which tests are skipped or incomplete, and why.

See #40531

Built from https://develop.svn.wordpress.org/trunk@40520


git-svn-id: http://core.svn.wordpress.org/trunk@40396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 18:59:41 +00:00
John Blackbourn
ed1d714572 Build/Test Tools: Don't skip tests when php.net or dev.mysql.com are unreachable.
This sort of behaviour subtly hides the fact that these tests will never fail if the URLs where version number information is fetched from go away for one reason or another.

See #40533

Built from https://develop.svn.wordpress.org/trunk@40519


git-svn-id: http://core.svn.wordpress.org/trunk@40395 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 18:45:40 +00:00
John Blackbourn
aa8f871f21 Build/Test Tools: Avoid skipping canonical tests that are connected to open Trac tickets.
This is a remnant of the test suite behaviour before #30284 fixed most of it and makes it far too easy to hide failing tests.

If any tests begin to fail as a result of this change then they should be fixed.

Fixes #40534

Built from https://develop.svn.wordpress.org/trunk@40518


git-svn-id: http://core.svn.wordpress.org/trunk@40394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 18:26:42 +00:00
John Blackbourn
dd0346b330 Canonical: Don't skip tests if the test data is invalid.
See #40533

Built from https://develop.svn.wordpress.org/trunk@40517


git-svn-id: http://core.svn.wordpress.org/trunk@40393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 17:30:44 +00:00
John Blackbourn
8d3d439684 Posts, Post Types: Correct the fallback value for the label_count argument of register_post_status().
While using `_n_noop()` here is technically incorrect, it does correct the fallback value as its usage in `translate_nooped_plural()` expects a correctly formatted associative array.

Props xrmx

Fixes #38686

Built from https://develop.svn.wordpress.org/trunk@40516


git-svn-id: http://core.svn.wordpress.org/trunk@40392 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 14:17:42 +00:00
Andrew Ozz
c7058c739d Editor: fix undefined var notice in editor_js() in class-wp-editor.php.
Props littler.chicken.
Fixes #40501, see #35760.
Built from https://develop.svn.wordpress.org/trunk@40515


git-svn-id: http://core.svn.wordpress.org/trunk@40391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 01:12:44 +00:00
Boone Gorges
e45ee36b84 Restore support for taxonomy 'args' override when querying object terms.
[7520] introduced an undocumented feature whereby developers could
register a custom taxonomy with an 'args' parameter, consisting of
an array of config params that, when present, override corresponding
params in the `$args` array passed to `wp_get_object_terms()` when
using that function to query for terms in the specified taxonomy.

The `wp_get_object_terms()` refactor in [38667] failed to respect
this secret covenant, and the current changeset atones for the
transgression.

Props danielbachhuber.
Fixes #40496.
Built from https://develop.svn.wordpress.org/trunk@40513


git-svn-id: http://core.svn.wordpress.org/trunk@40389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-21 19:14:44 +00:00
Weston Ruter
cc77899e7f Customize: Increase width of controls pane on large monitors to give more room.
Props celloexpressions, timmydcrawford.
Fixes #32296.

Built from https://develop.svn.wordpress.org/trunk@40511


git-svn-id: http://core.svn.wordpress.org/trunk@40387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-21 05:25:43 +00:00
Weston Ruter
9eb9cc40bd Customize: Fix visibility of "Hide Controls" link in IE.
Amends [39214].
Props timmydcrawford.
See #32296, #38762.
Fixes #40507.

Built from https://develop.svn.wordpress.org/trunk@40510


git-svn-id: http://core.svn.wordpress.org/trunk@40386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-21 05:16:45 +00:00
Felix Arntz
9c8bf59842 Multisite: Add $network_id parameter to wp_update_network_counts().
After the `$network_id` parameter has been introduced for `wp_update_network_site_counts()` in [40484] and `wp_update_network_user_counts()` in [40485], the new parameter can now also be used on the wrapping function.

Fixes #40386. See #38699.

Built from https://develop.svn.wordpress.org/trunk@40486


git-svn-id: http://core.svn.wordpress.org/trunk@40362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-20 00:27:42 +00:00
Felix Arntz
79be8dff6d Multisite: Add $network_id parameter to wp_update_network_user_counts().
Using the new parameter, it is now possible to update the user count on a network different from the current one. While the count itself is technically a global user count and not network-wide, it is stored on each individual network, and the new parameter provides more control about where to update the count.

Fixes #40349. See #38699.

Built from https://develop.svn.wordpress.org/trunk@40485


git-svn-id: http://core.svn.wordpress.org/trunk@40361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-20 00:14:43 +00:00
Felix Arntz
7fa610b34a Multisite: Add $network_id parameter to wp_update_network_site_counts().
Using the new parameter, it is now possible to update the site counts on a network different from the current network.

Props PieWP, johnjamesjacoby.
Fixes #37528. See #38699.

Built from https://develop.svn.wordpress.org/trunk@40484


git-svn-id: http://core.svn.wordpress.org/trunk@40360 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-20 00:00:42 +00:00
Sergey Biryukov
35987df4e4 Docs: Improve @param and @return entries for wp_get_post_categories(), wp_get_post_tags(), and wp_get_post_terms().
Props philipjohn, theMikeD.
Fixes #40481.
Built from https://develop.svn.wordpress.org/trunk@40483


git-svn-id: http://core.svn.wordpress.org/trunk@40359 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-19 23:08:40 +00:00
Andrew Ozz
c0399b4fde TinyMCE: Fix cursor position after updating a wpview node. Fix hiding the inline toolbar on editor blur.
Props iseulde, azaozz.
Fixes #40480 for trunk.
Built from https://develop.svn.wordpress.org/trunk@40481


git-svn-id: http://core.svn.wordpress.org/trunk@40357 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-19 22:10:42 +00:00
Andrea Fercia
1d739a0925 Accessibility: Make some Widgets buttons real buttons.
Links used as UI controls that behave like buttons, should be buttons.
- changes the widgets "toggle", "Delete", and "Close" links to buttons
- uses `aria-expanded` to announce the state of the toggle buttons
- increases a bit the clickable area of the toggle
- ensures the "circular focus" doesn't get cut-off in some browsers by centering the toggle arrows
- uses a `<span>` element with an `aria-hidden` attribute to hide CSS generated font icons from assistive technologies
- standardizes on `.toggle-indicator:before` rather than `:after`
- changes two `#f00` reds in `#dc3232`, see #35622

Fixes #31476.

Built from https://develop.svn.wordpress.org/trunk@40480


git-svn-id: http://core.svn.wordpress.org/trunk@40356 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-19 21:14:44 +00:00
Andrea Fercia
711796d172 Accessibility: Make Safari 10 + VoiceOver announce repeated, identical, wp.a11y.speak() messages.
Safari 10 + VoiceOver don't announce repeated, identical, strings sent to an 
`aria-live` region. Appending a `no-break space` to a repeated message string,
forces them to think the strings are different.

Fixes #36853.

Built from https://develop.svn.wordpress.org/trunk@40479


git-svn-id: http://core.svn.wordpress.org/trunk@40355 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-19 19:53:42 +00:00
Dominik Schilling
7977451301 Multisite: After [37918] add support for retrieving custom site properties set by the site_details filter.
The behaviour was previously possible with the `blog_details` filter and `get_blog_details()` function. The former is deprecated since [38936].
This change adjusts the magic methods of `WP_Site` to also check if `$key` exists in `WP_Site::get_details()`. 

Fixes #40458.
Built from https://develop.svn.wordpress.org/trunk@40478


git-svn-id: http://core.svn.wordpress.org/trunk@40354 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-19 18:52:44 +00:00
Sergey Biryukov
ebf0b9e46e Editor: Define $suffix before using it in _WP_Editors::print_tinymce_scripts().
Props imath.
Fixes #40479. See #35760.
Built from https://develop.svn.wordpress.org/trunk@40477


git-svn-id: http://core.svn.wordpress.org/trunk@40353 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-19 12:02:46 +00:00
Andrew Ozz
d0e4448257 Editor: Provide API for the editor to be dynamically instantiated via JS. First run.
See: #35760
Built from https://develop.svn.wordpress.org/trunk@40476


git-svn-id: http://core.svn.wordpress.org/trunk@40352 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-19 02:38:44 +00:00
Pascal Birchler
c58cb3af9e Twenty Seventeen: Bump version and update the changelog.
Updates changelog to link to Codex pages, like other default themes.

Props swissspidy, davidakennedy.
Fixes #40461.

Built from https://develop.svn.wordpress.org/trunk@40472


git-svn-id: http://core.svn.wordpress.org/trunk@40348 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-18 09:14:46 +00:00
Weston Ruter
cb6086ae9b Customize: Use fixed-width illustrative placeholder for hex field in color picker to prevent truncation.
Props stormrockwell, sagarprajapati, Presskopp, afercia, tejas5989, westonruter, mayurk for testing.
Fixes #39096.

Built from https://develop.svn.wordpress.org/trunk@40471


git-svn-id: http://core.svn.wordpress.org/trunk@40347 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-18 00:31:43 +00:00
Pascal Birchler
e5c05e18a1 Twenty Seventeen: Correct heading hierarchy for posts on the front page.
When the posts page is on the front page or within a front page section, the heading hierarchy for the individual post titles needs to be adjusted accordingly.

Props joedolson, celloexpressions, davidakennedy.
Fixes #40264.

Built from https://develop.svn.wordpress.org/trunk@40458


git-svn-id: http://core.svn.wordpress.org/trunk@40334 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-17 10:09:43 +00:00
John Blackbourn
c2d7701a31 Build/Test tools: Reverse the order in which the Travis jobs run.
As a general rule, this means the fastest test jobs now run first because each subsequent version of PHP is faster than the previous. When a committer is patiently waiting for a Travis build to complete, they are at least more likely to see unexpected failures earlier than they otherwise would.

In addition, this updates the JavaScript test job to run on PHP 7.1.

Props netweb

See #39705

Built from https://develop.svn.wordpress.org/trunk@40434


git-svn-id: http://core.svn.wordpress.org/trunk@40332 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-15 17:43:41 +00:00
John Blackbourn
1e9446310a Networks and Sites: Correct a capability check when accessing the Sites -> Add New screen.
Props flixos90

See #39156

Built from https://develop.svn.wordpress.org/trunk@40433


git-svn-id: http://core.svn.wordpress.org/trunk@40331 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-15 17:30:48 +00:00
Sergey Biryukov
7ee5878a9c Docs: Update the length limit in set_site_transient() docs after [34030].
Props lukecavanagh, jdgrimes.
Fixes #40455.
Built from https://develop.svn.wordpress.org/trunk@40432


git-svn-id: http://core.svn.wordpress.org/trunk@40330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-15 09:28:43 +00:00
Adam Silverstein
9ff1301ae5 Upload: improve legacy SWFUpload event handlers for current jQuery.
Fix an issue where legacy JavaScript for SWFUpload still used jQuery's 
deprecated `live` event which no longer works - switch to using `on`.
This JavaScript is still used by some plugins and themes.

Props MMDeveloper.
Fixes #39886.


Built from https://develop.svn.wordpress.org/trunk@40431


git-svn-id: http://core.svn.wordpress.org/trunk@40329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-14 16:43:44 +00:00
James Nylen
999c807b88 Media: Default to always showing the "Create Audio/Video Playlist" buttons.
This avoids a couple of expensive queries that attempt to determine whether the media library contains any audio or video items, and also makes the UI for creating playlists more discoverable.

[40382] and [40421] added filters to allow overriding this behavior; this commit changes the default value of the filters to always show these UI buttons and never run the expensive queries.  The old behavior can still be restored using the filters if desired.

Props sboisvert, adamsilverstein, joemcgill, jnylen0.
Fixes #31071.

Built from https://develop.svn.wordpress.org/trunk@40430


git-svn-id: http://core.svn.wordpress.org/trunk@40328 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-14 11:25:43 +00:00
Pascal Birchler
38c4565187 Media: Ensure Crop Image is always visible.
Previously, the crop button in the media modal after uploading header images or similar was hidden and the task could not be completed.

Props karinedo, sagarprajapati, Cybr, mayurk.
Fixes #40152.

Built from https://develop.svn.wordpress.org/trunk@40428


git-svn-id: http://core.svn.wordpress.org/trunk@40326 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-14 09:31:43 +00:00
Sergey Biryukov
9fb2e79b57 Posts, Post Types: In wp_check_post_lock(), check if the user with lock exists and return false otherwise.
Props arshidkv12, 1naveengiri.
Fixes #39888.
Built from https://develop.svn.wordpress.org/trunk@40424


git-svn-id: http://core.svn.wordpress.org/trunk@40322 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-13 23:09:43 +00:00
Sergey Biryukov
bef3ff1377 Posts, Post Types: Improve the docs for wp_check_post_lock() and wp_set_post_lock().
See #39888.
Built from https://develop.svn.wordpress.org/trunk@40423


git-svn-id: http://core.svn.wordpress.org/trunk@40321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-13 23:02:42 +00:00
Sergey Biryukov
902b91400d Administration: Add "(link opens in a new window)" as a screen reader text for "Preview" link on Edit Post screen.
Props rianrietveld.
Fixes #40185.
Built from https://develop.svn.wordpress.org/trunk@40422


git-svn-id: http://core.svn.wordpress.org/trunk@40320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-13 22:42:43 +00:00
James Nylen
7d8451ff70 Media: Improve filters that allow overriding slow media queries.
As a follow-up to [40382], this commit makes the following improvements:

- Make the filter names more specific.
- Fix the inline documentation (use `@param` instead of `@return).
- Use `null ===` instead of `is_null` to avoid extra function calls.
- Rename the `$has_audio` and `$has_video` variables now that they actually represent something slightly different.

See #31071.

Built from https://develop.svn.wordpress.org/trunk@40421


git-svn-id: http://core.svn.wordpress.org/trunk@40319 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-13 20:22:44 +00:00
Andrea Fercia
5599164cb7 Toolbar: Reset CSS properties that might be inherited from the active Theme.
The Toolbar search field, when the Toolbar is displayed on the frontend, might
inherit CSS properties from the active Theme stylesheet. For example, this
happened with Twenty Seventeen that sets `display: block;` on all the input
fields. Thus, there's the need to reset some CSS properties to avoid inheritance.

Props @sagarprajapati.
Fixes #40313.

Built from https://develop.svn.wordpress.org/trunk@40418


git-svn-id: http://core.svn.wordpress.org/trunk@40316 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-12 16:12:43 +00:00
John Blackbourn
c26a9a4478 Build/Test tools: Introduce and implement assertNotIXRError() and assertIXRError() assertion methods.
This aids in debugging XMLRPC tests which fail, by exposing the `IXR_Error` error message in the assertion failure message.

Fixes #40423

Built from https://develop.svn.wordpress.org/trunk@40417


git-svn-id: http://core.svn.wordpress.org/trunk@40315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-12 14:59:44 +00:00
John Blackbourn
927bd9aeb8 Build/Test tools: Improve the failure message reported by assertQueryTrue() so it's a little less cryptic.
Fixes #40411

Built from https://develop.svn.wordpress.org/trunk@40416


git-svn-id: http://core.svn.wordpress.org/trunk@40314 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-11 10:48:43 +00:00
Felix Arntz
45b64ba2ff Multisite: Replace unnecessary is_super_admin() check when setting up the initial network.
When using `is_super_admin()` in a non-multisite environment, the function is supposed to check for administrator capabilities. The process of querying all users and filtering them with that function can be optimized by only querying users with the administrator role instead.

Fixes #40406. See #37616.

Built from https://develop.svn.wordpress.org/trunk@40406


git-svn-id: http://core.svn.wordpress.org/trunk@40313 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-10 22:00:43 +00:00
Weston Ruter
226e34effc Customize: Verify availability of history.replaceState (in IE9) before attempting to populate changeset_uuid parameter.
Props westonruter, timmydcrawford for testing.
Amends [39686].
See #39227.
Fixes #40405.

Built from https://develop.svn.wordpress.org/trunk@40405


git-svn-id: http://core.svn.wordpress.org/trunk@40312 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-10 21:15:41 +00:00
Felix Arntz
9354ea683f Multisite: Introduce an upgrade_network capability.
Prior to this change, a mix of `is_super_admin()` calls and `manage_network` capability checks was used to determine whether the current user could upgrade the network. With this changeset a dedicated capability is introduced that allows more granular handling.

Props dhanendran for the original patch.
Fixes #39205. See #37616.

Built from https://develop.svn.wordpress.org/trunk@40404


git-svn-id: http://core.svn.wordpress.org/trunk@40311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-10 21:11:43 +00:00
Joe McGill
4e1f22bf78 Fix broken audio/video functions when sanitizing ID3 data
This fixes a bug where running `wp_kses_post_deep()` on all the ID3
tag data corrupted blob data.

Fixes #40075, #40085.

Built from https://develop.svn.wordpress.org/trunk@40400


git-svn-id: http://core.svn.wordpress.org/trunk@40307 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-10 01:28:47 +00:00
Andrew Ozz
eab25ea270 TinyMCE: update the tests for version 4.5.6. Remove default plugins tests, it is quite pointless to keep repeating them at this point.
See #40305.

Built from https://develop.svn.wordpress.org/trunk@40399


git-svn-id: http://core.svn.wordpress.org/trunk@40306 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-09 23:11:42 +00:00
Andrew Ozz
23850c3952 Update TinyMCE to 4.5.6. Has many improvements and bug fixes. Changelog: https://github.com/tinymce/tinymce/blob/4.5.x/changelog.txt.
Fixes #40305 for trunk.
Built from https://develop.svn.wordpress.org/trunk@40398


git-svn-id: http://core.svn.wordpress.org/trunk@40305 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-09 23:01:43 +00:00
Joe McGill
efab6e06ca Media: Improve handling of non-image files in wp_get_image_mime.
This prevents non-image fileypes from returning a mime type of
"application/octet-stream" when `exif_imagetype()` returns `false`.

Props blobfolio.
Fixes #40017.

Built from https://develop.svn.wordpress.org/trunk@40397


git-svn-id: http://core.svn.wordpress.org/trunk@40304 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-09 22:44:43 +00:00
Weston Ruter
57b386ef1e Customize: Fix behavior of clicking Delete Menu link and keep available nav menu items panel open when doing bulk deletion.
Props maguiar, adamsilverstein for testing.
Amends [39548].
Fixes #38953.

Built from https://develop.svn.wordpress.org/trunk@40396


git-svn-id: http://core.svn.wordpress.org/trunk@40303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-07 20:22:43 +00:00
Weston Ruter
ad293eade7 Customize: Auto-expand a widget area section when expanding the Widgets panel if there is only one registered sidebar and it is active.
Introduces `WP_Customize_Panel::$auto_expand_sole_section` property which allows panels to opt-in to the behavior, which the Widgets panel is made to do by default.

Props delawski, westonruter, melchoyce.
Fixes #37471.

Built from https://develop.svn.wordpress.org/trunk@40395


git-svn-id: http://core.svn.wordpress.org/trunk@40302 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-07 19:27:40 +00:00
Pascal Birchler
8473f9ef66 Upgrade/Install: Introduce wp_disallow_file_mods() helper function.
This is a wrapper around the checks for the `DISALLOW_FILE_MODS` constant to determine whether file modifications are disallowed.

Props MaximeCulea.
Fixes #38673.

Built from https://develop.svn.wordpress.org/trunk@40394


git-svn-id: http://core.svn.wordpress.org/trunk@40301 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-07 14:36:50 +00:00
John Blackbourn
0c2338fab2 Networks and Sites: Align the display of site statuses on the Sites listing screen with those of posts on the Posts listing screen.
Fixes #40290

Built from https://develop.svn.wordpress.org/trunk@40393


git-svn-id: http://core.svn.wordpress.org/trunk@40300 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-07 13:51:43 +00:00
John Blackbourn
6ba598cc34 Build/Test tools: Remove occurrences of create_function() in unit tests.
Props desrosj

See #37082

Built from https://develop.svn.wordpress.org/trunk@40392


git-svn-id: http://core.svn.wordpress.org/trunk@40299 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-07 13:38:41 +00:00
Felix Arntz
ce6153d52a Multisite: Partially revert [40295].
[40295] removed the restriction of a minimum amount of characters for new site names, which could cause unexpected behavior. That changeset is reverted here with the exception of the removal of the `is_super_admin()` check, which can safely be omitted. A new filter for the minimum site name length will be introduced later to be able to modify that behavior.

See #39676, #37616.

Built from https://develop.svn.wordpress.org/trunk@40391


git-svn-id: http://core.svn.wordpress.org/trunk@40298 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-07 13:15:42 +00:00
Felix Arntz
00e8704288 Multisite: Introduce a setup_network capability for setting up multisite.
`setup_network` is a new meta capability that brings more granular control over the permissions to setup a multisite environment. In a non-multisite environment it falls back to `manage_options` while in a multisite it falls back to `manage_network_options`. The introduction of this capability furthermore allows replacing an `is_super_admin()` check.

Props ashokkumar24 for the original patch.
Fixes #39206. See #37616.

Built from https://develop.svn.wordpress.org/trunk@40390


git-svn-id: http://core.svn.wordpress.org/trunk@40297 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-07 12:53:45 +00:00
Pascal Birchler
72c19648bc Load: Only load PasswordHash class when needed.
This reverts [38371] which loaded `class-phpass.php` early in `wp-settings.php` and in turn caused backward compatibility problems.

Props DavidAnderson, ketuchetan.
Fixes #39445.

Built from https://develop.svn.wordpress.org/trunk@40387


git-svn-id: http://core.svn.wordpress.org/trunk@40294 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-06 18:01:42 +00:00
James Nylen
5584f22d53 Media: Add filters to allow overriding slow media queries.
There are a couple of queries that do a full table scan of attachment posts to support features of the media library.  Pending a more complete solution, allow overriding these queries via filters.

Props sboisvert, jnylen0.
See #31071.

Built from https://develop.svn.wordpress.org/trunk@40382


git-svn-id: http://core.svn.wordpress.org/trunk@40289 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-06 03:57:45 +00:00
Weston Ruter
19d960e257 Customize: Fix HTTPS navigation of site in preview on IE11.
Accounts for HTTPS links (port 443) where [40318] only accounted for HTTP links (port 80). Addresses issue in IE11 where the default port number is unexpectedly included on `link.host` for links dynamically created by scripts.

Props mattwiebe.
Amends [40318], [38890].
See #38409.
Fixes #40198.

Built from https://develop.svn.wordpress.org/trunk@40381


git-svn-id: http://core.svn.wordpress.org/trunk@40288 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-06 00:32:44 +00:00
Weston Ruter
162785c65f Customize: Fix reversal of nav menu item's type and object properties for page stub added in customizer.
Amends [38906].
See #38164.
Fixes #40277.

Built from https://develop.svn.wordpress.org/trunk@40380


git-svn-id: http://core.svn.wordpress.org/trunk@40287 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-05 23:29:42 +00:00
Weston Ruter
5f771393a3 Customize: Use is_header_video_active() as active_callback for external_header_video control instead of is_front_page().
Use the same `active_callback` as was supplied previously for the `header_video` control in [39240] where this instance was missed.

Amends [39240].
Props pratikshrestha.
See #38738.
Fixes #40308.

Built from https://develop.svn.wordpress.org/trunk@40379


git-svn-id: http://core.svn.wordpress.org/trunk@40286 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-05 23:10:42 +00:00
James Nylen
99b13790c2 REST API: Allow fetching multiple users at once via the slug parameter.
This matches similar changes previously made for posts (#38579) and terms (#40027).

Props curdin, MatheusGimenez.
Fixes #40213.

Built from https://develop.svn.wordpress.org/trunk@40378


git-svn-id: http://core.svn.wordpress.org/trunk@40285 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-05 22:25:43 +00:00
James Nylen
1979815aef REST API: Update description string of terms endpoint slug parameter.
As a follow-up to [40376], and for consistency with the posts endpoint, we should indicate in the description that the `slug` filter parameter can accept multiple values.

See #40027.

Built from https://develop.svn.wordpress.org/trunk@40377


git-svn-id: http://core.svn.wordpress.org/trunk@40284 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-05 21:08:43 +00:00
James Nylen
9f2d94b211 REST API: Allow fetching multiple terms at once via the slug parameter.
This matches a similar change previously made for posts (#38579) and an upcoming change for users (#40213).

Props wonderboymusic, MatheusGimenez, curdin.
Fixes #40027.

Built from https://develop.svn.wordpress.org/trunk@40376


git-svn-id: http://core.svn.wordpress.org/trunk@40283 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-05 20:25:46 +00:00
Felix Arntz
a212ed8e25 Multisite: Fix wp_get_sites() to return an unlimited amount of sites when passing a falsy limit argument.
Props iandunn for the original patch.
Fixes #39879. See #35791.

Built from https://develop.svn.wordpress.org/trunk@40372


git-svn-id: http://core.svn.wordpress.org/trunk@40279 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-05 02:18:43 +00:00
Felix Arntz
58b810e9eb Multisite: Add $network_id parameter to get_user_count().
The `get_user_count()` function returns the number of active users on a network, which is stored in a `user_count` network option. Since `get_network_option()` supports retrieving options from other networks than the current one, `get_user_count()` can now make use of that feature.

Fixes #37866.

Built from https://develop.svn.wordpress.org/trunk@40371


git-svn-id: http://core.svn.wordpress.org/trunk@40278 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-05 02:18:00 +00:00
Felix Arntz
924e31583c Multisite: Support the $network_id parameter of get_blog_count().
The `get_blog_count()` function used to support an `$id` parameter for the network ID prior to WordPress 3.1. This parameter has not been used since the introduction of `get_site_option()` and was later deprecated in [25113]. With `get_network_option()` however it is possible to support the parameter again, now properly renamed as `$network_id`.

A unit test has for the parameter has been added as well. Another unit test in the same class was adjusted to work properly with multiple networks existing.

Fixes #37865.

Built from https://develop.svn.wordpress.org/trunk@40370


git-svn-id: http://core.svn.wordpress.org/trunk@40277 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-05 02:17:18 +00:00
Pascal Birchler
e1a08e199a Customize: User get_user_locale() in customizer body class.
Otherwise CSS specific to the site's locale would be applied, even though the customizer is displayed in the user's locale.

See #29783.
Fixes #40271.

Built from https://develop.svn.wordpress.org/trunk@40368


git-svn-id: http://core.svn.wordpress.org/trunk@40275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-05 02:16:02 +00:00
Adam Silverstein
789f141045 REST API: JS Client - Enable connecting to multiple endpoints.
Enable connecting to multiple wp-api `endpoints`. Calling `wp.api.init` with a new `apiRoot` will parse the new endpoint's schema and store a new set of models and collections. A collection of connected endpoints is stored in `wp.api.endpoints`.

Props lucasstark.
Fixes #39683.


Built from https://develop.svn.wordpress.org/trunk@40364


git-svn-id: http://core.svn.wordpress.org/trunk@40271 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-02 19:41:41 +00:00
Sergey Biryukov
41666b5e0c Mail: Use correct capitalization for PHPMailer methods in wp_mail().
Props Soean, reidbusi.
Fixes #39702.
Built from https://develop.svn.wordpress.org/trunk@40363


git-svn-id: http://core.svn.wordpress.org/trunk@40270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-01 14:34:43 +00:00
Sergey Biryukov
33dc58fe70 I18N: Remove an extra slash between .mo file path and name in load_muplugin_textdomain().
Props nsundberg.
Fixes #39168.
Built from https://develop.svn.wordpress.org/trunk@40362


git-svn-id: http://core.svn.wordpress.org/trunk@40269 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-01 14:26:40 +00:00
Sergey Biryukov
f884d7973b Posts, Post Types: Introduce post_date_column_status filter for post status text in list tables' Date column.
Props pbearne.
Fixes #39545.
Built from https://develop.svn.wordpress.org/trunk@40361


git-svn-id: http://core.svn.wordpress.org/trunk@40268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-01 14:07:44 +00:00
Sergey Biryukov
2b48ca580e Embeds: Change the embed_autourls option filter from default_option_* to pre_option_* to avoid a DB query.
The option was removed from core in [21998], but still might be used by plugins.

Props dlh.
Fixes #38924.
Built from https://develop.svn.wordpress.org/trunk@40360


git-svn-id: http://core.svn.wordpress.org/trunk@40267 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-01 13:56:43 +00:00
Andrea Fercia
822b8afb50 Accessibility: Improve the Media Library inline uploader accessibility.
For better accessibility, expandable panels should be placed immediately after
the control that expands them. This change moves the Media Library inline
uploader up, right after the "Add New" button, also introducing consistency with
the Plugin and Theme uploaders.
Adds a proper ARIA role on the button and an `aria-expanded` attribute to give
better feedback to assistive technologies users about the uploader's expanded state.
Improves the focus handling when closing the uploader, improves the focus style
and color contrast ratio of the uploader "close" button.

Props mantismamita, karmatosed, adamsilverstein, afercia.
Fixes #37188.

Built from https://develop.svn.wordpress.org/trunk@40359


git-svn-id: http://core.svn.wordpress.org/trunk@40266 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-31 17:38:43 +00:00
Andrea Fercia
9c360b1ab8 Administration: Fix minor misalignments caused by the button-link CSS class.
After [40059] the CSS class `button-link` uses `text-align: left` by default.
This change now requires to limit as much as possible the use of `button-link`
to controls that should really look like links and to explicitly set
`text-align: center` in a few other cases.

Fixes #39983.

Built from https://develop.svn.wordpress.org/trunk@40358


git-svn-id: http://core.svn.wordpress.org/trunk@40265 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-31 16:51:45 +00:00
Andrea Fercia
35d8daf000 Quick/Bulk Edit: Fix the Tag suggestions position on the Bulk Edit textarea.
Always passes the complete `position` object to the jQuery autocomplete widget.
Also checks if an autocomplete instance already exists on the Bulk Edit textarea.

Props davidbenton.
Fixes #40242.

Built from https://develop.svn.wordpress.org/trunk@40357


git-svn-id: http://core.svn.wordpress.org/trunk@40264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-31 16:35:45 +00:00
Sergey Biryukov
32e80d00c1 Press This: Reorder post format icon styles for consistency with get_post_format_strings().
See #40304.
Built from https://develop.svn.wordpress.org/trunk@40356


git-svn-id: http://core.svn.wordpress.org/trunk@40263 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-31 08:22:48 +00:00
Sergey Biryukov
3c86148c14 Press This: Add missing icons for Chat and Status post formats.
Props menakas, ejner69.
Fixes #40304.
Built from https://develop.svn.wordpress.org/trunk@40355


git-svn-id: http://core.svn.wordpress.org/trunk@40262 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-31 08:19:48 +00:00
Boone Gorges
7102240efe Invalidate term query caches when setting or deleting term relationships.
Prior to 4.7, term relationships - as set by `wp_set_object_terms()` or
`wp_remove_object_terms()` - did not affect the term query cache. The
introduction of the 'object_ids' parameter in 4.7 means that the query
cache must be aware of object-term relationships. As such, the
'last_changed' incrementor is now invalidated when term relationships
are modified.

This bug only reared its head when delaying term counting, because term
counting performs its own term query cache invalidation.

Props mboynes.
Fixes #40306.
Built from https://develop.svn.wordpress.org/trunk@40353


git-svn-id: http://core.svn.wordpress.org/trunk@40260 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-30 16:51:47 +00:00
Jeremy Felt
3d4f2f2fea Multisite: Correct documentation for site status change hooks.
Props johnbillion.
Fixes #40287.

Built from https://develop.svn.wordpress.org/trunk@40352


git-svn-id: http://core.svn.wordpress.org/trunk@40259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-30 04:36:43 +00:00
Jeremy Felt
fa3dc867e7 Multisite: Add deleted_blog action after site has been deleted.
Props pauldewouters, johnjamesjacoby.
Fixes #25584.

Built from https://develop.svn.wordpress.org/trunk@40351


git-svn-id: http://core.svn.wordpress.org/trunk@40258 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-30 04:31:44 +00:00
James Nylen
977c5f85e3 Tests: Remove a couple of invalid error assertions.
A couple of REST API tests had an assertion `assertNotInstanceOf( 'WP_Error', $response );` which will never be true.

Since these assertions are invalid, and also made redundant by the response status check, we can just remove them.

Props dlh.
Fixes #40270.

Built from https://develop.svn.wordpress.org/trunk@40350


git-svn-id: http://core.svn.wordpress.org/trunk@40257 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-29 17:06:44 +00:00
Sergey Biryukov
e8c4b8c8e7 Docs: Add an entry for $pagenow global in WP_Customize_Manager::setup_theme().
Props mt8.biz.
Fixes #40297.
Built from https://develop.svn.wordpress.org/trunk@40349


git-svn-id: http://core.svn.wordpress.org/trunk@40256 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-29 11:41:46 +00:00
Sergey Biryukov
633ce094a1 Taxonomy: Fix typo in $aria_checked variable name in Walker_Category_Checklist::start_el().
Props dhanendran.
Fixes #40295.
Built from https://develop.svn.wordpress.org/trunk@40348


git-svn-id: http://core.svn.wordpress.org/trunk@40255 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-29 11:22:47 +00:00
Jeremy Felt
1c6111f3bb Multisite: Remove unused site-lookup global cache group.
The `site-lookup` group was introduced in WPMU, but never actually used in WordPress core.

Props johnjamesjacoby.
Fixes #38725.

Built from https://develop.svn.wordpress.org/trunk@40347


git-svn-id: http://core.svn.wordpress.org/trunk@40254 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-28 21:08:47 +00:00
Jeremy Felt
0e7e0aa4bc Multisite: Respect $_wp_suspend_cache_invalidation when clearing network and site caches.
Props johnjamesjacoby.
Fixes #40028.

Built from https://develop.svn.wordpress.org/trunk@40346


git-svn-id: http://core.svn.wordpress.org/trunk@40253 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-28 19:36:49 +00:00
Jeremy Felt
6530f5f5f2 Multisite: Allow falsy properties to be cached in site-details.
In previous iterations of `WP_Site`, there was concern that not all properties would be available when storing a site's details in cache. When introduced in [37918], an `ms_loaded` check was added to address this concern. Any properties that are still `false` after `ms_loaded` really are `false` and can be cached as such.

Props flixos90.
Fixes #40247.

Built from https://develop.svn.wordpress.org/trunk@40344


git-svn-id: http://core.svn.wordpress.org/trunk@40251 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-28 02:32:44 +00:00
Jeremy Felt
fa5f2d1fa2 Tests: Add missing global cache groups.
Add `useremail`, `userslugs`, `networks`, `sites`, and `site-details` as global cache groups when added with unit tests. This aligns the list with the core default.

Fixes #40283.

Built from https://develop.svn.wordpress.org/trunk@40343


git-svn-id: http://core.svn.wordpress.org/trunk@40250 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-28 01:46:45 +00:00
Jeremy Felt
b61ddd8035 Tests: Clarify zero path segment tests for get_network_by_path().
The set of assertions in this data provider intend to test a 0 path segment configuration rather than the use of paths.

Fixes #37217.

Built from https://develop.svn.wordpress.org/trunk@40342


git-svn-id: http://core.svn.wordpress.org/trunk@40249 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-28 01:25:48 +00:00
Jeremy Felt
94dbb2e8d8 Tests: Consolidate logic used to skip API fixture generation.
This checks for `is_multisite()` and the minimum PHP version in the same block and removes two `echo` statements previously used to indicate generation had been skipped.

Fixes #40041.

Built from https://develop.svn.wordpress.org/trunk@40341


git-svn-id: http://core.svn.wordpress.org/trunk@40248 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-27 21:05:44 +00:00
Jeremy Felt
f940beae2b Multisite: Add lang_id support to WP_Site_Query.
Sites can now be queried by `lang_id`, `lang__in`, and `lang__not_in`.

Props ocean90.
Fixes #40196.

Built from https://develop.svn.wordpress.org/trunk@40340


git-svn-id: http://core.svn.wordpress.org/trunk@40247 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-27 19:48:52 +00:00
Jeremy Felt
36aa674859 Tests: Use utf8mb4 max index length when creating keys.
In [31349], core `varchar` column key lengths were changed from 255 to 191 to support the 767 byte index size limit on standard utf8mb4 MySQL installs. This changes the DB schema tests to match.

Props caseypatrickdriscoll, clarinetlord.
Fixes #35958.

Built from https://develop.svn.wordpress.org/trunk@40339


git-svn-id: http://core.svn.wordpress.org/trunk@40246 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-27 19:34:53 +00:00
Pascal Birchler
db5a65eb5e Themes: Fix incorrect annotation for __clear_multi_author_cache() function.
Props flixos90.
See #40063.
Fixes #40262.


Built from https://develop.svn.wordpress.org/trunk@40334


git-svn-id: http://core.svn.wordpress.org/trunk@40241 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-25 15:47:42 +00:00
Pascal Birchler
6216c997ba Multisite: After [40305], rename clean_site_details_cache() method as it's not really private.
See #40063.


Built from https://develop.svn.wordpress.org/trunk@40333


git-svn-id: http://core.svn.wordpress.org/trunk@40240 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-25 15:31:43 +00:00
Weston Ruter
8256ecfecb Customize: Improve i18n for strings in hidden widget area notices.
Amends [40312].
Props westonruter, ocean90, swissspidy, SergeyBiryukov, michelleweber for copywriting.
See #33567, #33052.
Fixes #39087.

Built from https://develop.svn.wordpress.org/trunk@40330


git-svn-id: http://core.svn.wordpress.org/trunk@40237 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-24 22:03:42 +00:00
Pascal Birchler
0d42f8549c REST API: Use get_gmt_from_date() when preparing a draft post for response.
This prevents wrong dates when dealing with DST, see [40115] and [40284].

Props nerrad.
Fixes #40136.
Built from https://develop.svn.wordpress.org/trunk@40324


git-svn-id: http://core.svn.wordpress.org/trunk@40231 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-24 17:32:46 +00:00
John Blackbourn
37a638ae8a Users: Don't push the current user's role to the top of the list in wp_dropdown_roles().
This brings consistency to the order in which roles are displayed in the `Roles` dropdown when editing users.

Props bor0

Fixes #40162

Built from https://develop.svn.wordpress.org/trunk@40323


git-svn-id: http://core.svn.wordpress.org/trunk@40230 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-24 14:53:46 +00:00
Sergey Biryukov
6e5e29c5bf Docs: Correct default value in @param entry for the $num_words parameter of wp_trim_words filter.
Props redrambles.
Fixes #40248.
Built from https://develop.svn.wordpress.org/trunk@40322


git-svn-id: http://core.svn.wordpress.org/trunk@40229 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-24 00:58:41 +00:00
John Blackbourn
3a4b5afa49 Login and Registration: Avoid a potentially incorrect value for the cookie hash on multisite installations that don't have a value in the siteurl network option.
This reverts [38619].

See #34084

Fixes #39497

Built from https://develop.svn.wordpress.org/trunk@40320


git-svn-id: http://core.svn.wordpress.org/trunk@40227 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-23 19:01:42 +00:00
Weston Ruter
e78707aad4 Customize: Prevent client-side validation from being cleared when no corresponding server-side validation is present.
See #36944.
Fixes #39770.

Built from https://develop.svn.wordpress.org/trunk@40319


git-svn-id: http://core.svn.wordpress.org/trunk@40226 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-23 18:12:44 +00:00
Weston Ruter
5aec57b209 Customize: Fix navigation of site in preview on IE11.
Addresses issue in IE11 where the default port number of `:80` is unexpectedly included on `link.host` for links dynamically created by scripts.

Props westonruter, afercia for testing.
See #38409.
Fixes #40198.

Built from https://develop.svn.wordpress.org/trunk@40318


git-svn-id: http://core.svn.wordpress.org/trunk@40225 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-23 17:25:43 +00:00
Felix Arntz
6b5169739f Multisite: Add further unit tests for get_blog_details().
These tests verify that the returned site object is iterable and contains the expected properties.

See #40228, #40180.

Built from https://develop.svn.wordpress.org/trunk@40317


git-svn-id: http://core.svn.wordpress.org/trunk@40224 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-23 17:14:43 +00:00
Weston Ruter
c78f903a7b Customize: Fix selective refresh when customizing the 404 template.
Overrides the 404 status during partial refresh requests to serve back 200 so that the request is not deemed a failure and invoke the fallback behavior (full refresh).

See #27355.
Fixes #40018.

Built from https://develop.svn.wordpress.org/trunk@40316


git-svn-id: http://core.svn.wordpress.org/trunk@40223 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-23 16:57:43 +00:00
Sergey Biryukov
090901009b Twenty Seventeen: Declare jQuery as a dependency for navigation.js.
Props chesio.
Fixes #40224.
Built from https://develop.svn.wordpress.org/trunk@40315


git-svn-id: http://core.svn.wordpress.org/trunk@40222 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-23 16:22:44 +00:00
Weston Ruter
80bb51634a Customize: Harden site_icon control template to account for when full image size is missing.
Props aussieguy123, westonruter.
See #36749.
Fixes #40010.

Built from https://develop.svn.wordpress.org/trunk@40314


git-svn-id: http://core.svn.wordpress.org/trunk@40221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-23 06:13:44 +00:00
Weston Ruter
84ed6f665f Customize: Prevent links to customize.php from being generated which have query vars from wp_removable_query_args() present.
Props dlh.
See #23367, #32692.
Fixes #31850.

Built from https://develop.svn.wordpress.org/trunk@40313


git-svn-id: http://core.svn.wordpress.org/trunk@40220 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-22 23:04:42 +00:00
Weston Ruter
085b50b20d Customize: Show notice in Widgets panel when there are additional widget areas not rendered in preview.
This extends the existing behavior which only showed a message only when there were no widget areas rendered in the preview. The number of non-rendered widget areas is indicated. Also removes needles deletion of `wp.customize.Widgets.data.l10n` property which hindered plugins.

See #33567, #33052.
Fixes #39087.

Built from https://develop.svn.wordpress.org/trunk@40312


git-svn-id: http://core.svn.wordpress.org/trunk@40219 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-22 19:03:45 +00:00
Sergey Biryukov
f44fe7f5fe Twenty Seventeen: Use esc_attr_e() for translatable strings in HTML attributes.
Props bor0.
Fixes #40216.
Built from https://develop.svn.wordpress.org/trunk@40311


git-svn-id: http://core.svn.wordpress.org/trunk@40218 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-22 03:52:41 +00:00
Sergey Biryukov
6a2b38ca6c Docs: Add description for $mode global in WP_MS_Sites_List_Table and WP_MS_Users_List_Table.
Fixes #40208.
Built from https://develop.svn.wordpress.org/trunk@40310


git-svn-id: http://core.svn.wordpress.org/trunk@40217 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-22 03:48:42 +00:00
Sergey Biryukov
0b7148ebbb Docs: Add description for $mode global in WP_Media_List_Table and WP_Posts_List_Table.
See #40208.
Built from https://develop.svn.wordpress.org/trunk@40309


git-svn-id: http://core.svn.wordpress.org/trunk@40216 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-22 03:47:07 +00:00
Sergey Biryukov
e51bc5fb6b Docs: Add missing @global entry for list table view mode in WP_Screen::render_view_mode().
Props priyankabehera155.
See #40208.
Built from https://develop.svn.wordpress.org/trunk@40308


git-svn-id: http://core.svn.wordpress.org/trunk@40215 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-22 03:46:28 +00:00
Sergey Biryukov
127a2c9998 Docs: Add missing @global entry for list table view mode in wp_ajax_inline_save().
Props priyankabehera155.
See #40208.
Built from https://develop.svn.wordpress.org/trunk@40307


git-svn-id: http://core.svn.wordpress.org/trunk@40214 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-22 03:45:45 +00:00
Rachel Baker
f78ceb362e REST API: Confirm the parent post object of an attachment exists in WP_REST_Posts_Controller::check_read_permission().
Avoid a PHP Error when attempting to embed the parent post of an attachment, when the parent post ID is invalid. Instead check if the parent post object exists before checking the read permission for the parent post.

Props GhostToast.
Fixes #39881. 

Built from https://develop.svn.wordpress.org/trunk@40306


git-svn-id: http://core.svn.wordpress.org/trunk@40213 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-20 04:30:46 +00:00
Felix Arntz
cde6126923 Multisite: Handle sites cache invalidation more granularly for option updates.
Previously `update_blog_option()` would trigger an invalidation of that site's entire cache although these changes did not affect the content of these caches. Furthermore changes to the special options `blogname`, `siteurl` and `post_count` should not invalidate the entire cache of that site, but only their respective site details cache. The option `home` now has the same behavior as it also belongs to the site details, but did not invalidate the cache at all previously.

Several new unit tests confirm these changes work as expected.

Fixes #40063.

Built from https://develop.svn.wordpress.org/trunk@40305


git-svn-id: http://core.svn.wordpress.org/trunk@40212 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-19 16:22:45 +00:00
Weston Ruter
e69b9b244c Customize: Fix failure to collapse expanded sections and panels that become deactivated.
Improve jsdoc for `onChangeActive` function. Restores fix from [34557] which got dropped in [38648].

Props dlh, westonruter.
See #34391, #33509.
Fixes #39430.

Built from https://develop.svn.wordpress.org/trunk@40304


git-svn-id: http://core.svn.wordpress.org/trunk@40211 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-19 00:04:43 +00:00
Pascal Birchler
280bfe7933 Taxonomy: Add missing REST API properties to WP_Taxonomy class.
Props danielbachhuber.
Fixes #39987.
Built from https://develop.svn.wordpress.org/trunk@40303


git-svn-id: http://core.svn.wordpress.org/trunk@40210 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-18 15:25:43 +00:00
Pascal Birchler
9ebebe5d25 Posts, Post Types: Add missing REST API properties to WP_Post_Type class.
Props danielbachhuber.
Fixes #39986.
Built from https://develop.svn.wordpress.org/trunk@40302


git-svn-id: http://core.svn.wordpress.org/trunk@40209 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-18 15:17:45 +00:00
Rachel Baker
503d42fe6b Themes: Add filter for excluding directories from being scanned for template files.
Exclude 'node_modules' directories from paths searched in `WP_Theme::scandir()`. Introduces the `theme_scandir_exclusions` filter to allow sites to exclude any other paths like `bower_components` or `vendor` from being searched for template files.

Props lukasbesch, dd32, swisspidy, rachelbaker. 
Fixes #38292. 

Built from https://develop.svn.wordpress.org/trunk@40301


git-svn-id: http://core.svn.wordpress.org/trunk@40208 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-18 03:54:41 +00:00
Weston Ruter
fc631ffa00 Customize: Trailingslash the home nav menu item URL in starter content.
This prevents an additional 301 redirect when clicking on the nav menu item, and it also prevents a scenario where the auth cookie may not be passed and cause an authentication error when navigating in the customizer.

Props dlh, swissspidy.
Fixes #40112.

Built from https://develop.svn.wordpress.org/trunk@40300


git-svn-id: http://core.svn.wordpress.org/trunk@40207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-18 03:23:44 +00:00
Sergey Biryukov
9f4bbcdb78 Docs: Fix typo in wp_parse_url() and _get_component_from_parsed_url_array() docblocks.
Props naomicbush.
Fixes #40190.
Built from https://develop.svn.wordpress.org/trunk@40299


git-svn-id: http://core.svn.wordpress.org/trunk@40206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-17 19:02:40 +00:00
Drew Jaynes
c1030f3b94 Docs: Add a missing return description for get_post_taxonomies().
h/t deeptiboddapati.
See #39130.

Built from https://develop.svn.wordpress.org/trunk@40298


git-svn-id: http://core.svn.wordpress.org/trunk@40205 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-17 17:27:41 +00:00
Pascal Birchler
3e189479a7 List Tables: Hide 'Empty Trash' and 'Empty Spam' buttons when view is already empty.
Props ivantedja, Presskopp, printsachen1, Jaydeep Rami, mathieuhays, cazm.
Fixes #38341.
Built from https://develop.svn.wordpress.org/trunk@40297


git-svn-id: http://core.svn.wordpress.org/trunk@40204 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-17 16:54:42 +00:00
Pascal Birchler
62061bab56 Multisite: Ensure first page/post/comment content is not empty when setting up a new site.
This prevents creating page without any content when the options are populated with an empty string.

Props shadyvb.
Fixes #40036.
Built from https://develop.svn.wordpress.org/trunk@40296


git-svn-id: http://core.svn.wordpress.org/trunk@40203 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-17 15:49:42 +00:00
Felix Arntz
2295ed8031 Multisite: Remove restriction of minimum site name length in wpmu_validate_blog_signup().
It is sometimes desirable to support shorter site names than 4 characters, therefore that restriction should be removed. It is still possible to manually enforce it by using the `wpmu_validate_blog_signup` filter.

As a result of this change, another `is_super_admin()` call gets removed which affects the ongoing efforts of working on a network-wide role system.

Props milindmore22.
Fixes #39676. See #37616.

Built from https://develop.svn.wordpress.org/trunk@40295


git-svn-id: http://core.svn.wordpress.org/trunk@40202 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-17 14:36:43 +00:00
Felix Arntz
8e71ca0f94 Multisite: Provide unit tests for wpmu_validate_blog_signup().
See #39676.

Built from https://develop.svn.wordpress.org/trunk@40294


git-svn-id: http://core.svn.wordpress.org/trunk@40201 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-17 14:15:44 +00:00
Boone Gorges
72e14046c7 Improve querying for terms with falsey names and slugs.
Prior to [38677], `get_term_by()` would always return false if
an empty string were passed as the queried 'name' or 'slug'. The
refactor to use `get_terms()` broke this behavior; inappropriately
imprecise `empty()` checks caused the 'name' or 'slug' clause to be
discarded altogether when fetching terms, resulting in an incorrect
term being returned from the function.

We fix the regression by special-casing truly empty values passed
to `get_term_by()`, and ensuring that `WP_Term_Query` is properly
able to handle `0` and `'0'` term queries.

Props sstoqnov.
Fixes #21760.
Built from https://develop.svn.wordpress.org/trunk@40293


git-svn-id: http://core.svn.wordpress.org/trunk@40200 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-16 02:04:43 +00:00
Boone Gorges
1e05730f2d Streamline get_terms() parameter documentation.
Since 4.6, `get_terms()` has been a wrapper for `WP_Term_Query`.
Full parameter documentation lives with the class, and
`get_terms()` should reference rather than duplicate it.

Props shashwatmittal.
Fixes #37075.
Built from https://develop.svn.wordpress.org/trunk@40292


git-svn-id: http://core.svn.wordpress.org/trunk@40199 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-16 01:35:45 +00:00
Boone Gorges
d4350bc065 Fix the formatting of $taxonomies parameter of 'wp_get_object_terms' filter.
[38667] changed the way that the filter parameters are built. That
changeset didn't fully account for the pre-4.7 format of `$taxonomies`.

Props ig_communitysites.
Fixes #40154.
Built from https://develop.svn.wordpress.org/trunk@40290


git-svn-id: http://core.svn.wordpress.org/trunk@40197 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-14 18:42:43 +00:00
James Nylen
d92e1fb1e4 REST API: Fix DST handling in a test.
The time chosen for `test_empty_post_date_gmt_shimmed_using_post_date` falls within US daylight savings time.  This may cause the test to fail depending on whether the current locale has DST.

The fix is to specify a numeric `gmt_offset` rather than a `timezone_string`.

Unprops jnylen0.
Fixes #40136.

Built from https://develop.svn.wordpress.org/trunk@40284


git-svn-id: http://core.svn.wordpress.org/trunk@40196 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-13 15:07:45 +00:00
Andrew Ozz
7d34efea8d Improve wording of the AYS warning when permanently deleting uploads, tags, posts.
Props dllh, gma992.
Fixes #39712 for trunk.
Built from https://develop.svn.wordpress.org/trunk@40283


git-svn-id: http://core.svn.wordpress.org/trunk@40195 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-11 19:33:43 +00:00
Sergey Biryukov
e9f73b06b6 Docs: Correct the description for wp.updates.deleteTheme.
Props MattyRob.
Fixes #40110.
Built from https://develop.svn.wordpress.org/trunk@40279


git-svn-id: http://core.svn.wordpress.org/trunk@40194 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-11 16:13:46 +00:00
Boone Gorges
43208263a0 Tests: Use assertSame() for WP_Query 'orderby' tests.
`assertEqualSets()` ignores order, so isn't much good for testing 'orderby'.

See #38034.
Built from https://develop.svn.wordpress.org/trunk@40278


git-svn-id: http://core.svn.wordpress.org/trunk@40193 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-11 03:08:48 +00:00
Boone Gorges
bdd898045d Don't run 'get_terms' filter when querying for terms within get_term_by().
Historically, it has been possible to call `get_term_by()` within
a 'get_terms' filter callback. Since `get_term_by()` was refactored
to use `get_terms()` internally [38677], callbacks of this nature
have resulted in infinite loops.

As a workaround, we introduce a 'suppress_filter' option to `get_terms()`,
and use it when calling the function from within `get_term_by()`.

Props ocean90.
See #21760.
Built from https://develop.svn.wordpress.org/trunk@40275


git-svn-id: http://core.svn.wordpress.org/trunk@40192 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-11 02:27:44 +00:00
John Blackbourn
afdef17903 Build/Test tools: Don't install PHPUnit on the travis:js builds. Saves a couple of minutes of build time.
See #40100

Built from https://develop.svn.wordpress.org/trunk@40271


git-svn-id: http://core.svn.wordpress.org/trunk@40190 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-10 23:57:44 +00:00
Sergey Biryukov
59855beb7b Twenty Seventeen: Correct grammar in 'Page Layout' control description.
Props zoonini, laurelfulford.
Fixes #40107.
Built from https://develop.svn.wordpress.org/trunk@40270


git-svn-id: http://core.svn.wordpress.org/trunk@40189 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-10 23:35:45 +00:00
John Blackbourn
4b1de2bec0 Build/Test tools: Get Travis builds working on HHVM again.
This change moves to specifying the PHPUnit version for all PHP versions, and fixes an issue where the Composer global bin directory is not at `~/.composer/vendor/bin` on the boxes that are used for HHVM builds.

See #40100

Built from https://develop.svn.wordpress.org/trunk@40269


git-svn-id: http://core.svn.wordpress.org/trunk@40188 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-10 22:58:44 +00:00
Andrea Fercia
6944c8f3a6 List Tables: After [38703], [38706], and [40118], adjust the jQuery selector to make the selection of a range of checkboxes work again.
Unprop afercia.
Fixes #40056.

Built from https://develop.svn.wordpress.org/trunk@40268


git-svn-id: http://core.svn.wordpress.org/trunk@40187 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-10 19:14:46 +00:00
John Blackbourn
d675e30e51 Build/Test tools: Don't attempt to report PHP's extensions when running HHVM jobs on Travis. It doesn't work.
Built from https://develop.svn.wordpress.org/trunk@40267


git-svn-id: http://core.svn.wordpress.org/trunk@40186 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-10 15:31:41 +00:00
John Blackbourn
96b2923e62 Docs: Remove the duplicate hook documentation for the newly introduced send_auth_cookies filter.
See #39367

Built from https://develop.svn.wordpress.org/trunk@40264


git-svn-id: http://core.svn.wordpress.org/trunk@40184 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-10 15:03:42 +00:00
John Blackbourn
265a0f4d98 Build/Test tools: Don't override the wp_set_auth_cookie() and wp_clear_auth_cookie() functions.
Overriding pluggable functions in the test suite is asking for trouble in the future. In addition, it means the test suite can't be guaranteed to behave the same as core.

This instead introduces a `send_auth_cookies` filter which can be hooked in during the test suite to prevent these functions from attempting to send cookie headers to the client.

Fixes #39367

Built from https://develop.svn.wordpress.org/trunk@40263


git-svn-id: http://core.svn.wordpress.org/trunk@40183 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-10 14:33:46 +00:00
John Blackbourn
129063036e Build/test tools: Add some more debugging to Travis and bring the format of the Xdebug fix inline with branches.
Built from https://develop.svn.wordpress.org/trunk@40259


git-svn-id: http://core.svn.wordpress.org/trunk@40181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-09 21:48:42 +00:00
Dominik Schilling
b2984d8b67 Build/Test Tools: On Travis CI install and use the node version which is specified in package.json.
Props netweb.
See #35105.
Built from https://develop.svn.wordpress.org/trunk@40258


git-svn-id: http://core.svn.wordpress.org/trunk@40180 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-09 21:09:42 +00:00
John Blackbourn
b5a47a131c Build/Test tools: Account for PHP 5.2 when using Composer to install PHPUnit.
See #39822, #40086

Built from https://develop.svn.wordpress.org/trunk@40257


git-svn-id: http://core.svn.wordpress.org/trunk@40179 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-09 20:54:43 +00:00
Sergey Biryukov
6476ef2cc9 Canonical: Strip trailing punctuation from permalinks.
Props joostdevalk, lancewillett, SergeyBiryukov.
Fixes #20383.
Built from https://develop.svn.wordpress.org/trunk@40256


git-svn-id: http://core.svn.wordpress.org/trunk@40178 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-09 20:05:46 +00:00
John Blackbourn
f79e867a96 Build/Test tools: Explicitly use PHPUnit 5.7 for the PHP 7 builds on Travis.
This avoids fatal errors while the tests remain incompatible with PHPUnit 6, which was recently introduced on Travis.

See #39822, #40086

Built from https://develop.svn.wordpress.org/trunk@40255


git-svn-id: http://core.svn.wordpress.org/trunk@40177 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-09 19:14:44 +00:00
Sergey Biryukov
e18640f4a7 Docs: Correct @return type for calendar_week_mod().
Props dingo_bastard.
Fixes #40077.
Built from https://develop.svn.wordpress.org/trunk@40254


git-svn-id: http://core.svn.wordpress.org/trunk@40176 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-09 14:02:55 +00:00
John Blackbourn
a188b877d4 Build/Test tools: Remove the unnecessary clone of the twentysixteen repo.
This is no longer needed since #31550.

Fixes #40066

Built from https://develop.svn.wordpress.org/trunk@40252


git-svn-id: http://core.svn.wordpress.org/trunk@40174 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-09 01:11:43 +00:00
Weston Ruter
d7cb2f7706 Customize: Show title input placeholders for widgets that have default titles when rendered.
Fixes #39909.
Props bor0, dlh, westonruter.

Built from https://develop.svn.wordpress.org/trunk@40251


git-svn-id: http://core.svn.wordpress.org/trunk@40173 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-08 18:25:44 +00:00
John Blackbourn
3821ff74bc Build/Test tools: In Travis, skip some tests when not on trunk.
This skips time sensitive tests (copyright year and PHP/MySQL version requirements) when tests are run on branches on Travis.

Props netweb, jorbin

Fixes #39486

Built from https://develop.svn.wordpress.org/trunk@40241


git-svn-id: http://core.svn.wordpress.org/trunk@40171 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-08 00:07:42 +00:00
John Blackbourn
4dffd5b82e Build/Test tools: Revert [40239] due to unrelated changes.
See #39486

Built from https://develop.svn.wordpress.org/trunk@40240


git-svn-id: http://core.svn.wordpress.org/trunk@40170 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-08 00:05:42 +00:00
John Blackbourn
28055b9ff5 Build/Test tools: In Travis, skip some tests when not on trunk.
This skips time sensitive tests (copyright year and PHP/MySQL version requirements) when tests are run on branches on Travis.

Props netweb, jorbin
Fixes #39486

Built from https://develop.svn.wordpress.org/trunk@40239


git-svn-id: http://core.svn.wordpress.org/trunk@40169 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-08 00:01:46 +00:00
James Nylen
27aa0664df REST API: Add gmt_offset and timezone_string to the base /wp-json response.
The site's current timezone offset is an important piece of information for any REST API client that needs to manipulate dates.  It has not been previously available.

Expose both the `gmt_offset` (the site's current offset from UTC in hours) and `timezone_string` (which also provides information about daylight savings time) via the "site info" endpoint (the base `/wp-json` response).

Also update the `wp-api-generated.js` fixture file with the changes to the default API responses.

Props sagarkbhatt.
Fixes #39854.

Built from https://develop.svn.wordpress.org/trunk@40238


git-svn-id: http://core.svn.wordpress.org/trunk@40168 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-07 05:48:41 +00:00
James Nylen
6e72e293c2 WP_Query: Add missing tests for combinations of orderby and include parameters.
This commit adds some missing test cases for combinations of `orderby` and other parameters (`post_parent__in` and `post_name__in`).

Followup to [40056] for `orderby` and `post__in`.

The interaction of these parameters is perhaps counterintuitive because `orderby` does not affect the returned results.  This is overall probably the best design, and it's now better tested and documented.

Props fibonaccina.
See #39055.

Built from https://develop.svn.wordpress.org/trunk@40237


git-svn-id: http://core.svn.wordpress.org/trunk@40167 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-07 05:27:44 +00:00
John Blackbourn
9e6d7eca00 Build/Test Tools: Call wp_head() and wp_footer() in the theme used during tests.
See #31550
Fixes #39988

Built from https://develop.svn.wordpress.org/trunk@40235


git-svn-id: http://core.svn.wordpress.org/trunk@40165 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-07 01:34:43 +00:00
John Blackbourn
263831a72d Press This: Verify intent before fetching in-page resources using Press This.
Props vortfu

Built from https://develop.svn.wordpress.org/trunk@40195


git-svn-id: http://core.svn.wordpress.org/trunk@40134 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-06 13:55:41 +00:00
Aaron Campbell
288cd46939 Strip control characters before validating redirect.
Built from https://develop.svn.wordpress.org/trunk@40183


git-svn-id: http://core.svn.wordpress.org/trunk@40122 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-06 13:38:41 +00:00
John Blackbourn
9092fd01e1 Taxonomy: Correct the formatting of HTML entities when generating the screen reader text for tag removal.
Props adamsilverstein

Built from https://develop.svn.wordpress.org/trunk@40181


git-svn-id: http://core.svn.wordpress.org/trunk@40120 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-06 13:14:41 +00:00
Aaron Campbell
4d80f8b3e1 Plugins: Add file check to plugin deletions.
Built from https://develop.svn.wordpress.org/trunk@40169


git-svn-id: http://core.svn.wordpress.org/trunk@40108 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-06 12:55:41 +00:00
Dominik Schilling
419c8d97ce Embeds: URL encode YouTube video IDs for broader compatibility.
Built from https://develop.svn.wordpress.org/trunk@40160


git-svn-id: http://core.svn.wordpress.org/trunk@40099 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-06 11:42:40 +00:00
Jeremy Felt
28f838ca3e Validate video and audio metadata.
Built from https://develop.svn.wordpress.org/trunk@40148


git-svn-id: http://core.svn.wordpress.org/trunk@40087 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-06 08:01:43 +00:00
Boone Gorges
2282cd8cf1 Taxonomy: When querying terms, ensure $taxonomies is an array.
This avoids PHP notices that otherwise arise when no `taxonomy`
parameter is passed to `get_terms()` or `WP_Term_Query`.

Props dlh.
Fixes #39932.
Built from https://develop.svn.wordpress.org/trunk@40147


git-svn-id: http://core.svn.wordpress.org/trunk@40086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-03 03:02:43 +00:00
Boone Gorges
b6572af5d2 Taxonomy: Improve 'Parent' label when editing taxonomy terms.
Instead of the hardcoded 'Parent', use the `parent_item` label.

Props abrain, dlh.
Fixes #34545.
Built from https://develop.svn.wordpress.org/trunk@40146


git-svn-id: http://core.svn.wordpress.org/trunk@40085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-03 02:54:42 +00:00
Boone Gorges
ac6a3c76e4 Taxonomy: Take 'parent' into account when checking for terms with duplicate names.
Terms with duplicate names are not allowed at the same level of a
taxonomy hierarchy. The name lookup introduced in [34809] did not
properly account for the 'parent' parameter, with the result that
the duplicate-name restriction was tighter than intended (terms
with duplicate names could not be created at different levels of
a single hierarchy).

Props mikejolley.
Fixes #39984.
Built from https://develop.svn.wordpress.org/trunk@40145


git-svn-id: http://core.svn.wordpress.org/trunk@40084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-03 02:50:41 +00:00
Boone Gorges
5ac6ecab48 Taxonomy: Improve precision of duplicate name checks when inserting terms.
`wp_insert_term()` does not allow for terms with the same name to exist
at the same hierarchy level, unless the second term has a unique slug.
When this logic was refactored in [31792] and [34809], a bug was
introduced whereby it was possible to bypass the no-same-named-sibling
check in cases where the first term had a non-auto-generated slug
(ie, where the name was 'Foo' but the slug something other than 'foo',
such that the second term would get the non-matching slug 'foo').

This changeset fixes this issue by ensuring that the duplicate name
check runs both in cases where there's an actual slug clash *and* in
cases where no explicit `slug` has been provided to `wp_insert_term()`.
The result is a more reliable error condition:
`wp_insert_term( 'Foo' ... )` will always fail if there's a sibling
'Foo', regardless of the sibling's slug.

Props mikejolley.
See #39984.
Built from https://develop.svn.wordpress.org/trunk@40144


git-svn-id: http://core.svn.wordpress.org/trunk@40083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-03 02:40:45 +00:00
Boone Gorges
d29924e496 Improve formatting in wp_term_is_shared() docblock.
Props netweb.
Fixes #40004.
Built from https://develop.svn.wordpress.org/trunk@40143


git-svn-id: http://core.svn.wordpress.org/trunk@40080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-02 02:28:41 +00:00
Boone Gorges
04a7ef2b67 Tests: Starter content tests should use copies of images stored in /tmp.
This ensures that generated thumbnails are kept out of the version-
controlled `DIR_TESTDATA` directory.

Props bor0.
Fixes #40008.
Built from https://develop.svn.wordpress.org/trunk@40142


git-svn-id: http://core.svn.wordpress.org/trunk@40079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-02 02:26:44 +00:00
John Blackbourn
ae890935b3 Build/Test Tools: Only attempt to disable Xdebug on stable builds of PHP.
Unstable builds of PHP (nightly and hhvm) don't have the Xdebug extension enabled. Attempting to disable it results in a build error.

See #39978

Built from https://develop.svn.wordpress.org/trunk@40139


git-svn-id: http://core.svn.wordpress.org/trunk@40076 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-28 00:04:44 +00:00
John Blackbourn
6a578af528 Build/Test Tools: Disable Xdebug when testing on Travis.
This should have some performance benefits, but I guess we'll need to wait and see.

See #39978

Built from https://develop.svn.wordpress.org/trunk@40138


git-svn-id: http://core.svn.wordpress.org/trunk@40075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-27 22:54:43 +00:00
Joe McGill
f8c7aa6208 Media: Skip PDF preview tests when image editor doens't support.
Following [40130] tests fail on environments that don't support PDF
previews because the expected meta data doesn't get written.

See #39875.
Built from https://develop.svn.wordpress.org/trunk@40131


git-svn-id: http://core.svn.wordpress.org/trunk@40068 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-27 17:51:45 +00:00
Joe McGill
d6bec79fe7 Media: Keep PDF previews from overwriting files.
Since support for PDF previews were added in [38949], it's possible
that the generated image file could overwrite an existing image file
with the same name. This uses `wp_unique_filename()` to avoid this
issue and adds a '-pdf' identifier on the end of filenames.

Props gitlost, derosj, mikeschroder, joemcgill.
Fixes #39875. See #31050.
Built from https://develop.svn.wordpress.org/trunk@40130


git-svn-id: http://core.svn.wordpress.org/trunk@40067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-27 15:39:47 +00:00
Mike Schroder
f780259d88 Media: After [40123], Feature check setImageOrientation.
In [40123], `WP_Image_Editor_Imagick` started using
`Imagick::setImageOrientation` and `Imagick::ORIENTATION_TOPLEFT`,
but had no equivalent feature check.

While they were introduced more than 9 years ago, it's important
to double-check everything is available before using with Imagick.

Fixes #37140.
Built from https://develop.svn.wordpress.org/trunk@40129


git-svn-id: http://core.svn.wordpress.org/trunk@40066 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-27 04:22:51 +00:00
John Blackbourn
76f44d242b Comments: When commenting on a draft post, display a friendly error message if the user can view the post.
This prevents the unhelpful white screen of death when a user who can view the post (eg. preview it) leaves a comment while the post is in draft.

Props sagarprajapati, milindmore22, mayurk, swissspidy
Fixes #39650

Built from https://develop.svn.wordpress.org/trunk@40128


git-svn-id: http://core.svn.wordpress.org/trunk@40065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-27 00:23:40 +00:00
John Blackbourn
9e095f0791 Mail: Ensure entities in the site title are decoded when used in the body of the new user email.
Props ajoah
Fixes #39446

Built from https://develop.svn.wordpress.org/trunk@40127


git-svn-id: http://core.svn.wordpress.org/trunk@40064 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-26 22:20:44 +00:00
Andrea Fercia
c3a2b57241 Media: Restore correct upload errors displaying after [37610].
Props codegeass, MatheusGimenez, joemcgill.
Fixes #39516.

Built from https://develop.svn.wordpress.org/trunk@40126


git-svn-id: http://core.svn.wordpress.org/trunk@40063 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-26 18:15:43 +00:00
Joe McGill
8e56992132 Media: Fix unit tests for MIME checks on multisite.
A few of the multisite tests were failing after [40124] because
multisite filters `upload_mimes` with the `check_upload_mimes()`
function to reduce the set of allowed MIME types. This fixes those
errors by skipping the tests for adding additional MIME types and
only tests file types assumed to be allowed.

See #39550.
Built from https://develop.svn.wordpress.org/trunk@40125


git-svn-id: http://core.svn.wordpress.org/trunk@40062 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-26 16:06:45 +00:00
Joe McGill
87ad9e31ab Media: Reduce failing uploads following 4.7.1.
[39831] introduced more strict MIME type checking for uploads, which
resulted in unintetionally blocking several filetypes that were
previously valid. This change uses  a more targeted approach to MIME
validation to restore previous behavior for most types.

Props blobfolio, iandunn, ipstenu, markoheijnen, xknown, joemcgill.
Fixes #39550, #39552.
Built from https://develop.svn.wordpress.org/trunk@40124


git-svn-id: http://core.svn.wordpress.org/trunk@40061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-25 16:08:44 +00:00
Mike Schroder
454acad22e Media: Reset Exif orientation after rotate in WP_Image_Editor_Imagick.
Due to inconsistencies in the way browsers handle Exif orientation data,
if a user manually rotates an image within WordPress, set the Exif orientation to
the default (1) so that the image displays with the same rotation/flip in every browser.

Props sanchothefat, triplejumper12, joemcgill, azaozz, markoheijnen, mikeschroder.
See #14459.
Fixes #37140.
Built from https://develop.svn.wordpress.org/trunk@40123


git-svn-id: http://core.svn.wordpress.org/trunk@40060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-25 05:26:41 +00:00
James Nylen
0c005fdb0e REST API: Fix behavior of sticky posts filter when no posts are sticky.
Previously, when getting posts from the API with `sticky=true`, if there were no sticky posts set, the query would return all posts  as if the `sticky` argument was not set.  In this situation, the query should return an empty array instead.

A `sticky=true` query that should return an empty array (in the previous situation, or with `include` and no intersecting post IDs) was also broken in that it would query the post with ID 1.

Finally, this commit significantly improves test coverage for the `sticky` filter argument, including direct testing of the `WHERE` clauses generated by `WP_Query`.

Props ryelle.
Fixes #39947.

Built from https://develop.svn.wordpress.org/trunk@40122


git-svn-id: http://core.svn.wordpress.org/trunk@40059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-25 05:03:42 +00:00
James Nylen
a5ad623bfd REST API: Update the client test fixtures after changes to post formats.
This commit updates the `wp-api-generated.js` fixture file after recent changes to the way post formats work in the API.

See #39232.

Built from https://develop.svn.wordpress.org/trunk@40121


git-svn-id: http://core.svn.wordpress.org/trunk@40058 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-25 04:46:41 +00:00
James Nylen
889c790eb6 REST API: Allow setting post formats even if they are not supported by the theme.
A `post_format` not used by the current theme, but supported by core is not a wrong/broken piece of information.  It's just not used at this point in time.  Therefore we should allow setting and retrieving any of the standard post formats supported in core, even if the current theme doesn't use them.

After this commit, a post's `format` value can survive a round trip through the API, which is a good general design principle for an API.

Props JPry, iseulde, davidakennedy, Drivingralle.
Fixes #39232.

Built from https://develop.svn.wordpress.org/trunk@40120


git-svn-id: http://core.svn.wordpress.org/trunk@40057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-24 23:30:44 +00:00
Sergey Biryukov
d303e3d9ca Plugins: After [38703], adjust the selector for checkbox selection to account for nested tables.
Props afercia, swissspidy, reldev.
Fixes #39739.
Built from https://develop.svn.wordpress.org/trunk@40118


git-svn-id: http://core.svn.wordpress.org/trunk@40055 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-24 23:10:44 +00:00
Andrew Ozz
9c1d14b875 TinyMCE: preserve empty image alt attributes.
Props afercia.
Fixes #39912 for trunk.
Built from https://develop.svn.wordpress.org/trunk@40110


git-svn-id: http://core.svn.wordpress.org/trunk@40047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-24 20:41:43 +00:00
Adam Silverstein
bc1fc91ec8 REST API: JS client - QUnit tests for custom namespace route discovery.
Add QUnit tests for the parsing of custom namespace routes. Add a custom schema fixture based on the `wp-js-widgets` plugin. Test that the client can parse the widget namespace in the schema and correctly construct the expected group of models and collections. Also includes a small unrelated QUnit fix to ensure nav-menu test passes when it is loaded without its tests executing as well as a small jshint fix, adding a missing semicolon since [40107].

Props jnylen0.
Fixes #39561.

Built from https://develop.svn.wordpress.org/trunk@40109


git-svn-id: http://core.svn.wordpress.org/trunk@40046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-24 18:40:40 +00:00
James Nylen
78b298f0f3 REST API: Shim post_date_gmt for drafts / empty dates in the REST API.
Internally, WordPress uses a special `post_date_gmt` value of `0000-00-00 00:00:00` to indicate that a draft's date is "floating" and should be updated whenever the post is saved.  This makes it much more difficult for API clients to know the correct date of a draft post.

This commit provides a best guess at a `date_gmt` value for draft posts in this situation using the `date` field and the site's current timezone offset.

Props joehoyle.
Fixes #38883.

Built from https://develop.svn.wordpress.org/trunk@40108


git-svn-id: http://core.svn.wordpress.org/trunk@40045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-24 18:15:44 +00:00
Adam Silverstein
33286df4c1 Themes: enable browser history support in add new theme screen.
Enable history support for the new theme screen, including navigating theme details and closing the details modal. Theme selection is now also bookmark-able, so linking to a URL like `/wp-admin/theme-install.php?theme=twentyseventeen` correctly opens the theme preview.

Props dd32.
Fixes #36613.

Built from https://develop.svn.wordpress.org/trunk@40107


git-svn-id: http://core.svn.wordpress.org/trunk@40044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-24 17:48:42 +00:00
Felix Arntz
eb8457d3f4 REST API: Do not allow access to users from a different site in multisite.
It has been unintendedly possible to both view and edit users from a different site than the current site in multisite environments. Moreover, when passing roles to a user in an update request, that user would implicitly be added to the current site.

This changeset removes the incorrect behavior for now in order to be able to provide a proper REST API workflow for managing multisite users in the near future. Related unit tests have been adjusted as well.

Props jnylen0, jeremyfelt, johnjamesjacoby.
Fixes #39701.

Built from https://develop.svn.wordpress.org/trunk@40106


git-svn-id: http://core.svn.wordpress.org/trunk@40043 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-23 22:37:44 +00:00
James Nylen
7d421b2042 REST API: Correctly parse body parameters for DELETE requests.
DELETE was inadvertently omitted from the list of non-POST HTTP methods that should be able to accept body parameters.  Parameters passed to DELETE requests as JSON are already parsed correctly; this commit fixes `application/x-www-form-urlencoded` parameters as well.

Props mnelson4.
Fixes #39933.

Built from https://develop.svn.wordpress.org/trunk@40105


git-svn-id: http://core.svn.wordpress.org/trunk@40042 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-23 20:10:44 +00:00
James Nylen
6e9d23220a REST API: Ensure that tests pass if extra endpoints are registered.
Many plugins and themes use the WP core test suite to run their unit tests, so the API tests shouldn't fail if there are extra endpoints registered in non-core namespaces.

Props rachelbaker.
Fixes #39264.

Built from https://develop.svn.wordpress.org/trunk@40104


git-svn-id: http://core.svn.wordpress.org/trunk@40041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-23 15:50:46 +00:00
Sergey Biryukov
564d6a0c90 Docs: Update the description of is_singular() and WP_Query::is_singular() to be parsed correctly by developer.wordpress.org.
Props grapplerulrich.
Fixes #39948.
Built from https://develop.svn.wordpress.org/trunk@40103


git-svn-id: http://core.svn.wordpress.org/trunk@40040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-23 10:30:43 +00:00
Felix Arntz
55df308b4d Multisite: Use WP_Network_Query in WP_Network::get_by_path().
An additional unit test has been introduced to verify the method works properly when using an external object cache.

Props spacedmonkey, jeremyfelt.
Fixes #37217.

Built from https://develop.svn.wordpress.org/trunk@40102


git-svn-id: http://core.svn.wordpress.org/trunk@40039 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-22 10:42:45 +00:00
James Nylen
b6ce4e2830 REST API: Fix multiple issues with setting dates of posts and comments.
This commit modifies the `rest_get_date_with_gmt` function to correctly parse local and UTC timestamps with or without timezone information.

It also ensures that the REST API can edit the dates of draft posts by setting the `edit_date` flag to `wp_update_post`.

Overall this commit ensures that post and comment dates can be set and updated as expected.

Fixes #39256.

Built from https://develop.svn.wordpress.org/trunk@40101


git-svn-id: http://core.svn.wordpress.org/trunk@40038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-21 18:18:45 +00:00
Sergey Biryukov
c4e78a8d8b About page: Remove autoplay and loop attributes on "Theme Starter Content", "Edit Shortcuts", and "Video Headers" videos, originally added as a part of [39512].
For UX and accessibility reasons, it's better to always avoid playing videos automatically.

Props bor0.
Fixes #39560.
Built from https://develop.svn.wordpress.org/trunk@40089


git-svn-id: http://core.svn.wordpress.org/trunk@40026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-20 13:01:42 +00:00
Dion Hulse
2808758334 Customize: Update the introduced version in the docs for the get_header_video_url filter to 4.7.3.
See #39512.

Built from https://develop.svn.wordpress.org/trunk@40086


git-svn-id: http://core.svn.wordpress.org/trunk@40023 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-20 06:48:08 +00:00
Weston Ruter
0343f50561 Customize: Prevent vertical clipping of thumbnail in header image customizer control.
Removes some method overrides on `wp.customize.HeaderTool.ChoiceView` introduced in [27497].

See #21785.
Props bradyvercher.
Fixes #38559.

Built from https://develop.svn.wordpress.org/trunk@40082


git-svn-id: http://core.svn.wordpress.org/trunk@40019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-20 00:10:49 +00:00
Rachel Baker
da8ae2facd REST API: Include the status property in view context responses from the Posts endpoints.
Previously the status for a Post (or other post_types) was only exposed under the `edit` context, which doesn't really make much sense considering we support querying by post status without authentication. Originally introduced in v2.0 beta 1: 69f617d749 without any explanation in the commit message.

Props dhanendran, jnylen0, rachelbaker.
Fixes #39466.

Built from https://develop.svn.wordpress.org/trunk@40080


git-svn-id: http://core.svn.wordpress.org/trunk@40017 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-19 04:32:41 +00:00
James Nylen
cf4e085207 REST API: Skip generating the client test fixtures in multisite mode.
There are a couple of changes to the generated API schemas between single-site and multisite mode - for example, the `url` and `email` settings are not present in the settings endpoint (see #39005).

To avoid unexpected changes to the `wp-api-generated.js` fixture file, skip generating the client test fixtures when running the test suite in multisite mode.

See #39264.

Built from https://develop.svn.wordpress.org/trunk@40077


git-svn-id: http://core.svn.wordpress.org/trunk@40014 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-18 19:30:45 +00:00
Adam Silverstein
c7b217cee9 JavaScript: when starting Backbone history, stop if previously started.
Prevent a potential error condition if Backbone history is started by a plugin or theme before core tries to start it. 

Props tfrommen.
Fixes #39612.

Built from https://develop.svn.wordpress.org/trunk@40076


git-svn-id: http://core.svn.wordpress.org/trunk@40013 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-17 22:00:42 +00:00
Adam Silverstein
518ff1576b REST API: JavaScript client - improve route discovery for custom namespaces.
Fix parsing of custom namespace routes. Transform class names, removing dashes and capitalizing each word/route part so a route path of `widgets/recent-posts` becomes a collection with the name `WidgetsRecentPosts`. Correct parent route part when routes are longer than expected, reversing parse direction.

Props westonruter, jazbek.
Fixes #39561.

Built from https://develop.svn.wordpress.org/trunk@40074


git-svn-id: http://core.svn.wordpress.org/trunk@40011 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-17 20:54:44 +00:00
Pascal Birchler
8ce61a87f4 I18N: Update translators comment after [40072].
Props ocean90.
See #39898.
Built from https://develop.svn.wordpress.org/trunk@40073


git-svn-id: http://core.svn.wordpress.org/trunk@40010 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-17 10:21:41 +00:00
Pascal Birchler
db1ff39224 I18N: Fix broken sprintf() after [40067].
See #39898.
Built from https://develop.svn.wordpress.org/trunk@40072


git-svn-id: http://core.svn.wordpress.org/trunk@40009 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-17 10:15:44 +00:00
Dion Hulse
30cb64a011 Media: Avoid PHP Warnings in get_post_galleries() when processing empty [gallery] shortcodes and avoid returning the incorrect results when the global $post does not match the provided post ID.
Props dd32, joemcgill, seanchayes.
Fixes #39277, #39304.

Built from https://develop.svn.wordpress.org/trunk@40070


git-svn-id: http://core.svn.wordpress.org/trunk@40007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-17 06:46:42 +00:00
Dion Hulse
c50113dc8d HTTP API: Restore backwards compatibility with the http_api_curl filter - it expects that the handle parameter is passed as a reference, however [39212] missed that.
Props pento.
Fixes #39783.

Built from https://develop.svn.wordpress.org/trunk@40068


git-svn-id: http://core.svn.wordpress.org/trunk@40005 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-17 05:06:44 +00:00
Sergey Biryukov
69ab181f01 I18N: Remove <code> tags from translatable strings in wp-includes/customize/class-wp-customize-custom-css-setting.php.
Fixes #39898.
Built from https://develop.svn.wordpress.org/trunk@40067


git-svn-id: http://core.svn.wordpress.org/trunk@40004 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-17 02:23:42 +00:00
James Nylen
23e4694e0c REST API: Skip generating the client test fixtures in PHP 5.2 and 5.3.
Follow-up to [40065] - `JSON_*` constants are differently unsupported in PHP 5.2 and 5.3, which caused other, more different failures.

Also bring back `JSON_UNESCAPED_SLASHES` because the generated output looks nicer this way.

Fixes #39264.

Built from https://develop.svn.wordpress.org/trunk@40066


git-svn-id: http://core.svn.wordpress.org/trunk@40003 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-17 00:13:41 +00:00
James Nylen
cb100a0539 REST API: Fix the client test fixture generation in PHP 5.2 and 5.3.
Remove `JSON_UNESCAPED_SLASHES` from the `wp_json_encode` call - this constant is not supported in PHP < 5.4, and we don't polyfill it either.

Also make the PHPUnit test suite correctly exit with a non-zero exit code when `wp-tests-config.php` is not present.  This was causing `grunt restapi-jsclient` to incorrectly proceed to its second step even when the first step failed with this error.

Props ocean90.
Fixes #39264.

Built from https://develop.svn.wordpress.org/trunk@40065


git-svn-id: http://core.svn.wordpress.org/trunk@40002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-16 23:30:43 +00:00
Weston Ruter
34b179876e Customize: Skip intercepting non-HTTP(S) links in customizer preview just as jump links are ignored.
Ensures that links with `javascript:`, `mailto:` and other protocols work as expected in the customizer preview.

Fixes #39797.

Built from https://develop.svn.wordpress.org/trunk@40064


git-svn-id: http://core.svn.wordpress.org/trunk@40001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-16 21:21:45 +00:00
James Nylen
cb7a9a731d REST API: Cast revision author ID to int.
The `post_author` field is a string internally, but we need to cast it to an integer in the REST API.  This was already done for posts, but not for revisions.  The field is already declared as an integer in both controllers.

Fixes #39871.

Built from https://develop.svn.wordpress.org/trunk@40063


git-svn-id: http://core.svn.wordpress.org/trunk@40000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-16 20:09:45 +00:00
Sergey Biryukov
59d33e90da Docs: Correct @return value type for wp_nav_menu().
Props chesio.
Fixes #39890.
Built from https://develop.svn.wordpress.org/trunk@40062


git-svn-id: http://core.svn.wordpress.org/trunk@39999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-16 16:09:43 +00:00
Adam Silverstein
0bcfc08b3f REST API: improve test fixture generation, normalizing data.
Add a data normalization pass when generating data fixtures for the REST API endpoints. Ensures that the `wp-api-generated.js` fixture won't change between test runs. Set more default properties and use fixed values for any properties that can't be easily controlled (object IDs and derivatives like link). Generate the fixture file with JSON_PRETTY_PRINT so that future diffs are easier to follow.

Props jnylen0, netweb.
Fixes #39264.

Built from https://develop.svn.wordpress.org/trunk@40061


git-svn-id: http://core.svn.wordpress.org/trunk@39998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-15 17:59:42 +00:00
Adam Silverstein
e322b0eb77 Media: debounce the media grid search, avoiding duplicate requests.
Add a debounce wrapper to the media grid search handler. The search callback is now fired after a 300 ms typing pause.

Remove redundant handlers for 'search' and 'change', preventing multiple/duplicate search callbacks.

Props certainstrings, joemcgill, Kelderic, batmoo.
Fixes #38911.

Built from https://develop.svn.wordpress.org/trunk@40060


git-svn-id: http://core.svn.wordpress.org/trunk@39997 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-15 17:29:44 +00:00
Andrea Fercia
ca44bbd134 Buttons: Fix a few .button-link glitches after [40052].
Removes some stray underlines. Explicitly set the button text to be left aligned.

Props Cheffheid, f.staude, Presskopp.

See #34242.
Fixes #35126, #38712.

Built from https://develop.svn.wordpress.org/trunk@40059


git-svn-id: http://core.svn.wordpress.org/trunk@39996 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-14 18:42:46 +00:00
Adam Silverstein
1d337dec33 REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.

The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.

Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.

Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.

Props jnylen0, welcher.
Fixes #39264.


Built from https://develop.svn.wordpress.org/trunk@40058


git-svn-id: http://core.svn.wordpress.org/trunk@39995 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-14 04:23:43 +00:00
John Blackbourn
1100cca947 Themes: Add template type and template candidates as parameters to the {$type}_template filter.
Props mschadegg
Fixes #39525

Built from https://develop.svn.wordpress.org/trunk@40057


git-svn-id: http://core.svn.wordpress.org/trunk@39994 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-12 21:25:42 +00:00
James Nylen
bccb15166a WP_Query: Add tests for the combination of orderby=post__in and order.
This commit adds test cases for the interaction (or more accurately, lack of
interaction) between `orderby=post__in` and the `order` parameter.

Props fibonaccina.
See #39055.

Built from https://develop.svn.wordpress.org/trunk@40056


git-svn-id: http://core.svn.wordpress.org/trunk@39993 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-12 18:07:42 +00:00
Weston Ruter
f3644a702e Customize: Ensure edit shortcuts get re-created for nested partials when a parent partial is refreshed.
Fixes issue where the edit shortcut for a nav menu gets dropped when the containing Custom Menu widget is updated.

See #39101.
Fixes #39353.

Built from https://develop.svn.wordpress.org/trunk@40055


git-svn-id: http://core.svn.wordpress.org/trunk@39992 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-11 03:35:43 +00:00
Sergey Biryukov
fe0b8a2aaf Pings/Trackbacks: Avoid scheduling multiple do_pings events in _publish_post_hook().
Props ethitter.
Fixes #39828.
Built from https://develop.svn.wordpress.org/trunk@40054


git-svn-id: http://core.svn.wordpress.org/trunk@39991 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-10 03:09:43 +00:00
Sergey Biryukov
62dc0e6c57 Docs: Add missing meta_type and meta_compare arguments to WP_Term_Query::__construct() and get_terms() docblocks.
Props 1naveengiri.
Fixes #39825.
Built from https://develop.svn.wordpress.org/trunk@40053


git-svn-id: http://core.svn.wordpress.org/trunk@39990 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-10 02:28:43 +00:00
Andrea Fercia
d33301821b Buttons: Improve the .button-link CSS class for link-like buttons.
Updates `.button-link` adding color and underline to make link-like buttons look
like links by default. Introduces `.button-link-delete` as a modifier, stackable
CSS class for red button-links.

Props Cheffheid, afercia.

See #34242.
Fixes #35126.

Built from https://develop.svn.wordpress.org/trunk@40052


git-svn-id: http://core.svn.wordpress.org/trunk@39989 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-09 16:47:44 +00:00
Scott Taylor
9bf3844ef9 Media: in wp.media.view.DeleteSelectedPermanentlyButton, move destructive async operations outside of the selection loop.
Fixes #39780.

Built from https://develop.svn.wordpress.org/trunk@40051


git-svn-id: http://core.svn.wordpress.org/trunk@39988 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-08 19:44:41 +00:00
Scott Taylor
907e8cbd66 Media: in wp.media.view.Toolbar.refresh(), check for a selection before iterating over models.
Props chandrapatel.
Fixes #39511.

Built from https://develop.svn.wordpress.org/trunk@40050


git-svn-id: http://core.svn.wordpress.org/trunk@39987 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-08 19:17:43 +00:00
Pascal Birchler
71fb840a24 Taxonomy: Disallow overriding the name property when registering a taxonomy.
Props wpfo for initial patch.
Fixes #39308.
Built from https://develop.svn.wordpress.org/trunk@40049


git-svn-id: http://core.svn.wordpress.org/trunk@39986 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-06 19:39:42 +00:00
Sergey Biryukov
6de5a9f8e3 Docs: Add a note to retrieve_password_message filter that password reset email will not be sent if the filtered message is empty.
Props sudar.
Fixes #39788.
Built from https://develop.svn.wordpress.org/trunk@40048


git-svn-id: http://core.svn.wordpress.org/trunk@39985 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-06 04:16:42 +00:00
Sergey Biryukov
234f2040a8 Docs: Use third-person singular verb for rest_avatar_sizes filter description.
See #39130.
Built from https://develop.svn.wordpress.org/trunk@40047


git-svn-id: http://core.svn.wordpress.org/trunk@39984 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-06 02:58:40 +00:00
Sergey Biryukov
e29bbcd167 Docs: Use third-person singular verb for wp_get_custom_css filter description.
See #39130.
Built from https://develop.svn.wordpress.org/trunk@40046


git-svn-id: http://core.svn.wordpress.org/trunk@39983 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-06 02:57:42 +00:00
Sergey Biryukov
a972390e61 Customize: Introduce get_header_video_url filter for the return value of get_header_video_url().
Props sanket.parmar, celloexpressions.
Fixes #39512.
Built from https://develop.svn.wordpress.org/trunk@40045


git-svn-id: http://core.svn.wordpress.org/trunk@39982 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-06 02:52:41 +00:00
Pascal Birchler
a95486acdc General: Add tests for wp_parse_slug_list().
Props danielbachhuber.
See #35582.
Built from https://develop.svn.wordpress.org/trunk@40044


git-svn-id: http://core.svn.wordpress.org/trunk@39981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-05 20:35:42 +00:00
Sergey Biryukov
47aab2faad Docs: Clarify that get_the_category_list() and the_category() display links as an unordered list by default.
See #39130.
Built from https://develop.svn.wordpress.org/trunk@40043


git-svn-id: http://core.svn.wordpress.org/trunk@39980 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-05 15:16:44 +00:00
Sergey Biryukov
cff9bc5a43 Docs: Clarify that has_excerpt() checks if the post has a custom excerpt, not some generated excerpt.
See #35487.
Built from https://develop.svn.wordpress.org/trunk@40042


git-svn-id: http://core.svn.wordpress.org/trunk@39979 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-05 14:35:46 +00:00
Weston Ruter
85b4cddebf Customize: Extend auto-draft life of a customize_changeset post whenever modified.
Keep bumping the date for the auto-draft to preserve it from garbage-collection via `wp_delete_auto_drafts()` after 7 days.

See #30937.
Fixes #39713.

Built from https://develop.svn.wordpress.org/trunk@40041


git-svn-id: http://core.svn.wordpress.org/trunk@39978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-05 06:39:41 +00:00
Adam Silverstein
717aeab3cc REST API: JavaScript client should use _.extend when merging objects.
Correct an issue during the client's dynamic route discovery in `wp.api.utils.decorateFromRoute` where `_.union` potentially failed if used on objects.

Props ketuchetan.
Fixes #39341.


Built from https://develop.svn.wordpress.org/trunk@40040


git-svn-id: http://core.svn.wordpress.org/trunk@39977 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-03 21:46:43 +00:00
Sergey Biryukov
8f855f46b0 Media: In wp_unique_filename(), use explicit type casting when incrementing $number.
This prevents the "non-numeric value encountered" warning in PHP 7.1, caused by trying to increment an empty string on the first loop iteration.

Props drrobotnik for initial patch.
Fixes #39774.


Built from https://develop.svn.wordpress.org/trunk@40039


git-svn-id: http://core.svn.wordpress.org/trunk@39976 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-03 20:58:42 +00:00
Sergey Biryukov
e0e9568e24 REST API: After [38947], improve the wording of the message to clarify that rest_authentication_errors is a filter.
See #38446.
Built from https://develop.svn.wordpress.org/trunk@40038


git-svn-id: http://core.svn.wordpress.org/trunk@39975 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-01 21:32:47 +00:00
James Nylen
19ae50d9fa REST API: Improve posts orderby tests
This commit adds tests for `orderby=relevance` combined with a search term in the REST API.

It also improves tests for the `orderby` parameter in `WP_REST_Posts_Controller` by looking at the generated SQL query instead of creating a bunch of carefully arranged test objects.  This should be much more robust, and we can use this approach in other places (such as #39055).

Fixes #39079.

Built from https://develop.svn.wordpress.org/trunk@40037


git-svn-id: http://core.svn.wordpress.org/trunk@39974 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-01 20:32:04 +00:00
Weston Ruter
e34ee2f25b Customize: Ensure root values are accessible in multidimensional custom setting types.
Fixes bad conditions in `WP_Customize_Setting::get_root_value()` and `WP_Customize_Setting::set_root_value()`.

Props dlh.
Amends [35007].
See #32103.
Fixes #36952.

Built from https://develop.svn.wordpress.org/trunk@40036


git-svn-id: http://core.svn.wordpress.org/trunk@39973 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-01 01:40:52 +00:00
Sergey Biryukov
222ee437fe Update/Install: Give context to "Deleted! string to allow for differentiation between theme and plugin translations.
Props swissspidy.
See #39747. See #37290.
Built from https://develop.svn.wordpress.org/trunk@40035


git-svn-id: http://core.svn.wordpress.org/trunk@39972 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-31 09:59:40 +00:00
Sergey Biryukov
9264813949 Update/Install: Give context to some more install/update strings to allow for differentiation between theme and plugin translations.
Fixes #39747. See #37290.
Built from https://develop.svn.wordpress.org/trunk@40034


git-svn-id: http://core.svn.wordpress.org/trunk@39971 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-31 09:27:41 +00:00
Sergey Biryukov
a6215fd8ac I18N: Use a consistent translator comment ("accessibility text") for strings used in aria-label attributes.
See #32000.
Built from https://develop.svn.wordpress.org/trunk@40033


git-svn-id: http://core.svn.wordpress.org/trunk@39970 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-31 08:55:41 +00:00
Sergey Biryukov
cb46332a82 Text Changes: Remove periods from checkbox labels in Discussion meta box to improve consistency throughout the admin.
Checkbox labels generally don't have periods, unless it's a complete sentence.

Props juhise.
Fixes #33780.
Built from https://develop.svn.wordpress.org/trunk@40032


git-svn-id: http://core.svn.wordpress.org/trunk@39969 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-31 07:05:39 +00:00
Boone Gorges
e836e47a8a Avoid PHP notices in get_post_type_archive_template().
The function should fail more gracefully when called in the context
where `get_query_var( 'post_type' )` doesn't represent an actual post
type.

Props technopolitica, dlh.
Fixes #38374.
Built from https://develop.svn.wordpress.org/trunk@40031


git-svn-id: http://core.svn.wordpress.org/trunk@39968 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-30 19:32:42 +00:00
Peter Wilson
c957e3acb0 Feeds: Prevent empty feeds from returning 404 errors.
Partial revert of [38929].

This reverts the source code from the commit for #30210 to prevent valid but empty feeds from returning 404 file not found errors for the home and custom feeds.

The tests in the commit that remain applicable are retained.

Props pavelevap for reporting, stevenkword for initial patch.
See #30210.
Fixes #39157.

Built from https://develop.svn.wordpress.org/trunk@40030


git-svn-id: http://core.svn.wordpress.org/trunk@39967 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-29 23:09:41 +00:00
Sergey Biryukov
8e84504401 Link Manager: Correct version number for _deprecated_argument() in xfn_check().
Props grapplerulrich.
Fixes #39737.
Built from https://develop.svn.wordpress.org/trunk@40029


git-svn-id: http://core.svn.wordpress.org/trunk@39966 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-29 22:14:40 +00:00
Sergey Biryukov
9d7ea04936 I18N: Merge similar strings in _deprecated_argument() calls.
Add translator comments.

Props ramiy, SergeyBiryukov.
Fixes #39020.
Built from https://develop.svn.wordpress.org/trunk@40028


git-svn-id: http://core.svn.wordpress.org/trunk@39965 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-29 11:50:41 +00:00
Sergey Biryukov
b0bcea2a18 Docs: Clarify that wp_list_pages() and get_pages() only work with hierarchical post types.
Props doublehhh.
Fixes #39369.
Built from https://develop.svn.wordpress.org/trunk@40027


git-svn-id: http://core.svn.wordpress.org/trunk@39964 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-29 10:59:42 +00:00
Sergey Biryukov
e1906ab3f1 Embeds: After [31148], list correct method in WP_oEmbed::$compat_methods.
Props LewisCowles.
Fixes #39292.
Built from https://develop.svn.wordpress.org/trunk@40026


git-svn-id: http://core.svn.wordpress.org/trunk@39963 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-29 07:32:43 +00:00
Pascal Birchler
b076f7e4a8 Plugins: Remove trailing pipe symbol in sub navigation after updating the last plugin.
Props sagarprajapati.
Fixes #39655.
Built from https://develop.svn.wordpress.org/trunk@40025


git-svn-id: http://core.svn.wordpress.org/trunk@39962 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-28 17:01:46 +00:00
David A. Kennedy
1015c3b3a0 Twenty Seventeen: Rename "Sidebar" widget area for clarity
Renames the "Sidebar" widget area to "Blog Sidebar" and adjust its description to set better expectations for users as to where it appears in the theme.

Props apmarshall 

Fixes #39567.

Built from https://develop.svn.wordpress.org/trunk@40024


git-svn-id: http://core.svn.wordpress.org/trunk@39961 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-28 00:25:42 +00:00
David A. Kennedy
ca0274c2ce Bundled Themes: Allow category display in post preview even when only one category
The category is not shown in the preview. And because of how `themename_categorized_blog()` function in each theme returns false for 1 or fewer categories,  and in this case it won't show the new category.

The patch uses `is_preview()` to fix that in Twenty Fourteen, Fifteen and Seventeen.

Props lancewillett.

Fixes #39531.

Built from https://develop.svn.wordpress.org/trunk@40023


git-svn-id: http://core.svn.wordpress.org/trunk@39960 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-27 22:09:42 +00:00
David A. Kennedy
bccec366ca Twenty Fourteen: Fix fatal errors in WordPress versions before 4.0.0
The line of code throwing the error was introduced in WordPress 4.5 in r37040 "Customize: Require opt-in for selective refresh of widgets". Since `is_customize_preview()` was introduced in 4.0.0 and Twenty Fourteen should work from WordPress 3.6 and up, this caused the issue.

The patch adds an `is_customize_preview` function if it's missing.

Props adamsilverstein.

Fixes #39407.

Built from https://develop.svn.wordpress.org/trunk@40022


git-svn-id: http://core.svn.wordpress.org/trunk@39959 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-27 20:31:42 +00:00
Andrea Fercia
4ca4ff999a Accessibility: Make the inline uploader button a real button.
See `wp.media.view.UploaderWindow`.

Fixes #39305.

Built from https://develop.svn.wordpress.org/trunk@40021


git-svn-id: http://core.svn.wordpress.org/trunk@39958 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-27 18:32:41 +00:00
Adam Silverstein
a6d772108d Media: ensure JavaScript initialized when media edit screen is loaded directly.
Fix a JavaScript error when the media edit screen is loaded directly via a url such as `/wp-admin/post.php?post={post_id}&action=edit&image-editor`. Add a check in `imgLoaded` for `this.hold.sizer` which is set up during initialization and required for the cropping tool. Call `init` if this is undefined.

Props NoseGraze.
Fixes #38138.

Built from https://develop.svn.wordpress.org/trunk@40020


git-svn-id: http://core.svn.wordpress.org/trunk@39957 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-27 18:30:43 +00:00
Andrew Ozz
69c29935d5 TinyMCE: improve the previews for embedded WordPress posts:
- Add option to force a sandbox iframe in wpview.
- Use it to show the embedded post preview.
- Remove the deprecated `wpembed` plugin.js

Fixes #39513.
Built from https://develop.svn.wordpress.org/trunk@40019


git-svn-id: http://core.svn.wordpress.org/trunk@39956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-27 04:25:44 +00:00
Weston Ruter
b6281dbd75 Customize: Trim whitespace from nav menu item titles so that the underlying object's original title appears as input placeholder and in the control's title.
Whitespace is trimmed from titles in PHP when saved in any case, so this aligns the client-side behavior with what happens on the server.

Amends [38618].
See #38015.
Fixes #39600.

Built from https://develop.svn.wordpress.org/trunk@39994


git-svn-id: http://core.svn.wordpress.org/trunk@39931 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-26 18:08:40 +00:00
Boone Gorges
fe1e3dba98 Revert to pre-4.7 behavior for fetching object instances by id.
This changeset reverts [38381], which caused inconsistencies in the way the
REST API fetches posts and other objects.

See #38792, #37738.
Built from https://develop.svn.wordpress.org/trunk@39992


git-svn-id: http://core.svn.wordpress.org/trunk@39929 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-26 16:53:41 +00:00
Joe Hoyle
9463f7640b REST API: Fix unit tests for posts out of bounds errors
Previously we were assuming pagination headers would be sent when the request for posts is out of bounds. Instead presume it will return an error.

See #39061.
Built from https://develop.svn.wordpress.org/trunk@39991


git-svn-id: http://core.svn.wordpress.org/trunk@39928 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-26 15:16:43 +00:00
Dominik Schilling
21264a31e0 Press This: Do not show Categories & Tags UI for users who cannot assign terms to posts anyways.
Built from https://develop.svn.wordpress.org/trunk@39968


git-svn-id: http://core.svn.wordpress.org/trunk@39905 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-26 13:58:44 +00:00
Joe Hoyle
99cf07d882 REST API: Return an error if the page number is out of bounds.
Return an error from the REST API if a page number larger than the total pages count is requested.

Props morganestes.
Fixes #39061.
Built from https://develop.svn.wordpress.org/trunk@39967


git-svn-id: http://core.svn.wordpress.org/trunk@39904 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-26 13:54:41 +00:00
John Blackbourn
4482f92070 Posts, Post Types: When using Excerpt mode on the Posts list table, ensure the excerpt output matches what was manually entered into the Excerpt field.
Built from https://develop.svn.wordpress.org/trunk@39956


git-svn-id: http://core.svn.wordpress.org/trunk@39893 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-26 13:41:44 +00:00
Joe Hoyle
e357195ce3 REST API: Unify object access handling for simplicity.
Rather than repeating ourselves, unifying the access into a single method keeps everything tidy. While we're at it, add in additional schema handling for common parameters.

See #38792.
Built from https://develop.svn.wordpress.org/trunk@39954


git-svn-id: http://core.svn.wordpress.org/trunk@39891 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-26 13:39:41 +00:00
Dominik Schilling
85384297a6 Query: Ensure that queries work correctly with post type names with special characters.
Built from https://develop.svn.wordpress.org/trunk@39952


git-svn-id: http://core.svn.wordpress.org/trunk@39889 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-26 13:33:45 +00:00
Weston Ruter
a44f8db73d Customize: Always enqueue customize-preview stylesheet in the customizer preview to style selective refresh and visual edit shortcuts.
Enqueues the style along with the `customize-preview` script in the manager instead of via the `widgets` and `nav_menus` components, ensuring that the stylesheet is loaded for users who cannot manage widgets or nav menus.

Props dlh.
See #27403.
Fixes #39498.

Built from https://develop.svn.wordpress.org/trunk@39951


git-svn-id: http://core.svn.wordpress.org/trunk@39888 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-26 03:47:41 +00:00
Sergey Biryukov
d10f451770 Docs: Add missing file header to wp-admin/includes/noop.php, introduced in [34037].
Props carl-alberto.
Fixes #39690.
Built from https://develop.svn.wordpress.org/trunk@39950


git-svn-id: http://core.svn.wordpress.org/trunk@39887 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-25 23:10:43 +00:00
Peter Wilson
1a18262fd5 Menus: Prevent notice thrown in class-walker-page.php.
Calling `Walker_Page::walk()` directly was causing an `Undefined index: item_spacing` notice to be thrown, this adds an `isset()` check to prevent it.

Props bhargavbhandari90.
Fixes #39564.

Built from https://develop.svn.wordpress.org/trunk@39949


git-svn-id: http://core.svn.wordpress.org/trunk@39886 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-24 23:29:42 +00:00
Felix Arntz
832b16b966 Multisite: Show menu items in My Sites > Network Admin admin bar menu based on more precise capability checks.
Previously the menu items would all be displayed solely based on the `manage_network` capability. This change provides parity with the network admin menu.

Unit tests for the network admin menu functionality of `wp_admin_bar_my_sites_menu()` have been added.

Props chandrapatel.
Fixes #39082.

Built from https://develop.svn.wordpress.org/trunk@39948


git-svn-id: http://core.svn.wordpress.org/trunk@39885 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-24 16:29:40 +00:00
Felix Arntz
82dc367cd4 Multisite: Replace is_super_admin() with a proper capability check when showing a notice about WPLANG.
In multisite, the notice is displayed to users that have the `manage_network_options` capability. In non-multisite, the notice is displayed to users with the `manage_options` capability.

Props Dhaval Parekh.
Fixes #39207. See #37616.

Built from https://develop.svn.wordpress.org/trunk@39947


git-svn-id: http://core.svn.wordpress.org/trunk@39884 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-24 13:13:41 +00:00
Felix Arntz
34ad21bcfa Multisite: Remove unnecessary is_super_admin() check when adding an existing user to a site.
Prior to this change, a super admin user that is added to a site who they are already a member of would still get reinvited.

Props supercoder.
Fixes #39220. See #37616.

Built from https://develop.svn.wordpress.org/trunk@39946


git-svn-id: http://core.svn.wordpress.org/trunk@39883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-24 12:03:43 +00:00
Felix Arntz
36fa7f72c0 Multisite: Replace is_super_admin() with manage_network_users when trying to import new users.
Props bhargavbhandari90.
Fixes #39212. See #37616.

Built from https://develop.svn.wordpress.org/trunk@39945


git-svn-id: http://core.svn.wordpress.org/trunk@39882 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-24 11:39:40 +00:00
Felix Arntz
ff74a4cb7b Multisite: Replace is_super_admin() with manage_network when showing a message to the network administrator in wp-signup.php.
Props jignesh.nakrani.
Fixes #39209. See #37616.

Built from https://develop.svn.wordpress.org/trunk@39944


git-svn-id: http://core.svn.wordpress.org/trunk@39881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-24 11:08:42 +00:00
Felix Arntz
6fcb0e8b7f Multisite: Replace is_super_admin() with manage_network_users when trying to change the role of oneself.
Props abhishek kaushik.
Fixes #39204. See #37616.

Built from https://develop.svn.wordpress.org/trunk@39943


git-svn-id: http://core.svn.wordpress.org/trunk@39880 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-24 11:04:44 +00:00
Sergey Biryukov
64694c6742 Twenty Seventeen: Improve typography for Simplified Chinese (zh_CN).
Props ze3kr, Dharm1025.
Fixes #39379.
Built from https://develop.svn.wordpress.org/trunk@39942


git-svn-id: http://core.svn.wordpress.org/trunk@39879 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-24 07:27:44 +00:00
Sergey Biryukov
ca832f66f3 Text Changes: Add a period to the only wp_die() message that didn't have it: "Invalid plugin page".
Props Presskopp.
Fixes #39664.
Built from https://develop.svn.wordpress.org/trunk@39941


git-svn-id: http://core.svn.wordpress.org/trunk@39878 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-22 02:33:42 +00:00
Sergey Biryukov
bf1e6d1226 Docs: After [39939], "locales" should be plural.
See #39658.
Built from https://develop.svn.wordpress.org/trunk@39940


git-svn-id: http://core.svn.wordpress.org/trunk@39877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-21 17:26:41 +00:00
Sergey Biryukov
bee96601bd I18N: Add support for Bosnian locale in remove_accents().
Applies "letter D with stroke" replacement made in [38646] for Serbian (`sr_RS`) to Bosnian (`bs_BA`) as well.

Props H3llas for the report.
Fixes #39658.
Built from https://develop.svn.wordpress.org/trunk@39939


git-svn-id: http://core.svn.wordpress.org/trunk@39876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-21 17:16:43 +00:00
Sergey Biryukov
35d5918a1d Posts, Post Types: Preserve author filter in list table after entering a page number in paging input.
Props sagarprajapati.
Fixes #39523.
Built from https://develop.svn.wordpress.org/trunk@39938


git-svn-id: http://core.svn.wordpress.org/trunk@39875 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-21 02:22:26 +00:00
Sergey Biryukov
8f0e75db16 Users: Preserve role filter in list table after entering a page number in paging input.
Props kailanitish90, sagarprajapati.
Fixes #39435.
Built from https://develop.svn.wordpress.org/trunk@39937


git-svn-id: http://core.svn.wordpress.org/trunk@39874 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-21 02:21:43 +00:00
Sergey Biryukov
4fbcfe3a8c Docs: After [38672], update $type parameter description for submit_button() and get_submit_button().
Remove the mention of `secondary` and `delete` classes as core values, add `small` and `large`.

Props afercia.
Fixes #23477.
Built from https://develop.svn.wordpress.org/trunk@39936


git-svn-id: http://core.svn.wordpress.org/trunk@39873 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-20 20:37:42 +00:00
Felix Arntz
41fc0c0f5a Multisite: Replace is_super_admin() with manage_network_users when trying to add an existing user via username.
Props dhanendran.
Fixes #39202. See #37616.

Built from https://develop.svn.wordpress.org/trunk@39935


git-svn-id: http://core.svn.wordpress.org/trunk@39872 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-20 17:49:41 +00:00
Felix Arntz
c22fea9120 Multisite: Replace is_super_admin() with manage_network_users when checking for users autocomplete capabilities.
Props ashokkumar24.
Fixes #39201. See #37616.

Built from https://develop.svn.wordpress.org/trunk@39934


git-svn-id: http://core.svn.wordpress.org/trunk@39871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-20 17:43:42 +00:00
Felix Arntz
6e5cd6d397 Multisite: Replace is_super_admin() with manage_network_options in wp-admin/options.php.
Props sathyapulse.
Fixes #39200. See #37616.

Built from https://develop.svn.wordpress.org/trunk@39933


git-svn-id: http://core.svn.wordpress.org/trunk@39870 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-20 17:39:41 +00:00
Felix Arntz
dd23a8f48c Multisite: Do not check for is_super_admin() when trying to set user settings.
The checks were introduced in [22256] to prevent user settings to be set for super admins that were not a member of the current site. However the latter should apply to any kind of user, so the `is_super_admin()` check is redundant. Furthermore, removing these checks is necessary for the ongoing effort to get rid of `is_super_admin()` checks in general.

Props chandrapatel for initial patch.
Fixes #39199. See #37616.

Built from https://develop.svn.wordpress.org/trunk@39932


git-svn-id: http://core.svn.wordpress.org/trunk@39869 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-20 17:33:41 +00:00
Sergey Biryukov
e9056c039d REST API: Add group and description to WP_Test_REST_Request_Validation.
Props danielbachhuber.
Fixes #39654.
Built from https://develop.svn.wordpress.org/trunk@39931


git-svn-id: http://core.svn.wordpress.org/trunk@39868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-20 17:13:40 +00:00
Felix Arntz
c8de21c0c5 Multisite: Display correct scheme for the main site in site-info.php.
Props greatislander.
Fixes #39365.

Built from https://develop.svn.wordpress.org/trunk@39930


git-svn-id: http://core.svn.wordpress.org/trunk@39867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-20 17:03:41 +00:00
Felix Arntz
8062df694f Multisite: Correct and improve i18n strings in wp-signup.php.
The strings addressing the network administrator in `wp-signup.php` were still using the old terminology of blogs and sites. Furthermore concatenation of the strings has been removed to make them i18n-friendly.

Props jignesh.nakrani, SergeyBiryukov.
Fixes #39611.

Built from https://develop.svn.wordpress.org/trunk@39929


git-svn-id: http://core.svn.wordpress.org/trunk@39866 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-20 16:52:39 +00:00
Adam Silverstein
8d8f5616b7 Menus: trigger an event when menu items are added or removed.
Fire a `menu-item-added` event after a menu item is added to the DOM. Fire a `menu-removing-item` event before a menu item is removed from the DOM. Enables hooking into and responding to menu changes.

Props welcher, adamsilverstein.
Fixes #31218.

Built from https://develop.svn.wordpress.org/trunk@39928


git-svn-id: http://core.svn.wordpress.org/trunk@39865 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-20 16:15:42 +00:00
Sergey Biryukov
0b338e2f58 Customize: Remove redundant context for "Reorder" and "Done" strings in nav menu and widget area controls to ensure consistent translations.
Props pavelevap, Presskopp.
Fixes #33747.
Built from https://develop.svn.wordpress.org/trunk@39927


git-svn-id: http://core.svn.wordpress.org/trunk@39864 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-20 06:00:42 +00:00
Sergey Biryukov
6f8644aeb2 Media: Pass the current attachment object to display_media_states filter, for consistency with display_post_states.
Props pbiron, chriseverson.
Fixes #39628.
Built from https://develop.svn.wordpress.org/trunk@39926


git-svn-id: http://core.svn.wordpress.org/trunk@39863 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-20 05:20:41 +00:00
Sergey Biryukov
371c072b38 Media: After [36837], check the correct theme modification name for custom logo in _media_states().
Props pbiron, mitraval192.
Fixes #39627.
Built from https://develop.svn.wordpress.org/trunk@39925


git-svn-id: http://core.svn.wordpress.org/trunk@39862 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-19 02:03:41 +00:00
Weston Ruter
3e6c892f89 Customize: Allow custom post types to be used in starter content.
Changes `WP_Customize_Nav_Menus::insert_auto_draft_post()` so it can be invoked for a `post_type` that is not registered (yet).

See #38615, #38114.
Fixes #39610.

Built from https://develop.svn.wordpress.org/trunk@39924


git-svn-id: http://core.svn.wordpress.org/trunk@39861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-19 00:01:46 +00:00
Ryan McCue
1326d9e2c7 REST API: Correctly serve the index with PATH_INFO
When hitting the index, untrailingslashit() would make the REST route empty, which would then use the fallback inside WP_REST_Server. This isn't a problem most of the time, but WP_REST_Server contains a fallback to PATH_INFO. Combined with PATH_INFO permalinks, this would give a 404 on the API index, as it attempts to look up a route for "/wp-json/".

Props ccprog.
Fixes #39432.

Built from https://develop.svn.wordpress.org/trunk@39923


git-svn-id: http://core.svn.wordpress.org/trunk@39860 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-17 05:40:40 +00:00
Ryan McCue
dc133c3f2d REST API: Allow shortcircuiting rest_pre_insert_comment
rest_pre_insert_{post_type} allows returning a WP_Error from the filter to shortcircuit actually creating the object, so it makes sense to do so for comments too.

Props dspilka.
Fixes #39578.

Built from https://develop.svn.wordpress.org/trunk@39922


git-svn-id: http://core.svn.wordpress.org/trunk@39859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-17 05:18:41 +00:00
Gary Pendergast
096b09d941 dbDelta: Ignore index subparts when checking for duplicate indices.
If index lengths change in table definitions, we don't recreate the index - instead, we throw a database error, as `dbDelta()` tries to create a new index with the same name.

It's better to leave the index as is, MySQL doesn't have an efficient process for resizing indices, and dropping/creating is a slow process which we don't want to trigger automatically.

Fixes #34870.


Built from https://develop.svn.wordpress.org/trunk@39921


git-svn-id: http://core.svn.wordpress.org/trunk@39858 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-17 04:01:42 +00:00
Sergey Biryukov
3c1ce66767 Users: Introduce signup_site_meta and signup_user_meta for filtering signup metadata in wpmu_signup_blog() and wpmu_signup_user(), respectively.
Props Mista-Flo.
Fixes #39223.
Built from https://develop.svn.wordpress.org/trunk@39920


git-svn-id: http://core.svn.wordpress.org/trunk@39857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-17 03:53:42 +00:00
Sergey Biryukov
4a1108b9f9 Build/Test Tools: Add assertNotFalse() method to WP_UnitTestCase and use it where appropriate.
Props peterwilsoncc.
Fixes #39219.
Built from https://develop.svn.wordpress.org/trunk@39919


git-svn-id: http://core.svn.wordpress.org/trunk@39856 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-17 03:40:43 +00:00
Sergey Biryukov
6b89d68cc1 Build/Test Tools: Correctly reference function names in @covers entries.
Props pbearne.
Fixes #39235.
Built from https://develop.svn.wordpress.org/trunk@39918


git-svn-id: http://core.svn.wordpress.org/trunk@39855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-17 02:44:43 +00:00
Sergey Biryukov
54001e2756 List Tables: Pass the $which parameter to restrict_manage_posts filter instance in WP_Media_List_Table, missed in [37422].
Props wpsmith.
Fixes #38772.
Built from https://develop.svn.wordpress.org/trunk@39917


git-svn-id: http://core.svn.wordpress.org/trunk@39854 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-17 02:38:42 +00:00
Andrew Ozz
66a39611f6 TinyMCE: strip browser inserted <u> and <font>` tags from inside links when copying and pasting in IE and Edge.
Fixes #39570.
Built from https://develop.svn.wordpress.org/trunk@39916


git-svn-id: http://core.svn.wordpress.org/trunk@39853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-17 01:25:44 +00:00
Gary Pendergast
1071dfb4ec User Query: Cast $user_total as an int.
The `$user_total` member of `WP_User_Query`, and corresponding `get_total()` method, have always been documented as returning an `int`. `$user_total`, however, is populated by `$wpdb->get_var()`, which returns 
a string (containing an integer value). Casting the return value from `get_var()` as an `int` rectifies this discrepency.

Props runciters.
Fixes #39297.


Built from https://develop.svn.wordpress.org/trunk@39915


git-svn-id: http://core.svn.wordpress.org/trunk@39852 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-16 23:24:45 +00:00
Andrew Ozz
458746f631 Tests: wpautop() should not add extra </p> before <figcaption>.
Props pbearne.
See #39307.
Built from https://develop.svn.wordpress.org/trunk@39914


git-svn-id: http://core.svn.wordpress.org/trunk@39851 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-16 17:57:43 +00:00
James Nylen
fa20ce762a REST API: Improve test coverage of single user endpoint for public data.
Add test coverage for requests of a single user resource for authors of post types registered as:

- public = true, show_in_rest = true: success without auth.
- public = true, show_in_rest = false: fail without auth.
- public = false, show_in_rest = true: success without auth.
- public = false, show_in_rest = false: fail without auth.

See #38878.
Fixes #39546.

Built from https://develop.svn.wordpress.org/trunk@39913


git-svn-id: http://core.svn.wordpress.org/trunk@39850 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-16 16:21:43 +00:00
Andrew Ozz
85ee190163 Formatting: fix wpautop() to stop adding paragraph tags around <figcaption>.
Fixes #39307 for trunk.
Built from https://develop.svn.wordpress.org/trunk@39912


git-svn-id: http://core.svn.wordpress.org/trunk@39849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-16 01:06:40 +00:00
Andrew Ozz
ee3052fdbe Docs: some improvements/fixes for editor.js.
See #38933.
Built from https://develop.svn.wordpress.org/trunk@39911


git-svn-id: http://core.svn.wordpress.org/trunk@39848 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-16 00:49:41 +00:00
Andrew Ozz
82a8065f70 TinyMCE: ensure the inline toolbar is shown and properly positioned when there are several wpview blocks in the editor and the user selects one after the other.
Props gitlost.
Fixes #38849.
Built from https://develop.svn.wordpress.org/trunk@39910


git-svn-id: http://core.svn.wordpress.org/trunk@39847 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-16 00:22:43 +00:00
Sergey Biryukov
1ba4484186 Twenty Seventeen: Remove duplicate global $post declaration in twentyseventeen_front_page_section().
Props ixkaito.
Fixes #39590.
Built from https://develop.svn.wordpress.org/trunk@39909


git-svn-id: http://core.svn.wordpress.org/trunk@39846 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-15 12:50:39 +00:00
Sergey Biryukov
4d546a12cf I18N: Reference correct placeholder in a translator comment added in [30333].
See #30264.
Built from https://develop.svn.wordpress.org/trunk@39908


git-svn-id: http://core.svn.wordpress.org/trunk@39845 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-15 08:07:43 +00:00
Sergey Biryukov
9ba7ab1cfc Users: Display the name of user being edited on Edit User screen.
Props seanchayes.
Fixes #28182.
Built from https://develop.svn.wordpress.org/trunk@39907


git-svn-id: http://core.svn.wordpress.org/trunk@39844 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-15 07:14:39 +00:00
Sergey Biryukov
649d554294 Themes: Add a unit test for get_theme_feature_list() to make sure that the list of theme features pulled from the WordPress.org API returns the expected data structure.
Props iandunn.
Fixes #28121.
Built from https://develop.svn.wordpress.org/trunk@39906


git-svn-id: http://core.svn.wordpress.org/trunk@39843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-15 06:50:43 +00:00
Sergey Biryukov
6e3073c1eb Posts, Post Types: Increase the height of post slug input to prevent certain characters from being cut in Firefox on Windows.
Props Ankit K Gupta, Presskopp.
Fixes #28084.
Built from https://develop.svn.wordpress.org/trunk@39905


git-svn-id: http://core.svn.wordpress.org/trunk@39842 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-15 04:03:43 +00:00
Andrew Ozz
35c91b7c0d TinyMCE: prevent the inline toolbar from appearing on partially selected wpview nodes. This can happen when HTML is initially loaded in the editor and wpview is the first node, or sometimes on repeatedly pasting the same wpview.
Props gitlost.
Fixes #38849.
Built from https://develop.svn.wordpress.org/trunk@39904


git-svn-id: http://core.svn.wordpress.org/trunk@39841 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-15 03:00:43 +00:00
Andrew Ozz
45f3ee380c TinyMCE: when inserting a wpview, place the caret after is so the user can continue typing without interruption.
Props iseulde.
Fixes #39337.
Built from https://develop.svn.wordpress.org/trunk@39903


git-svn-id: http://core.svn.wordpress.org/trunk@39840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-15 02:41:40 +00:00
Andrew Ozz
90f441e1b4 TinyMCE: improve removal of spaces from empty paragraphs when loading HTML in the editor.
Fixes #39437.
Built from https://develop.svn.wordpress.org/trunk@39902


git-svn-id: http://core.svn.wordpress.org/trunk@39839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-15 02:06:41 +00:00
Sergey Biryukov
82e17902a9 Twenty Seventeen: Correct @param entries for twentyseventeen_custom_colors_css filter.
Props Soean.
Fixes #39575.
Built from https://develop.svn.wordpress.org/trunk@39901


git-svn-id: http://core.svn.wordpress.org/trunk@39838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-13 15:03:41 +00:00
Sergey Biryukov
b75023ee1a Docs: Add missing @param type for wp_cache_get_last_changed().
Props afzalmultani, Soean.
Fixes #39571.
Built from https://develop.svn.wordpress.org/trunk@39900


git-svn-id: http://core.svn.wordpress.org/trunk@39837 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-13 14:16:44 +00:00
Sergey Biryukov
d2a6ea340e REST API: Update unit tests to account for the string changes in [39896].
See #39054.
Built from https://develop.svn.wordpress.org/trunk@39899


git-svn-id: http://core.svn.wordpress.org/trunk@39836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-13 05:15:42 +00:00
Sergey Biryukov
5d83b14893 Build/Test Tools: After [29858], update .jsintrc to use spaces, not tabs.
Props netweb.
Fixes #39359.
Built from https://develop.svn.wordpress.org/trunk@39898


git-svn-id: http://core.svn.wordpress.org/trunk@39835 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-13 04:45:41 +00:00
Sergey Biryukov
2a7400c956 Administration: Improve tab character width in Plugins and Themes editor.
Props afercia.
Fixes #38684.
Built from https://develop.svn.wordpress.org/trunk@39897


git-svn-id: http://core.svn.wordpress.org/trunk@39834 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-13 04:41:41 +00:00
Sergey Biryukov
b3c28838f7 REST API: Improve error messages for number relational validation.
Props jblz.
Fixes #39054.
Built from https://develop.svn.wordpress.org/trunk@39896


git-svn-id: http://core.svn.wordpress.org/trunk@39833 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-13 04:38:40 +00:00
Sergey Biryukov
8603da629f Taxonomy: Add an explanation for "Parent" dropdown for hierarchical custom taxonomies.
Props F J Kaiser, raggedrobins, DrewAPicture, diddledan, SergeyBiryukov.
Fixes #23447.
Built from https://develop.svn.wordpress.org/trunk@39895


git-svn-id: http://core.svn.wordpress.org/trunk@39832 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-13 04:19:39 +00:00
Sergey Biryukov
139a58b70a Twenty Seventeen: Remove extra asterisk from a translator comment so the comment could be parsed correctly.
Props swissspidy.
See #39116.
Built from https://develop.svn.wordpress.org/trunk@39894


git-svn-id: http://core.svn.wordpress.org/trunk@39831 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-12 21:37:43 +00:00
Sergey Biryukov
36cb41145e Docs: In wp_set_object_terms(), add a note that passing an empty value as $terms argument will remove all related terms.
Props barryceelen.
Fixes #36690.
Built from https://develop.svn.wordpress.org/trunk@39893


git-svn-id: http://core.svn.wordpress.org/trunk@39830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-12 06:54:42 +00:00
Sergey Biryukov
a1319d63a0 Widgets: In unregister_sidebar(), rename the $name parameter to $sidebar_id for consistency with is_registered_sidebar().
Also correct the parameter type in `@param` entry.

Props Soean, tmatsuur.
Fixes #35147.
Built from https://develop.svn.wordpress.org/trunk@39892


git-svn-id: http://core.svn.wordpress.org/trunk@39829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-12 06:38:54 +00:00
Sergey Biryukov
11d81ecc7c Media: Use a consistent error message for file type errors on uploading.
Props pavelevap, jackreichert.
Fixes #33242.
Built from https://develop.svn.wordpress.org/trunk@39891


git-svn-id: http://core.svn.wordpress.org/trunk@39828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-12 06:29:43 +00:00
Sergey Biryukov
327a11ad65 Docs: Use a consistent description for $plugin parameter in various plugin API functions.
See #36333.
Built from https://develop.svn.wordpress.org/trunk@39890


git-svn-id: http://core.svn.wordpress.org/trunk@39827 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-12 06:16:41 +00:00
Sergey Biryukov
a989f0b168 Docs: Improve the DocBlock for validate_plugin().
Props theMikeD.
Fixes #36333.
Built from https://develop.svn.wordpress.org/trunk@39889


git-svn-id: http://core.svn.wordpress.org/trunk@39826 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-12 06:15:42 +00:00
Sergey Biryukov
8b9a3a08bf Docs: After [37083], change "HEX format" to "3- or 6-digit hexadecimal form" for clarity.
Props swissspidy, theMikeD.
Fixes #36336.
Built from https://develop.svn.wordpress.org/trunk@39888


git-svn-id: http://core.svn.wordpress.org/trunk@39825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-12 05:56:40 +00:00
Sergey Biryukov
351a3b6d69 Docs: Make $meta parameter description in multisite signup and registration functions more consistent.
See #38781.
Built from https://develop.svn.wordpress.org/trunk@39887


git-svn-id: http://core.svn.wordpress.org/trunk@39824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-12 05:21:41 +00:00
Sergey Biryukov
3f59be8c97 Users: In wpmu_signup_blog() and wpmu_signup_user(), pass unserialized signup meta data to after_signup_site and after_signup_user filters introduced in [34112], to match the documented value.
Props MaximeCulea.
Fixes #38781.
Built from https://develop.svn.wordpress.org/trunk@39886


git-svn-id: http://core.svn.wordpress.org/trunk@39823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-12 04:57:39 +00:00
Sergey Biryukov
a4f106ff9d I18N: Move "Site Language" setting above "Timezone".
This brings all locale-specific site settings closer together and prevents the language setting from being pushed down by unrelated settings added by plugins.

Props johnjamesjacoby.
Fixes #38562.
Built from https://develop.svn.wordpress.org/trunk@39885


git-svn-id: http://core.svn.wordpress.org/trunk@39822 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-12 04:28:40 +00:00
Sergey Biryukov
32564f9332 Themes: Use curly braces for variables inside strings in `get_page_template() to explicitly specify the end of the variable name.
Props kuck1u.
Fixes #38625.
Built from https://develop.svn.wordpress.org/trunk@39884


git-svn-id: http://core.svn.wordpress.org/trunk@39821 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-12 04:13:42 +00:00
Joe McGill
52897df8cd Media: Fix exif_imagetype check in wp_get_image_mime
This is a follow up to [39831].

Props gitlost.
See #11946.
Built from https://develop.svn.wordpress.org/trunk@39850


git-svn-id: http://core.svn.wordpress.org/trunk@39787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-11 16:36:39 +00:00
Joe McGill
0df85f5bab Tests: Replace broken codeispoetry.png file.
This also updates the test filename in
`WP_Test_REST_Attachments_Controller::test_create_item_default_filename_title()`
to accurately match the actual file name.
Built from https://develop.svn.wordpress.org/trunk@39848


git-svn-id: http://core.svn.wordpress.org/trunk@39786 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-11 16:25:41 +00:00
Aaron Campbell
daf358983c REST API: Change which users are shown in the users endpoint.
Only show users that have authored a post of a post type that has `show_in_rest` set to true.

Props rachelbaker, jnylen0.
See #38878.


Built from https://develop.svn.wordpress.org/trunk@39843


git-svn-id: http://core.svn.wordpress.org/trunk@39781 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-11 14:14:42 +00:00
Joe McGill
8eff927823 Media: Improve image filetype checking.
This adds a new function `wp_get_image_mime()` which is used by
`wp_check_filetype_and_ext()` to validate image files using
`exif_imagetype()` if available instead of `getimagesize()`.

`getimagesize()` is less performant than `exif_imagetype()` and is
dependent on GD. If `exif_imagetype()` is not available, it falls back to
`getimagesize()` as before.

If `wp_check_filetype_and_ext()` can't validate the filetype, we now return
`false` for ext/MIME values.

See #11946.
Built from https://develop.svn.wordpress.org/trunk@39831


git-svn-id: http://core.svn.wordpress.org/trunk@39769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-11 13:08:44 +00:00
Dominik Schilling
c9ea1de144 Updates: Translate plugin data on the Updates screen.
Built from https://develop.svn.wordpress.org/trunk@39808


git-svn-id: http://core.svn.wordpress.org/trunk@39746 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-11 10:37:48 +00:00
Dominik Schilling
ce7fb2934d Themes: Fix markup for theme name fallbacks.
Built from https://develop.svn.wordpress.org/trunk@39807


git-svn-id: http://core.svn.wordpress.org/trunk@39745 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-11 10:34:44 +00:00
Jeremy Felt
cea9e2dc62 Multisite: Use wp_rand() in signup key creation.
Built from https://develop.svn.wordpress.org/trunk@39795


git-svn-id: http://core.svn.wordpress.org/trunk@39733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-11 05:30:42 +00:00
Jeremy Felt
061e878881 Mail: Disable wp-mail.php when mailserver_url is mail.example.com.
Built from https://develop.svn.wordpress.org/trunk@39772


git-svn-id: http://core.svn.wordpress.org/trunk@39710 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-11 05:13:43 +00:00
Aaron Campbell
03e5c0314a Add nonce for widget accessibility mode.
Props vortfu.

See #23328.


Built from https://develop.svn.wordpress.org/trunk@39760


git-svn-id: http://core.svn.wordpress.org/trunk@39698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-11 01:32:41 +00:00
Dion Hulse
5eb452d15b Update PHPMailer to 5.2.22.
The full list of changes is available here:
https://github.com/PHPMailer/PHPMailer/compare/v5.2.21...v5.2.22

Fixes #37210 for trunk.

Built from https://develop.svn.wordpress.org/trunk@39759


git-svn-id: http://core.svn.wordpress.org/trunk@39697 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-11 01:23:41 +00:00
Sergey Biryukov
3fd9465cc1 Docs: Make @deprecated entry for wp_kses_js_entities(), deprecated in [38785], consistent with other entries.
Props stevenkword, teinertb.
Fixes #39541.
Built from https://develop.svn.wordpress.org/trunk@39758


git-svn-id: http://core.svn.wordpress.org/trunk@39696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-10 22:09:42 +00:00
Sergey Biryukov
c07571de67 Docs: Change @param type for $user_object in WP_Users_List_Table::single_row() from object to WP_User to be more accurate.
Props sebastian.pisula.
Fixes #39536.
Built from https://develop.svn.wordpress.org/trunk@39757


git-svn-id: http://core.svn.wordpress.org/trunk@39695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-10 12:45:44 +00:00
Sergey Biryukov
9234febe06 Posts, Post Types: Use an existing string for "Invalid post type" error message.
Props ramiy.
Fixes #39171.
Built from https://develop.svn.wordpress.org/trunk@39756


git-svn-id: http://core.svn.wordpress.org/trunk@39694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-10 02:40:42 +00:00
Sergey Biryukov
fd0564d2bc Docs: Remove incorrect @param tags for admin_print_footer_scripts-{$hook_suffix} and admin_footer-{$hook_suffix} dynamic actiona.
Remove `@global` tags as well as they are not suited to describe a function parameter and are documented in the description of the actions.

Props keesiemeijer.
Fixes #39527.
Built from https://develop.svn.wordpress.org/trunk@39755


git-svn-id: http://core.svn.wordpress.org/trunk@39693 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-09 14:38:41 +00:00
Sergey Biryukov
fdc2b34124 Docs: Move install_global_terms() DocBlock after the function_exists() call.
Props keesiemeijer.
Fixes #39526.
Built from https://develop.svn.wordpress.org/trunk@39754


git-svn-id: http://core.svn.wordpress.org/trunk@39692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-09 14:31:44 +00:00
Sergey Biryukov
14454e3b0b Docs: Use correct closing tag in submit_field description in comment_form().
Props truongwp.
Fixes #39508.
Built from https://develop.svn.wordpress.org/trunk@39753


git-svn-id: http://core.svn.wordpress.org/trunk@39691 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-07 14:51:44 +00:00
Sergey Biryukov
1d05544828 Twenty Seventeen: Expand a changelog entry added in [39742] with the new item name.
See #39489, [39575].
Built from https://develop.svn.wordpress.org/trunk@39752


git-svn-id: http://core.svn.wordpress.org/trunk@39690 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-07 13:12:39 +00:00
Sergey Biryukov
03c6dc1002 Customize: Correct a comment in get_theme_starter_content() added in [39561].
The item name is `link_home`, not `home_link`.

See #39104.
Built from https://develop.svn.wordpress.org/trunk@39751


git-svn-id: http://core.svn.wordpress.org/trunk@39689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-07 13:11:41 +00:00
Tammie Lister
979152be92 Twenty Seventeen: add more details about filter and requires version
The required version should be 4.7 and also adds more information to changelog.

Props @ocean90 @Presskopp


Built from https://develop.svn.wordpress.org/trunk@39744


git-svn-id: http://core.svn.wordpress.org/trunk@39684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-06 22:15:52 +00:00
Tammie Lister
b5908ad8c8 Twenty Seventeen: version bump and update changelog
Adds in changelog since last version and all the changes listed in readme.txt.
Bumps version numbers in style.css and readme.txt.

Props @ocean90


Built from https://develop.svn.wordpress.org/trunk@39742


git-svn-id: http://core.svn.wordpress.org/trunk@39682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-06 22:14:38 +00:00
Sergey Biryukov
d054731b2b Docs: Add missing @since entry for Walker::unset_children().
Props chiragpatel.
Fixes #39506.
Built from https://develop.svn.wordpress.org/trunk@39741


git-svn-id: http://core.svn.wordpress.org/trunk@39681 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-06 22:14:00 +00:00
Sergey Biryukov
6032bd6e32 Docs: Use 3-digit, x.x.x style semantic versioning for @since entries in wp-admin/js/image-edit.js.
See #38748.
Built from https://develop.svn.wordpress.org/trunk@39740


git-svn-id: http://core.svn.wordpress.org/trunk@39680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-06 22:13:20 +00:00
Sergey Biryukov
e8c65e0df1 Docs: Use 3-digit, x.x.x style semantic versioning for @since entries in wp-admin/js/word-count.js.
See #37718.
Built from https://develop.svn.wordpress.org/trunk@39739


git-svn-id: http://core.svn.wordpress.org/trunk@39679 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-06 22:12:39 +00:00
Sergey Biryukov
e654c81f10 Docs: Add documentation for wp-admin/js/editor.js.
Props terwdan, ireneyoast.
Fixes #38933.
Built from https://develop.svn.wordpress.org/trunk@39738


git-svn-id: http://core.svn.wordpress.org/trunk@39678 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-06 22:11:57 +00:00
Sergey Biryukov
008c1f7e60 Docs: Correct @access entries for WP_Locale::init() and WP_Locale::register_globals().
Props keesiemeijer.
Fixes #39504.
Built from https://develop.svn.wordpress.org/trunk@39737


git-svn-id: http://core.svn.wordpress.org/trunk@39677 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-06 22:11:16 +00:00
Sergey Biryukov
64675a6a0b Docs: Add missing @since entries for WP_Theme class methods.
Props keesiemeijer.
Fixes #39503.
Built from https://develop.svn.wordpress.org/trunk@39736


git-svn-id: http://core.svn.wordpress.org/trunk@39676 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-06 22:10:35 +00:00
Sergey Biryukov
b971410d2f Docs: Correct @access entry for WP_User::filter property.
Add missing `@since` entries for `WP_User::back_compat_keys` and `WP_User::init()`.

Props keesiemeijer, prosti.
Fixes #39502, #39278.
Built from https://develop.svn.wordpress.org/trunk@39735


git-svn-id: http://core.svn.wordpress.org/trunk@39675 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-06 22:09:55 +00:00
Sergey Biryukov
ff749bc66c Docs: Correct @access entries and duplicate hook references in WP_Customize_Selective_Refresh.
Props keesiemeijer.
Fixes #39501.
Built from https://develop.svn.wordpress.org/trunk@39734


git-svn-id: http://core.svn.wordpress.org/trunk@39674 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-06 22:09:13 +00:00
Sergey Biryukov
f6cd778c84 Twenty Seventeen: Correct @param entries for twentyseventeen_content_width, twentyseventeen_custom_colors_saturation and twentyseventeen_social_links_icons filters.
Props Jaydeep Rami, BharatKambariya.
Fixes #39488.
Built from https://develop.svn.wordpress.org/trunk@39733


git-svn-id: http://core.svn.wordpress.org/trunk@39673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-06 22:08:33 +00:00
Sergey Biryukov
2f50816f32 Twenty Seventeen: Correct @param entry for twentyseventeen_front_page_sections filter.
Props ketuchetan, priyankabehera155.
Fixes #39488.
Built from https://develop.svn.wordpress.org/trunk@39732


git-svn-id: http://core.svn.wordpress.org/trunk@39672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-06 22:07:52 +00:00
Dominik Schilling
2e81d3ed88 Twenty Seventeen: Introduce a theme-specific filter twentyseventeen_starter_content for customizing the starter content array.
Add some documentation to the default starter content.

Props sanket.parmar, celloexpressions.
Fixes #39109.
Built from https://develop.svn.wordpress.org/trunk@39720


git-svn-id: http://core.svn.wordpress.org/trunk@39660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-06 22:02:58 +00:00
Sergey Biryukov
93d4caaccd Docs: Add missing @param tag for show_post_locked_dialog filter.
Props keesiemeijer.
Fixes #39479.
Built from https://develop.svn.wordpress.org/trunk@39710


git-svn-id: http://core.svn.wordpress.org/trunk@39650 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-06 21:59:04 +00:00
Sergey Biryukov
6e5d66c10e Docs: Move install_network() DocBlock after the function_exists() call.
Props keesiemeijer.
Fixes #39478.
Built from https://develop.svn.wordpress.org/trunk@39709


git-svn-id: http://core.svn.wordpress.org/trunk@39649 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-06 21:58:23 +00:00
Sergey Biryukov
ead8c38f38 Docs: Add variable to @param entry for whitelist_options filter.
Props keesiemeijer.
Fixes #39477.
Built from https://develop.svn.wordpress.org/trunk@39708


git-svn-id: http://core.svn.wordpress.org/trunk@39648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-06 21:57:42 +00:00
Dion Hulse
9f381dbea6 Customizer: Don't query for postmeta for Custom CSS (for not-current-themes) and Customizer Changeset posts.
Props dlh.
Fixes #39194.

Built from https://develop.svn.wordpress.org/trunk@39692


git-svn-id: http://core.svn.wordpress.org/trunk@39632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-05 08:12:42 +00:00
Dion Hulse
577a192ebd Mail: In PHPMailer 5.2.7 the case of the Send() method changed to send(), update our call for consistency with the library.
Props michalzuber.
Fixes #39469.

Built from https://develop.svn.wordpress.org/trunk@39691


git-svn-id: http://core.svn.wordpress.org/trunk@39631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-05 08:10:42 +00:00
Dion Hulse
8912d6b134 Updates: Properly define $filesystemForm to handle error in modals.
Ammends [39657].
See #39057.

Built from https://develop.svn.wordpress.org/trunk@39689


git-svn-id: http://core.svn.wordpress.org/trunk@39629 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-05 07:24:43 +00:00
Weston Ruter
2ed703ed78 Customize: Ensure theme_mod-cache of custom_css lookup of -1 short-circuits a WP_Query from being made.
Props dlh.
See #35395.
Fixes #39259.

Built from https://develop.svn.wordpress.org/trunk@39688


git-svn-id: http://core.svn.wordpress.org/trunk@39628 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-05 07:13:42 +00:00
Dion Hulse
b5dbe61dab Upgrade: Fix the installation of TwentySeventeen upon upgrade from an early version.
This reverts part of [31124] which incorrectly caused `$old_wp_version` to equal the version of WordPress being upgraded to due to global variable access changes.

See #38551, #30799.
Fixes #39138 for trunk.

Built from https://develop.svn.wordpress.org/trunk@39687


git-svn-id: http://core.svn.wordpress.org/trunk@39627 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-05 06:13:41 +00:00
Weston Ruter
5468850b10 Customize: Update customize.php URL with changeset_uuid param the instant a change is made instead of deferring until the changeset update request responds.
Props asalce.
Fixes #39227.

Built from https://develop.svn.wordpress.org/trunk@39686


git-svn-id: http://core.svn.wordpress.org/trunk@39626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-05 05:18:43 +00:00
Weston Ruter
ea0f8b53f1 Customize: Remove extra left padding in core for site title and widgets in preview.
These styles should only be applied by theme stylesheets as needed.

Props sirbrillig.
Reverts parts of [39202] and [39233].
See #38651.
Fixes #39349.

Built from https://develop.svn.wordpress.org/trunk@39685


git-svn-id: http://core.svn.wordpress.org/trunk@39625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-05 04:33:43 +00:00
Ryan McCue
a676166a63 Upgrade/Install: Avoid creating nonce during installation.
When installing and using database-saved salts, wp_create_nonce() causes database errors as wp_salt() attempts to insert into the not-yet-created options table. Since authentication isn't available during installation, we can safely skip creating a nonce.

Props nullvariable, pento, dd32.
Fixes #39047.

Built from https://develop.svn.wordpress.org/trunk@39684


git-svn-id: http://core.svn.wordpress.org/trunk@39624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-05 04:11:43 +00:00
Ryan McCue
952b6873e7 Feeds: Don't override the Content-Type header inside fetc_feed()
SimplePie can set the Content-Type header automatically with the correct charset for convenience, but we already force the charset to match the site's, making it redundant at best. At worst, SimplePie incorrectly overrides the content-type for non-HTML content (such as API requests).

Props dlh, stevenkword.
Fixes #39066.

Built from https://develop.svn.wordpress.org/trunk@39681


git-svn-id: http://core.svn.wordpress.org/trunk@39621 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-05 03:06:42 +00:00
Adam Silverstein
c8a3496ebe REST API: Add error handling for fetch error in buildModelGetter of wp-api.js.
When a call to a model getter method fails, reject the returned deferred object. Enables better handling of fetch errors.

Props westonruter, adamsilverstein.
Fixes #39314.

Built from https://develop.svn.wordpress.org/trunk@39680


git-svn-id: http://core.svn.wordpress.org/trunk@39620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-05 03:03:42 +00:00
Andrew Ozz
e2166de4b0 Always add page-template-default class to the editor body when the template is not specified. This matches the behavior on the front-end.
Props timph (for the detailed bug report), azaozz.
Fixes #39368 for trunk.
Built from https://develop.svn.wordpress.org/trunk@39678


git-svn-id: http://core.svn.wordpress.org/trunk@39618 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-05 01:53:43 +00:00
Weston Ruter
ef882e918e Customize: Prevent removal of underline upon hover/focus for nav menu deletion links.
Props monikarao.
Amends [38503].
See #37527.
Fixes #39444.

Built from https://develop.svn.wordpress.org/trunk@39677


git-svn-id: http://core.svn.wordpress.org/trunk@39617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-04 19:13:40 +00:00
Sergey Biryukov
7a83036227 Docs: Correct the DocBlock for get_header_video_url().
Props keesiemeijer.
Fixes #39468.
Built from https://develop.svn.wordpress.org/trunk@39676


git-svn-id: http://core.svn.wordpress.org/trunk@39616 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-04 13:44:43 +00:00
Sergey Biryukov
64bb76d122 Docs: Correct @since and @access tags for WP_Term_Query::get_terms() and WP_Term_Query::parse_orderby_meta().
Props keesiemeijer.
Fixes #39467.
Built from https://develop.svn.wordpress.org/trunk@39675


git-svn-id: http://core.svn.wordpress.org/trunk@39615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-04 13:39:43 +00:00
Sergey Biryukov
868f642cc1 Docs: Correct @access tag for WP_Customize_Partial::id_data property.
Props keesiemeijer.
Fixes #39464.
Built from https://develop.svn.wordpress.org/trunk@39674


git-svn-id: http://core.svn.wordpress.org/trunk@39614 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-04 13:36:41 +00:00
Sergey Biryukov
88d2bb035a Docs: Add missing @since and @access tags for WP_Widget_Form_Customize_Control::to_json() and ::render_content().
Props keesiemeijer.
Fixes #39463.
Built from https://develop.svn.wordpress.org/trunk@39673


git-svn-id: http://core.svn.wordpress.org/trunk@39613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-04 13:34:44 +00:00
Sergey Biryukov
625849cc60 Docs: Add missing @since and @access tags for WP_Date_Query::is_first_order_clause().
Props keesiemeijer.
#39462.
Built from https://develop.svn.wordpress.org/trunk@39672


git-svn-id: http://core.svn.wordpress.org/trunk@39612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-04 13:26:43 +00:00
Sergey Biryukov
fd78085a92 Docs: Correct rest_insert_* duplicate hook references in REST API.
Props keesiemeijer.
Fixes #39371.
Built from https://develop.svn.wordpress.org/trunk@39671


git-svn-id: http://core.svn.wordpress.org/trunk@39611 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-04 13:23:40 +00:00
Sergey Biryukov
b737cce497 Docs: Add missing session_token_manager duplicate hook reference in wp-includes/class-wp-session-tokens.php.
Props keesiemeijer.
See #39371.
Built from https://develop.svn.wordpress.org/trunk@39670


git-svn-id: http://core.svn.wordpress.org/trunk@39610 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-04 13:22:42 +00:00
Sergey Biryukov
d16bdab87d Docs: Correct comment_email duplicate hook reference in wp-admin/includes/class-wp-comments-list-table.php.
Props keesiemeijer.
See #39371.
Built from https://develop.svn.wordpress.org/trunk@39669


git-svn-id: http://core.svn.wordpress.org/trunk@39609 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-04 13:21:41 +00:00
Sergey Biryukov
179a40d969 Docs: Add missing duplicate hook references in wp-admin/includes/ajax-actions.php.
Props keesiemeijer.
See #39371.
Built from https://develop.svn.wordpress.org/trunk@39668


git-svn-id: http://core.svn.wordpress.org/trunk@39608 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-04 13:20:44 +00:00
Sergey Biryukov
f3a9d2bd9a I18N: Add post type context to "Featured Image" post labels.
Fixes #39458.
Built from https://develop.svn.wordpress.org/trunk@39667


git-svn-id: http://core.svn.wordpress.org/trunk@39607 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-04 08:40:41 +00:00
Sergey Biryukov
962db75ace Posts, Post Types: Add a @since entry for archives post type label introduced in [35382].
See #16075.
Built from https://develop.svn.wordpress.org/trunk@39666


git-svn-id: http://core.svn.wordpress.org/trunk@39606 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-04 08:21:43 +00:00
Dion Hulse
5eb2277dce Shortcodes: Clarify the docs for pre_do_shortcode_tag and do_shortcode_tag.
Props dhanendran.
Fixes #39294.

Built from https://develop.svn.wordpress.org/trunk@39665


git-svn-id: http://core.svn.wordpress.org/trunk@39605 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-03 04:00:18 +00:00
Boone Gorges
324e79a506 Ignore the 'comment_order' setting when determining comment pagination.
[38740] incorrectly introduced logic that changed a comment's page when
'comment_order' was set to 'desc'. This is in violation of the design
of the comment pagination system: a comment's page is designed not to
change when 'comment_order' or 'default_comment_page' are changed.
See #31101.

Props rachelbaker.
Fixes #39280.
Built from https://develop.svn.wordpress.org/trunk@39663


git-svn-id: http://core.svn.wordpress.org/trunk@39603 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-02 20:00:31 +00:00
Boone Gorges
5fc3bbbfd2 Don't double-escape terms payload in WP_Tax_Query::transform_query().
`terms` values are passed through `sanitize_term_field()` with the 'db'
flag, which add slashes. Because `terms` are subsequently run through
`esc_sql()`, these slashes must be removed. See [36348], which added
a similar step to sanitization in `get_terms()`.

Props bcworkz.
Fixes #39315.
Built from https://develop.svn.wordpress.org/trunk@39662


git-svn-id: http://core.svn.wordpress.org/trunk@39602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-02 19:40:19 +00:00
Rachel Baker
66551de94c REST API: Add missing assertions to the view and embed context response data for the Users Controller.
Adds tests for responses where `context != 'edit'` the following properties are not included in the response data:
- `email`
- `locale`
- `registered_date`

Props thepelkus, jnylen0.
Fixes #39399.

Built from https://develop.svn.wordpress.org/trunk@39660


git-svn-id: http://core.svn.wordpress.org/trunk@39600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-02 18:43:44 +00:00
Rachel Baker
5c5dbc95f4 General: Update copyright year to 2017 in license.txt.
Props Nikschavan.
Fixes #39433.

Built from https://develop.svn.wordpress.org/trunk@39659


git-svn-id: http://core.svn.wordpress.org/trunk@39599 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-02 17:58:42 +00:00
Dion Hulse
05f07e13d9 Updates: Show the Authentication key settings after selecting the SSH transport in both the modal, and also on the plugin/theme updates screen.
Props afercia.
Fixes #39057 for trunk.

Built from https://develop.svn.wordpress.org/trunk@39657


git-svn-id: http://core.svn.wordpress.org/trunk@39597 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-30 07:44:41 +00:00
Dion Hulse
6066654967 Updates: Remove a stray " from a tag.
Props afercia.
See #39057.

Built from https://develop.svn.wordpress.org/trunk@39656


git-svn-id: http://core.svn.wordpress.org/trunk@39596 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-30 07:42:42 +00:00
Dion Hulse
1a40f6b7ae Mail: Ensure that any phpmailerException exceptions generated by setFrom() are caught to avoid PHP Fatal errors.
This change avoids a PHP fatal error that can be encountered when the specified (or generated) source email is an invalid address, such as `wordpress@_`, it makes no effort to set a valid source, only avoid the fatal error.

See #25239 for correcting the email address.
Fixes #39360.

Built from https://develop.svn.wordpress.org/trunk@39655


git-svn-id: http://core.svn.wordpress.org/trunk@39595 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-30 06:44:40 +00:00
Peter Wilson
25e462dbe7 Taxonomy: Redirect to current taxonomy when adding a term without AJAX.
Fixes a regression in which adding terms via a full page refresh, ie without AJAX, would always redirect to the tags taxonomy.

Props szaqal21.
Fixes #39328 for trunk.

Built from https://develop.svn.wordpress.org/trunk@39649


git-svn-id: http://core.svn.wordpress.org/trunk@39589 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-30 03:11:42 +00:00
Rachel Baker
c6f8182eb0 REST API: Merge similiar error message strings in the Terms Controller.
Replaces the "doesn't" contraction with "does not" to be consistent with similar strings in `WP_Error` messages when a specified term or parent term is missing in `WP_REST_Terms_Controller`.

Props ramiy, ocean90.
Fixes #39176.

Built from https://develop.svn.wordpress.org/trunk@39648


git-svn-id: http://core.svn.wordpress.org/trunk@39588 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-29 18:45:40 +00:00
Rachel Baker
158f302112 REST API: Add the supports property to the Post Type response object.
Includes a new `supports` property in the response object and schema for the `/types` endpoints for users with the `edit_posts` capability for the given post type. The `supports` property returns an object of the features the given post type *supports*.

Props timmydcrawford, tyxla.
Fixes #39033.

Built from https://develop.svn.wordpress.org/trunk@39647


git-svn-id: http://core.svn.wordpress.org/trunk@39587 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-29 17:28:45 +00:00
Dion Hulse
24767c76d3 Upgrade PHPMailer from 5.2.14 to 5.2.21.
The full list of changes is available here:
https://github.com/PHPMailer/PHPMailer/compare/v5.2.14...v5.2.21

Props sebastian.pisula, MattyRob, sfpt, dd32.
Fixes #37210 for trunk.

Built from https://develop.svn.wordpress.org/trunk@39645


git-svn-id: http://core.svn.wordpress.org/trunk@39585 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-29 02:53:44 +00:00
Dion Hulse
4efebd4b71 Filesystem: Add return statement to WP_Filesystem_ftpsockets->rmdir
Props tymvie.
Fixes #39405.

Built from https://develop.svn.wordpress.org/trunk@39644


git-svn-id: http://core.svn.wordpress.org/trunk@39584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-28 03:52:42 +00:00
Rachel Baker
df256f9fee REST API: Remove errant annotation from test_get_items_pagination_headers() method.
Removes the debugging group notation left in the `WP_Test_REST_Users_Controller` and `WP_Test_REST_Posts_Controller` classes pagination headers method. Introduced in [38832].

Props sanket.parmar.
Fixes #39398.

Built from https://develop.svn.wordpress.org/trunk@39643


git-svn-id: http://core.svn.wordpress.org/trunk@39583 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-27 18:04:43 +00:00
Rachel Baker
82c7fd2493 Comments: Fix placement of the wp_update_comment_data filter to safeguard filtered data from triggering a database error.
Introduced in [38674], the `wp_update_comment_data` filter took place after the `$data` was sliced and prepared for the database update statement. The location of the filter assumed the result of anyone applying it would not change the data type or make structural modifications or additions to the $data array. 😅

This moves the `wp_update_comment_data` filter to take place before the `$data` is sliced and prepared for the database update statement.

Props dshanske for initial patch.

Fixes #39380.

Built from https://develop.svn.wordpress.org/trunk@39640


git-svn-id: http://core.svn.wordpress.org/trunk@39580 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-27 17:22:45 +00:00
John Blackbourn
80a839de13 Docs: Misc corrections and additions to inline documentation.
See #39130
Props keesiemeijer

Built from https://develop.svn.wordpress.org/trunk@39639


git-svn-id: http://core.svn.wordpress.org/trunk@39579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-27 09:28:40 +00:00
John Blackbourn
d327c92e4b Docs: Add and correct @since docs for a variety of functions and methods.
Props keesiemeijer, chris_dev
Fixes #39343, #39357, #39344
See #39130

Built from https://develop.svn.wordpress.org/trunk@39638


git-svn-id: http://core.svn.wordpress.org/trunk@39578 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-27 09:21:44 +00:00
Boone Gorges
a3ea7ea2e9 Taxonomy: Eliminate redundant and inaccurate dupe check when creating categories from post.php.
The `term_exists()` check is not needed because of existing dupe
checks in `wp_insert_term()`. Furthermore, `term_exists()` conflates
term names and sanitized slugs, so incorrectly marks terms like
'C' and 'C+' as duplicates of one another.

Props garyc40, SergeyBiryukov, kovshenin, MikeHansenMe.
Fixes #16567.
Built from https://develop.svn.wordpress.org/trunk@39637


git-svn-id: http://core.svn.wordpress.org/trunk@39577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-23 03:11:40 +00:00
Boone Gorges
af885f45cf Query: Improve documentation for orderby=relevance in WP_Query.
Props dots.
Fixes #39336.
Built from https://develop.svn.wordpress.org/trunk@39636


git-svn-id: http://core.svn.wordpress.org/trunk@39576 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-23 02:31:41 +00:00
David A. Kennedy
7a8e17d50a Twenty Seventeen: Fix incorrect $content_width value in theme
This addresses a major bug. Incorrectly setting the `$content_width` causes media embeds to end up with the wrong aspect ratio, among other issues. This fix uses `template_redirect`,  to ensure conditional theme tags can be used. It also defines a default value at `after_theme_setup` so that plugins have something to work with at `init`.

Props sstoqnov, laurelfulford, obenland.

Fixes #39272.

Built from https://develop.svn.wordpress.org/trunk@39635


git-svn-id: http://core.svn.wordpress.org/trunk@39575 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-22 23:24:44 +00:00
Gary Pendergast
443bcb03bd Tests: Restore the database connection earlier when switching test groups.
When plugins don't disable the `backupGlobals` PHPUnit option in their own tests, `$wpdb` is backed up and restored between classes of tests. The serialisation process used for this broke the database connection. This previously wasn't a problem, as it was reconnecting before each test.

[38398] introduced some changes that required the connection to be available in `setUpBeforeClass()`, earlier than in was previously reconnecting. This didn't cause warnings in Core, but it did cause warnings for plugins that don't disable the `backupGlobals` option.

The database connection now reconnects in `setUpBeforeClass()`. This change also fixes a few Core tests that weren't calling `parent::setUpBeforeClass()` or `parent::tearDown()` correctly.

Fixes #39327.


Built from https://develop.svn.wordpress.org/trunk@39626


git-svn-id: http://core.svn.wordpress.org/trunk@39566 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-21 04:59:43 +00:00
Boone Gorges
3ef41856bb Taxonomy: Ensure that mods to query vars in pre_term_query callbacks have an effect.
Previously, it was possible to modify the `query_vars` array, but
the changes would be ignored after `pre_term_query` had finished
running.

Props jfarthing84.
Fixes #39354.
Built from https://develop.svn.wordpress.org/trunk@39625


git-svn-id: http://core.svn.wordpress.org/trunk@39565 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-21 03:02:40 +00:00
David A. Kennedy
4177e37593 Twenty Seventeen: Hardens the logic for calling featured image in header.php
This change uses `get_queried_object_id()` here since the `$post` global may not be set before a call to `the_post()`.

Props westonruter.

Fixes #39302.

Built from https://develop.svn.wordpress.org/trunk@39624


git-svn-id: http://core.svn.wordpress.org/trunk@39564 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-20 23:00:43 +00:00
David A. Kennedy
7d70dabf59 Twenty Seventeen: Ensure functions in customize-controls.js don't count on Customizer sections always being present
Before, the code assumed the `theme_options` section is always present, but it can be removed by plugins. This way, if it is, no JavaScript errors occur.

Props westonruter.

Fixes #39335.

Built from https://develop.svn.wordpress.org/trunk@39623


git-svn-id: http://core.svn.wordpress.org/trunk@39563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-20 22:17:40 +00:00
Weston Ruter
f7ba137f19 Customize: Fix visible edit shortcuts for wp_nav_menu() instances using the menu arg (such as in the Custom Menu widget) instead of the theme_location arg.
Also fix logic for `focus-control-for-setting` handler to focus on the first control (lowest `priority` value) associated with a given setting instead of the last control encountered when iterating over all controls, as this ensures the first control in a `nav_menu` section is focused rather than the last one.

Props westonruter, sirbrillig.
See #27403.
Fixes #39101.

Built from https://develop.svn.wordpress.org/trunk@39622


git-svn-id: http://core.svn.wordpress.org/trunk@39562 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-20 22:05:43 +00:00
James Nylen
5b39869860 REST API: Improve the rest_*_collection_params filter docs and fix the terms filter.
The `rest_{$taxonomy}_collection_params` filter in 4.7 is incorrectly using
single quotes instead of double quotes, which means it is not working correctly
as a dynamic filter.  This fixes the quotes around the filter name, and also
updates the docblocks for the other 3 similar filters for better conformance to
the documentation standards.

Props shazahm1hotmailcom, JPry, jnylen0.
Fixes #39300.

Built from https://develop.svn.wordpress.org/trunk@39621


git-svn-id: http://core.svn.wordpress.org/trunk@39561 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-20 01:37:40 +00:00
James Nylen
d515e20a1a REST API: Fix PHP warnings when get_theme_support( 'post-formats' ) is not an array.
If `add_theme_support( 'post-formats' )` is called with no additional
arguments, then `get_theme_support( 'post-formats' )` returns `true` rather
than an array of supported formats.  Avoid generating PHP warnings in this
situation.

Props dreamon11, ChopinBach.
Fixes #39293.

Built from https://develop.svn.wordpress.org/trunk@39620


git-svn-id: http://core.svn.wordpress.org/trunk@39560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-20 00:56:44 +00:00
Ella Iseulde Van Dorpe
c7988f1f03 Editor: Let the Add New link disappear in DFW mode.
The link was moved outside the heading in [38983].

Fixes #39313 for trunk.


Built from https://develop.svn.wordpress.org/trunk@39619


git-svn-id: http://core.svn.wordpress.org/trunk@39559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-17 10:23:43 +00:00
David A. Kennedy
7ad554f955 Twenty Seventeen: Improves code readability and code standards in files
Adds better DocBlock comments and fixes some spacing issues based on PHP_CodeSniffer WordPress coding standards.

Props sstoqnov.

Fixes #39152.

Built from https://develop.svn.wordpress.org/trunk@39618


git-svn-id: http://core.svn.wordpress.org/trunk@39558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-16 22:08:47 +00:00
Joe McGill
efb191c2ed Media: Allow PDF fallbacks filter to process custom sizes.
This fixes an oversight in [39246], which added a hook for filtering
the array of sizes used for PDF thumbnails, but failed to provide a way
for sizes added through `add_image_size()` to be processed.

Props gitlost.
Fixes #39231. See #38594.
Built from https://develop.svn.wordpress.org/trunk@39617


git-svn-id: http://core.svn.wordpress.org/trunk@39557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-16 20:30:42 +00:00
Weston Ruter
15ddaa269e Customize: Bump wp_custom_css_cb from running at wp_head priority 11 to 101 to ensure Custom CSS overrides other CSS.
Aligns `wp_head` action priority with Jetpack's Custom CSS.

Amends [38829].
See #35395, #38672.
Fixes #39270.

Built from https://develop.svn.wordpress.org/trunk@39616


git-svn-id: http://core.svn.wordpress.org/trunk@39556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-16 07:29:42 +00:00
Dion Hulse
1d342fcdc6 Feeds: Replace the RSS2 lastBuildDate date field with the r date specifier.
See #39141.

Built from https://develop.svn.wordpress.org/trunk@39614


git-svn-id: http://core.svn.wordpress.org/trunk@39554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-16 06:42:40 +00:00
Dion Hulse
f794939ed3 Feeds: Do not translate the lastBuildDate field in RSS feeds.
Props stevenkword, dd32.
Fixes #39141

Built from https://develop.svn.wordpress.org/trunk@39613


git-svn-id: http://core.svn.wordpress.org/trunk@39553 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-16 06:39:41 +00:00
Dion Hulse
c92e916866 Media: Move a variable definition outside of conditionals to ensure it's always available.
This fixes cases where the URL to a PDF preview may be incorrectly calculated when no thumbnails were generated for the PDF (and avoids a PHP Notice at the same time).

Fixes #39250.

Built from https://develop.svn.wordpress.org/trunk@39612


git-svn-id: http://core.svn.wordpress.org/trunk@39552 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-16 06:21:41 +00:00
Adam Silverstein
bc7a03a33b WP-API: JavaScript client - fix setup of models used by wp.api.collections objects.
Correct setup for the `model` attribute of `wp.api.collections` objects. Set the collection model as a function that returns a new model of the underlying type, instead of setting it as the model prototype. Fixes an issue where models for fetched collections weren't set up properly and didn't have the expected mixin methods such as `getCategories` available.

Props jesseenterprises.
Fixes #39070.

Built from https://develop.svn.wordpress.org/trunk@39603


git-svn-id: http://core.svn.wordpress.org/trunk@39543 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-15 12:54:42 +00:00
Ella Iseulde Van Dorpe
4ec102c189 Editor: Remove target=_blank when unchecked in the link modal.
Fixes #39276 for trunk.


Built from https://develop.svn.wordpress.org/trunk@39601


git-svn-id: http://core.svn.wordpress.org/trunk@39541 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-14 20:30:44 +00:00
John Blackbourn
4548b08236 General: Use interpolation instead of concatenation for all dynamic hook names.
This fixes the rendering of the hook names on developer.wordpress.org.

Props keesiemeijer
Fixes #39148

Built from https://develop.svn.wordpress.org/trunk@39600


git-svn-id: http://core.svn.wordpress.org/trunk@39540 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-14 04:18:42 +00:00
John Blackbourn
efa99585e3 Posts, Post Types: Ensure is_page_template() can only return true when viewing a singular post query.
Props natereist, dlh
Fixes #39211

Built from https://develop.svn.wordpress.org/trunk@39599


git-svn-id: http://core.svn.wordpress.org/trunk@39539 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-14 03:43:43 +00:00
James Nylen
505e135f4c REST API: Add support for filename search in media endpoint.
In [38625], the functionality to search for attachments by filename was added
via the `posts_clauses` filter and the `_filter_query_attachment_filenames()`
function.  This moves `_filter_query_attachment_filenames()` from
`wp-admin/includes/post.php` to `wp-includes/post.php` so that it can be
applied in the same manner in the REST API media endpoint.

Props jblz, tyxla.
Fixes #39092.

Built from https://develop.svn.wordpress.org/trunk@39598


git-svn-id: http://core.svn.wordpress.org/trunk@39538 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-13 14:09:42 +00:00
James Nylen
7cc41e47ac REST API: Allow sending an empty or no-op comment update.
In general, updates that don't actually change anything should succeed.
[39371] added tests for other object types, and this commit fixes empty updates
for comments and adds the missing test.

Fixes #38700.

Built from https://develop.svn.wordpress.org/trunk@39597


git-svn-id: http://core.svn.wordpress.org/trunk@39537 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-13 13:53:45 +00:00
Gary Pendergast
7d9b5b14b5 Libraries: Update zxcvbn from version 1.0 to 4.4.1
This includes masses of bug fixes, as well as tweaks to how passwords are scored.

QUnit tests have been updated to reflect tha scoring changes.

Full changelog: https://github.com/dropbox/zxcvbn/compare/v1.0...v4.4.1

Fixes #31647.


Built from https://develop.svn.wordpress.org/trunk@39596


git-svn-id: http://core.svn.wordpress.org/trunk@39536 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-13 11:23:42 +00:00
James Nylen
d7ab7fdf5a REST API: Do not include the password argument when getting media items
Currently, `attachment` is the only post type exposed via the REST API that
does not support password protection, but it's possible for other post types to
remove password support.

Fixes #38977.

Built from https://develop.svn.wordpress.org/trunk@39595


git-svn-id: http://core.svn.wordpress.org/trunk@39535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-13 03:51:44 +00:00
James Nylen
0b599cce41 REST API: Do not error on empty JSON body
It's fairly common for clients to send `Content-Type: application/json` with an
empty body.  While technically not valid JSON, we've historically supported
this behaviour, so it shouldn't cause an error.

Props JPry.
Fixes #39150.

Built from https://develop.svn.wordpress.org/trunk@39594


git-svn-id: http://core.svn.wordpress.org/trunk@39534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-13 03:34:41 +00:00
Boone Gorges
aa644128d6 Taxonomy: Use get_term_link() instead of get_category_link() in get_term_parents_list().
`get_category_link()` is a wrapper for `get_term_link()`. Using the
unwrapped function makes more sense semantically (it's taxonomy-
agnostic) and it's also more parsimonious (the `WP_Error` check in
`get_category_link()` is redundant with similar checks just before
in `get_term_link()`).

Props keesiemeijer.
Fixes #17069.
Built from https://develop.svn.wordpress.org/trunk@39593


git-svn-id: http://core.svn.wordpress.org/trunk@39533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-13 02:57:41 +00:00
Ryan McCue
20aa5d7150 General: Correctly detect trailing newline when prepending.
We need to check that the final line is actually an artifact of explode(), not just an empty input string.

See #37082.

Built from https://develop.svn.wordpress.org/trunk@39592


git-svn-id: http://core.svn.wordpress.org/trunk@39532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-13 02:48:41 +00:00