Commit Graph

25580 Commits

Author SHA1 Message Date
Gary Pendergast
1fb36474cb FTP/PemFTP Library: Fix some PHP notices.
- `ftp_base::glob()` used `each()`, which is deprecated as of PHP 7.2.
- `ftp_base::fget()` was missing the decleration of its third parameter, `$rest`.

Props itowhid06.
See #44489.


Built from https://develop.svn.wordpress.org/branches/5.0@43848


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43677 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-31 18:15:54 +00:00
Gary Pendergast
59c4bcebcc Build Tools: Update the @wordpress packages.
Trunk now matches Gutenberg 4.2 RC1.

See #45145.


Built from https://develop.svn.wordpress.org/branches/5.0@43847


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43676 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-31 18:15:02 +00:00
danielbachhuber
bb2de34edb l10n: Avoid calling is_user_logged_in() in determine_locale().
`is_user_logged_in()` is a pluggable function, and loaded after plugins are loaded. If a plugin calls `__()` too early, `is_user_logged_in()` is missing and WordPress will fatal. `get_user_locale()` already handles this scenario for us, so it's safe to rely on exclusively.

See #44758.
Fixes #45235.

Built from https://develop.svn.wordpress.org/branches/5.0@43846


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43675 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-31 02:33:53 +00:00
Gary Pendergast
f21fbee21b Posts WordPress 5.0 Beta 2 version bump.
Built from https://develop.svn.wordpress.org/branches/5.0@43845


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43674 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-30 05:00:49 +00:00
Gary Pendergast
37177611f3 WordPress 5.0 Beta 2.
Built from https://develop.svn.wordpress.org/branches/5.0@43844


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-30 04:47:50 +00:00
Gary Pendergast
0014a77fa3 Build Tools: Update @wordpress packages.
See #45145.


Built from https://develop.svn.wordpress.org/branches/5.0@43843


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-30 03:09:58 +00:00
allancole
b8cb0e7058 Importing Twenty Nineteen, our new default theme for 2019, set for 5.0.
Let Gutenberg shine with this simple, fast, and powerful theme. Initial development occurred on GitHub. See: https://github.com/WordPress/twentynineteen

Props allancole, karmatosed, kjellr, yingling017, mrasharirfan, milana_cap, fabiankaegy, westonruter, aaronjorbin, netweb, b-07, khleomix, blowery, dereksmart, jasmussen, audrasjb, nielslange, mmaumio, dimadin, joyously, anevins12, peterwilsoncc, dannycooper, icaleb, siriokun, technosiren, travel_girl, azchughtai, ianbelanger, nadim1992, ismailelkorchi, nativeinside, chetan200891, icaleb, grapplerulrich, ocean90, joshfeck, frankew, abdulwahab610, mendezcode, eliorivero, melchoyce, joen, laurelfulford, mdawaffe, kraftbj, dsmart.

Built from https://develop.svn.wordpress.org/branches/5.0@43842


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43671 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-30 02:15:04 +00:00
Gary Pendergast
9b3cee6428 Tests: Fix failing unit tests caused by [43840].
See #45145.


Built from https://develop.svn.wordpress.org/branches/5.0@43841


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43670 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-29 08:37:29 +00:00
Gary Pendergast
ebb5e6dd0d Build Tools: Upgrade @wordpress packages to the latest version.
This also includes the new `@wordpress/format-library` and `@wordpress/notices` packages.

`package-lock.json` has been completely regenerated in this commit.

See #45145.


Built from https://develop.svn.wordpress.org/branches/5.0@43840


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43669 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-29 08:36:36 +00:00
Gary Pendergast
f2e3a6c1ac Meta boxes: Don't show the block editor incompatiblity message when it doesn't apply.
We should only be showing this message in the classic editor interface, for meta boxes that are marked as being incompatible with the block editor.

Fixes #45207.


Built from https://develop.svn.wordpress.org/branches/5.0@43839


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43668 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-29 08:31:06 +00:00
Gary Pendergast
3549683ca3 Meta boxes: Don't assume that callback args are an array.
While the documentation for `add_meta_box()` specifices that `$callback_args` should be an array, this has never been enforced, and we have workarounds in place for when it's passed as something other than an array.

Rather than break sites that are passing unexpected data, we can quietly just allow for it, instead.

Props johnjamesjacoby, birgire.
Fixes #45206.


Built from https://develop.svn.wordpress.org/branches/5.0@43838


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43667 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-29 08:30:14 +00:00
Gary Pendergast
742913ca97 Block Editor: Fix meta boxes not showing.
The block editor needs to duplicate the classic meta box behaviour, so it can extract the registered meta boxes, and import them into the block editor.

To match the classic editor behaviour as closely as possible, this moves the relevant code from the classic editor, into a new function, so it can be called by both.

Props pento, peterwilsoncc.
Fixes #45172.


Built from https://develop.svn.wordpress.org/branches/5.0@43837


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43666 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-29 08:29:23 +00:00
Gary Pendergast
d13ae6300c Build Tools: Add an npm script shortcut to run grunt.
Rather than needing to install grunt globally, this allows running grunt from `node_modules`, instead.

`npm run grunt ...` is effectively the equivalent of running `grunt ...`.

Props andrew.taylor.
See #45214.


Built from https://develop.svn.wordpress.org/branches/5.0@43836


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-29 08:28:32 +00:00
Gary Pendergast
91ce38b3d5 Build Tools: Revert [43826] and [43824].
Grabbing the packages directly from the Gutenberg repo was an interesting experiment, but it causes significant workflow issues, particular for folks using Windows.

See #45145.


Built from https://develop.svn.wordpress.org/branches/5.0@43835


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-29 08:27:39 +00:00
danielbachhuber
7136636db3 REST API: Improve performance by avoiding call_user_func().
The `get_compact_response_links()` method was introduced in WP 4.5, and this conditional is no longer necessary.

Props schlessera, timothyblynjacobs.
Fixes #45189.

Built from https://develop.svn.wordpress.org/branches/5.0@43834


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43663 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-29 00:49:40 +00:00
danielbachhuber
eea6942164 Block Editor: Preload wp/v2/media with OPTIONS for caps check.
Also introduces a `block_editor_preload_paths` filter for plugins and themes to preload additional data.

Props imath, mattheu.
Fixes #45194.

Built from https://develop.svn.wordpress.org/branches/5.0@43833


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43662 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-29 00:25:38 +00:00
Aaron Jorbin
8b7967db38 php7.3 compatibility: Fix compact throwing notices for multisite
In PHP 7.3, the compact() function has been changed to issue an E_NOTICE level error if a passed string refers to an unset variable. In previous versions of PHP, this notice was silently skipped. The full RFC can be viewed here: https://wiki.php.net/rfc/compact

By initializing these variables, they can be compacted.

Previously [43819].
See #44416.
Props desrosj.


Built from https://develop.svn.wordpress.org/branches/5.0@43832


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-26 20:18:38 +00:00
Gary Pendergast
97a88cdf69 Script Loader: Add translator comments and remove textdomains.
The inline script for `wp-date` incorrectly included a textdomain, and lacked translator comments.

Props mukesh27.
Fixes #45191, #45162.


Built from https://develop.svn.wordpress.org/branches/5.0@43831


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-26 08:16:42 +00:00
Gary Pendergast
0c54153886 Meta Boxes: Fix error when a meta box is rendered with a static method callback.
When `WP_DEBUG` is set, ensure that a static method callback is passed to `ReflectionMethod`, instead of `ReflectionFunction`.

Props DrewAPicture.
Fixes #45192.


Built from https://develop.svn.wordpress.org/branches/5.0@43830


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-26 08:12:39 +00:00
Gary Pendergast
e491b2bc6a Accessibility: Media: Improve the usage of a few label elements in the media templates.
Label elements should only be used for labelable elements.
- `Uploaded By` and `Uploaded To` aren't form controls and shouldn't be associated with labels
- changes the labels for media source, alternate sources, poster image, and tracks to solve a layout issue and explicitly associate the labels to their form fields (previously, the labels were wrapping also the Remove buttons)

Merges [42444] to the 5.0 branch.

Props Presskopp, afercia.
Fixes #38759, #40468.


Built from https://develop.svn.wordpress.org/branches/5.0@43829


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-26 07:41:45 +00:00
Sergey Biryukov
81131b0635 Tests: Use DIR_TESTDATA in test_wp_set_script_translation().
`__DIR__` is not available in PHP 5.2.x.

See #45103.
Built from https://develop.svn.wordpress.org/branches/5.0@43828


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-26 07:40:05 +00:00
Drew Jaynes
2f515c6db0 Docs: Link to the "Conditional Tags" article in the Theme Developer Handbook from the descriptions for a variety of core conditional tag functions.
These notations largely serve to direct consumers (of both the source and the parsed code reference) to extended information on individual and related conditional tags throughout WordPress. The changeset also standardizes corresponding DocBlock summaries to use third-person singular verbs.

Notations have been added for the following functions:

* comments_open()
* email exists()
* has_excerpt()
* has_post_thumbnail()
* has_tag()
* in_category()
* in_the_loop()
* is_404()
* is_active_sidebar()
* is_active_widget()
* is_admin()
* is_admin_bar_showing()
* is_archive()
* is_attachment()
* is_author()
* is_blog_installed()
* is_category()
* is_comments_popup()
* is_date()
* is_day()
* is_dynamic_sidebar()
* is_feed()
* is_front_page()
* is_home()
* is_local_attachment()
* is_main_query
* is_month()
* is_multi_author
* is_new_day()
* is_page()
* is_page_template()
* is_paged()
* is_plugin_active()
* is_plugin_active_for_network()
* is_plugin_inactive()
* is_plugin_page()
* is_post_type_archive()
* is_preview()
* is_rtl()
* is_search()
* is_single()
* is_singular()
* is_sticky()
* is_tag()
* is_tax()
* is_taxonomy_hierarchical()
* is_time()
* is_trackback()
* is_user_logged_in()
* is_year()
* pings_open()
* post_type_exists()
* taxonomy_exists()
* term_exists()
* username exists()
* wp_attachment_is_image()
* wp_script_is() 

Merges [42710] to the 5.0 branch.

Props janalwin.
Fixes #43254.

Built from https://develop.svn.wordpress.org/branches/5.0@43827


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43656 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-26 07:38:26 +00:00
atimmer
918da46df0 Build tools: Fix build after [43824].
Props omarreiss.
See #45145.

Built from https://develop.svn.wordpress.org/branches/5.0@43826


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43655 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-26 07:36:46 +00:00
herregroen
6ff1386460 I18N: Add JavaScript translation support.
Adds the `wp_set_script_translations` function which registers translations for a JavaScript file. This function takes a handle, domain and optionally a path and ensures JavaScript translation files are loaded if they exist.

Props atimmer, omarreiss, nerrad, swissspidy, ocean90.
Fixes #45103.

Built from https://develop.svn.wordpress.org/branches/5.0@43825


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43654 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-26 07:35:06 +00:00
atimmer
efb928cd0b Build tools: Clone and build from packages repo.
Instead of requiring the packages individually this commit changes it so the packages are used from the packages repository (gutenberg). This is a solution that makes updating the packages easier, as long as we don't have a monorepo to manage both WordPress & the JavaScript packages together.

Props youknowriad, gziolo, omarreiss, herregroen.
See #45145.

Built from https://develop.svn.wordpress.org/branches/5.0@43824


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43653 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-26 07:33:26 +00:00
Gary Pendergast
9295846214 Post WordPress 5.0 Beta 1 version bump.
Built from https://develop.svn.wordpress.org/branches/5.0@43823


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-24 21:54:51 +00:00
Gary Pendergast
b14ecd20f7 WordPress 5.0 Beta 1.
Built from https://develop.svn.wordpress.org/branches/5.0@43822


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43651 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-24 21:38:51 +00:00
Dominik Schilling
38c80551e6 Bundled Themes: Remove languages folder with POT file from Twenty Nineteen.
POT files are no longer required.
Built from https://develop.svn.wordpress.org/branches/5.0@43821


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43650 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-24 21:01:51 +00:00
Sergey Biryukov
bbd58a5c35 Upgrade/Install: Convert Sample Page, Hello World, and Privacy Policy to block content.
Props desrosj, garrett-eclipse, danielbachhuber.
Fixes #45151.
Built from https://develop.svn.wordpress.org/branches/5.0@43820


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43649 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-24 18:51:51 +00:00
Aaron Jorbin
9635ac49bb php7.3 compatibility: Fix compact throwing notices
In PHP 7.3, the compact() function has been changed to issue an E_NOTICE level error if a passed string refers to an unset variable. In previous versions of PHP, this notice was silently skipped. The full RFC can be viewed here: https://wiki.php.net/rfc/compact

This fixes all unit tested code that uses compact.

Props desrosj.
Fixes #44416.

Built from https://develop.svn.wordpress.org/branches/5.0@43819


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-24 16:33:52 +00:00
Gary Pendergast
50ef6331e7 Scripts: Add a missing date format to the wp-date config.
`wp-date` recently added the `datetimeAbbreviated` format, but the config wasn't sending it on page load.

Fixes #45158.


Built from https://develop.svn.wordpress.org/branches/5.0@43818


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43647 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-24 11:48:53 +00:00
atimmer
f99db02983 Build tools: Build webpack dev in grunt build.
For the WordPress zip we need both the minified and non-minified files. This is because of `SCRIPT_DEBUG`. So in `grunt build` we need to do both `grunt webpack:prod` and `grunt webpack:dev`.

Props bordoni.
Fixes #45156.

Built from https://develop.svn.wordpress.org/branches/5.0@43817


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-24 09:57:50 +00:00
Gary Pendergast
0b98b31c1f Block Editor: Remove some errant debugging included in [43815].
Props bordoni.
See #45037.


Built from https://develop.svn.wordpress.org/branches/5.0@43816


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43645 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-24 09:00:39 +00:00
Gary Pendergast
dde5487499 Editor: Minor bug fixes.
Change the default layout slightly, and tweak the HTML stored in `post_content`.

Props matveb, karmatosed, joen, youknowriad, aduth, iseulde, pento, EphoxJames, mkaz, jnylen0, notnownikki, lonelyvegan, chopinbach, njpanderson, mimo84, intronic, westonruter, mcsf, dmsnell, afercia, paulwilde, mitogh, codebykat, mrahmadawais, kopepasah, circlecube, adamsilverstein, timmydcrawford, ephox-mogran, nbachiyski, JDGrimes, laurelfulford, Soean, mapk, sirjonathan, j-falk, ryelle, helen, netweb, lamosty, willybahuaud, maurobringolf, jorbin, spocke, androb, annaharrison, Afraithe, georgeh, matt, melchoyce, nitrajka, sirreal, babbardel, arush, martinlugton, iandunn, oyously, rileybrook, azaozz, folletto, ianstewart, johnpixle, clorith, joedolson, ipstenu, mrwweb, diegoliv, jeffpaul, lukecavanagh, shaunandrews, hugobaeta, jjj, mizejewski, buzztone, jdembowski, webdevmattcrom, GaryJones, jasonagnew, dd32, ieatwebsites, gma992, swissspidy, dixitadusara, ameeker, stagger-lee, jblz, nicbertino, rahmohn, vladanost, gziolo, lancewillett, lynneux, betsela, fuyuko, msdesign21, thrijith, chanthaboune, Cloud887, hblackett, vishalkakadiya, c-shultz, nfmohit, noisysocks, omarreiss, hedgefield, hideokamoto, mirucon, nosolosw, DannyCooper, burhandodhy, zebulan, benjamin_zekavica, danielbachhuber, jorgefilipecosta, ajitbohra, bph, ChrisVanPatten, dixitadusara, antpb, mikehaydon, jahvi, floriansimeth, Mathiu, amedina, diegoreymendez, etoledom, caxco93, yoavf, welcher, bobbingwide, jonsurrell, notlaura, ocean90, eliorivero, wpscholar, Shelob9, travislopes, earnjam, designsimply, johnwatkins0, dfangstrom, igorsch, jaswrks, daniloercoli, rianrietveld, dimadin, SergioEstevao, dlocc, tinkerbelly, schlessera, sumobi, kjellr, ireneyoast, hypest, tfrommen, intronic, johnny5, samikeijonen, bpayton, atimmer, Rahmon, tg-ephox, nerrad, talldan, Xyfi.

See #45037.

Built from https://develop.svn.wordpress.org/branches/5.0@43815


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43644 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-24 06:46:40 +00:00
Gary Pendergast
abc3cdd5b1 Themes: Document the new theme features being added.
The `add_theme_support()` inline docs now includes the features that the block editor adds.

Props desrosj.
See #45134.


Built from https://develop.svn.wordpress.org/branches/5.0@43814


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43643 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-24 04:16:39 +00:00
Gary Pendergast
722f25cd97 KSES: Allow the download attribute on <a> tags.
To avoid this being a vector for bypassing the filetypes that are allowed to be uploaded, this attribute is only allowed to be added without a value.

Props kalpshit, arshidkv12, welcher, peterwilsoncc, marina_wp, pento.
See #44724.


Built from https://develop.svn.wordpress.org/branches/5.0@43813


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43642 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-24 01:19:39 +00:00
Gary Pendergast
23984141ce Styles: Add helper functions for loading block styles.
Blocks are able to register styles that used in the editor and the frontend, or only in the editor. These functions ensure the correct styles are loaded in the correct place.

See #45065.


Built from https://develop.svn.wordpress.org/branches/5.0@43812


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43641 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-24 00:36:39 +00:00
danielbachhuber
7e3414597f Meta: Allow empty strings to be set by Custom Fields meta box.
Because the REST API allows meta keys to have empty values, the Custom Fields meta box should permit the same behavior.

Props charlestonsw, soulseekah.
Fixes #43559.

Built from https://develop.svn.wordpress.org/branches/5.0@43811


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 18:56:38 +00:00
danielbachhuber
9cd179146c Embeds: Filter HTML response in oEmbed proxy controller.
Adapts the response from `WP_oEmbed_Controller::get_proxy_item()` so that the response is correctly filtered and embeds work properly in JavaSccript editors. Introduces new `get_oembed_response_data_for_url()` function for preparing internal oEmbed responses.

Props danielbachhuber, imath, swissspidy.
Fixes #45142. 

Built from https://develop.svn.wordpress.org/branches/5.0@43810


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43639 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 17:48:39 +00:00
Aaron Jorbin
634bb165bc Bundled Theme: Make twentynineteen the default theme.
After [43808], we can now make twentynineteen the default theme. Twentyseventeen has been a great default, but 5.0 and twentynineteen is guten.

Fixes #45152.

Built from https://develop.svn.wordpress.org/branches/5.0@43809


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43638 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 16:51:39 +00:00
allancole
a3ae67bd8f Importing Twenty Nineteen, our new default theme for 2019, set for 5.0.
Let Gutenberg shine with this simple, fast, and powerful theme. Initial development occurred on GitHub. See: https://github.com/WordPress/twentynineteen

Props allancole, karmatosed, kjellr, yingling017, mrasharirfan, milana_cap, fabiankaegy, westonruter, aaronjorbin, netweb, b-07, khleomix, blowery, dereksmart, jasmussen, audrasjb, nielslange, mmaumio, dimadin, joyously, anevins12.

Built from https://develop.svn.wordpress.org/branches/5.0@43808


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43637 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 15:53:44 +00:00
Gary Pendergast
46e270096b Dashboard: Remove the Try Gutenberg callout.
Block or block not. There is no try.

Props mukesh27.
See #45063.


Built from https://develop.svn.wordpress.org/branches/5.0@43807


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 11:04:40 +00:00
danielbachhuber
4521b34dca Blocks: Fix coding standards introduced in [43804].
Props Presskopp, swissspidy.
See #45098

Built from https://develop.svn.wordpress.org/branches/5.0@43806


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43635 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 10:59:40 +00:00
Gary Pendergast
b1f64a77d8 REST API: Add endpoints for blocks.
`WP_REST_Block_Renderer_Controller` allows rendering of server-side rendered blocks, whilst `WP_REST_Blocks_Controller` allows retrieving of reusable blocks.

Props desrosj, danielbachhuber, pento.
See #45065.


Built from https://develop.svn.wordpress.org/branches/5.0@43805


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 07:04:39 +00:00
Gary Pendergast
c60c870ab8 Blocks: Add the reusable block post type, wp_block.
See #45098.


Built from https://develop.svn.wordpress.org/branches/5.0@43804


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43633 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:53:38 +00:00
Gary Pendergast
8083498426 Scripts: wp-url is a dependency of wp-api-fetch.
See #45065.


Built from https://develop.svn.wordpress.org/branches/5.0@43803


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:36:38 +00:00
Gary Pendergast
86484c93cc Script Loader: Fix metadata being registered as an inline script.
[43723] included script metadata for the `wp-polyfill` script that was being registered as an inline script.

See #45065.


Built from https://develop.svn.wordpress.org/branches/5.0@43802


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:21:39 +00:00
Gary Pendergast
f6366c297f Build: Update the @wordpress/editor package.
The `@wordpress/editor` wasn't upgraded to the correct version in [43789].

This commit includes changes from the `@wordpress/block-library` upgrade in [43789], that weren't copied to the correct location in core.

This also regenerates the `package-lock.json` in Linux, which the build server requires.

See #45145.


Built from https://develop.svn.wordpress.org/branches/5.0@43801


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:16:39 +00:00
David A. Kennedy
878a6359dc Twenty Seventeen: Add styles and support for the new block-based editor.
This update adds styles and theme support related to the new block-based editor to enhance the experience of using it with Twenty Seventeen. 

These are the specific changes made to this theme:

* Add blocks.css, to style blocks on the front end, to make sure they match the theme’s existing HTML element styles.
* Add editor-blocks.css to style blocks in the editor, to make sure they match the theme’s existing HTML element styles.
* Add theme support for `editor-styles`, to pull the existing editor stylesheet into the new editor.
* Add theme support for `wp-block-styles`, to load the default block styles on the front end.

Props laurelfulford, ianbelanger, crunnells.
Fixes #45045.

Built from https://develop.svn.wordpress.org/branches/5.0@43800


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43629 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:14:17 +00:00
David A. Kennedy
5454da68ff Twenty Sixteen: Add styles and support for the new block-based editor.
This update adds styles and theme support related to the new block-based editor to enhance the experience of using it with Twenty Sixteen. 

These are the specific changes made to this theme:

* Add blocks.css, to style blocks on the front end, to make sure they match the theme’s existing HTML element styles.
* Add editor-blocks.css to style blocks in the editor, to make sure they match the theme’s existing HTML element styles.
* Add theme support for `editor-styles`, to pull the existing editor stylesheet into the new editor.
* Add theme support for `wp-block-styles`, to load the default block styles on the front end.
* Add theme support for `editor-color-palette`, to load a color palette based on the theme’s color scheme into the block-based editor.

Props laurelfulford.
Fixes #45044.

Built from https://develop.svn.wordpress.org/branches/5.0@43799


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43628 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:13:38 +00:00
David A. Kennedy
969c41a2b4 Twenty Fifteen: Add styles and support for the new block-based editor.
This update adds styles and theme support related to the new block-based editor to enhance the experience of using it with Twenty Fifteen. 

These are the specific changes made to this theme:

* Add blocks.css, to style blocks on the front end, to make sure they match the theme’s existing HTML element styles.
* Add editor-blocks.css to style blocks in the editor, to make sure they match the theme’s existing HTML element styles.
* Add theme support for `editor-styles`, to pull the existing editor stylesheet into the new editor.
* Add theme support for `wp-block-styles`, to load the default block styles on the front end.
* Add theme support for `editor-color-palette`, to load a color palette based on the theme’s color scheme into the block-based editor.

Props laurelfulford.
Fixes #45043.

Built from https://develop.svn.wordpress.org/branches/5.0@43798


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43627 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:13:00 +00:00
David A. Kennedy
283a3791ef Twenty Fourteen: Add styles and support for the new block-based editor.
This update adds styles and theme support related to the new block-based editor to enhance the experience of using it with Twenty Fourteen. 

These are the specific changes made to this theme:

* Add blocks.css, to style blocks on the front end, to make sure they match the theme’s existing HTML element styles.
* Add editor-blocks.css to style blocks in the editor, to make sure they match the theme’s existing HTML element styles.
* Add theme support for `editor-styles`, to pull the existing editor stylesheet into the new editor.
* Add theme support for `wp-block-styles`, to load the default block styles on the front end.
* Add theme support for `editor-color-palette`, to load a color palette based on the theme’s color scheme into the block-based editor.

Props laurelfulford, crunnells, ianbelanger.
Fixes #45042.

Built from https://develop.svn.wordpress.org/branches/5.0@43797


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:12:20 +00:00
David A. Kennedy
3ad030877b Twenty Thirteen: Add styles and support for the new block-based editor.
This update adds styles and theme support related to the new block-based editor to enhance the experience of using it with Twenty Thirteen. 

These are the specific changes made to this theme:

* Add blocks.css, to style blocks on the front end, to make sure they match the theme’s existing HTML element styles.
* Add editor-blocks.css to style blocks in the editor, to make sure they match the theme’s existing HTML element styles.
* Add theme support for `editor-styles`, to pull the existing editor stylesheet into the new editor.
* Add theme support for `wp-block-styles`, to load the default block styles on the front end.
* Add theme support for `editor-color-palette`, to load a color palette based on the theme’s color scheme into the block-based editor.
* Add theme support and styles for `align-wide`, to allow wide and full alignment styles on the blocks.

Props laurelfulford, ianbelanger.
Fixes #45041.

Built from https://develop.svn.wordpress.org/branches/5.0@43796


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:11:39 +00:00
David A. Kennedy
7c3565dd99 Twenty Twelve: Add styles and support for the new block-based editor.
This update adds styles and theme support related to the new block-based editor to enhance the experience of using it with Twenty Twelve. 

These are the specific changes made to this theme:

* Add blocks.css, to style blocks on the front end, to make sure they match the theme’s existing HTML element styles.
* Add editor-blocks.css to style blocks in the editor, to make sure they match the theme’s existing HTML element styles.
* Add theme support for `editor-styles`, to pull the existing editor stylesheet into the new editor.
* Add theme support for `wp-block-styles`, to load the default block styles on the front end.
* Add theme support for `editor-color-palette`, to load a color palette based on the theme’s color scheme into the block-based editor.

Props ianbelanger, crunnells, laurelfulford.
Fixes #45040.

Built from https://develop.svn.wordpress.org/branches/5.0@43795


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:10:58 +00:00
David A. Kennedy
92f2294d71 Twenty Eleven: Add styles and support for the new block-based editor.
This update adds styles and theme support related to the new block-based editor to enhance the experience of using it with Twenty Eleven. 

These are the specific changes made to this theme:

* Add blocks.css, to style blocks on the front end, to make sure they match the theme’s existing HTML element styles.
* Add editor-blocks.css to style blocks in the editor, to make sure they match the theme’s existing HTML element styles.
* Add theme support for `editor-styles`, to pull the existing editor stylesheet into the new editor.
* Add theme support for `wp-block-styles`, to load the default block styles on the front end.
* Add theme support for `editor-color-palette`, to load a color palette based on the theme’s color scheme into the block-based editor.

Props ianbelanger, laurelfulford.
Fixes #45039.

Built from https://develop.svn.wordpress.org/branches/5.0@43794


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:10:19 +00:00
David A. Kennedy
24946fb0f6 Twenty Ten: Add styles and support for the new block-based editor.
This update adds styles and theme support related to the new block-based editor to enhance the experience of using it with Twenty Ten. 

These are the specific changes made to this theme:

* Add blocks.css, to style blocks on the front end, to make sure they match the theme’s existing HTML element styles.
* Add editor-blocks.css to style blocks in the editor, to make sure they match the theme’s existing HTML element styles.
* Add theme support for `editor-styles`, to pull the existing editor stylesheet into the new editor.
* Add theme support for `wp-block-styles`, to load the default block styles on the front end.
* Add theme support for `editor-color-palette`, to load a color palette based on the theme’s color scheme into the block-based editor.

Props nielslange, crunnells, laurelfulford.
Fixes #45038.

Built from https://develop.svn.wordpress.org/branches/5.0@43793


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:09:39 +00:00
Dominik Schilling
957a6af144 Meta Boxes: Sync checks for valid meta boxes from do_meta_boxes() to the_block_editor_meta_boxes().
See #45112.
Built from https://develop.svn.wordpress.org/branches/5.0@43792


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43621 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:08:59 +00:00
Dominik Schilling
4caf9b7aaf Themes: Remove a stray slash and gutenberg text domain.
See #45125.
Built from https://develop.svn.wordpress.org/branches/5.0@43791


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:08:19 +00:00
danielbachhuber
8caf4f9260 Themes: Introduce responsive embeds support.
Responsive embeds is a way for a theme to opt in to WordPress dynamically scaling the width/height of an embed. When a theme supports responsive embeds, a `wp-embed-responsive` class is added to the `<body>` tag. This information is also presented through the REST API for clients to respect.

Props desrosj.
Fixes #45125.

Built from https://develop.svn.wordpress.org/branches/5.0@43790


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43619 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:07:39 +00:00
atimmer
8efbcce93b Build tools: Upgrade @wordpress packages.
Generated using `npm update @wordpress/api-fetch @wordpress/blob @wordpress/block-library @wordpress/blocks @wordpress/components @wordpress/compose @wordpress/core-data @wordpress/data @wordpress/date @wordpress/dom @wordpress/edit-post @wordpress/editor @wordpress/element @wordpress/escape-html @wordpress/list-reusable-blocks @wordpress/nux @wordpress/plugins @wordpress/redux-routine @wordpress/rich-text @wordpress/url @wordpress/viewport`.

See #45145.

Built from https://develop.svn.wordpress.org/branches/5.0@43789


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43618 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:06:59 +00:00
Gary Pendergast
a618939ddb Script/Style Dependencies: Make sure that inline scripts for handles without a source are printed.
See [36550] for `WP_Styles`.

Merges [43565] to the 5.0 branch.

Props bpayton.
Fixes #44551.


Built from https://develop.svn.wordpress.org/branches/5.0@43788


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-22 06:13:38 +00:00
Gary Pendergast
49702cca54 TinyMCE: remove stray CSS map reference from skin.min.css.
Merges [43581] to the 5.0 branch.

Props pross.
Fixes #44785.

Built from https://develop.svn.wordpress.org/branches/5.0@43787


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43616 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-22 06:05:39 +00:00
Gary Pendergast
a2a28e85a3 Build/Tools: Add PHPCS to the 5.0 branch.
This allows us to apply WordPress Coding Standards rules to new files in the 5.0 branch.

Props netweb.
Fixes #44366.



Built from https://develop.svn.wordpress.org/branches/5.0@43786


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-22 05:15:39 +00:00
Gary Pendergast
38aa44817f Build: Update images following [43684].
`grunt-contrib-imagemin` was updated, which included some changes to image minification. Those changes are now applies.

Props netweb.
See #45080.


Built from https://develop.svn.wordpress.org/branches/5.0@43785


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43614 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-22 05:06:38 +00:00
Gary Pendergast
ce66f73e68 Build: Updated CSS vendor prefixes following [43684].
`autoprefixer` was updated, which included some vendor prefix changes. Those changes are now applied.

Props netweb.
See #45080.


Built from https://develop.svn.wordpress.org/branches/5.0@43784


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-22 05:04:40 +00:00
Gary Pendergast
2025427f5d Build: Ignore the vendor directory during the jsvalidate:build task.
Props netweb.
Fixes #45119.


Built from https://develop.svn.wordpress.org/branches/5.0@43783


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-22 04:54:39 +00:00
Gary Pendergast
fb9f4e8abd Build: Switch package.json to using tabs for indents.
Merges [42460] to the 5.0 branch.

Props netweb.
Fixes #43075.


Built from https://develop.svn.wordpress.org/branches/5.0@43782


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43611 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-22 04:50:40 +00:00
Gary Pendergast
5d58c6dc66 KSES: Allow url() to be used in inline CSS.
The cover image block uses the `url()` function in its inline CSS, to show the cover image. KSES didn't allow this, causing the block to not save correctly for Author and Contributor users. As KSES does already check each attribute name against an allowed list, we're able to add an extra check for certain attributes to be able to use the `url()` function, too.

Props peterwilsoncc, azaozz, pento, dd32.
See #45067.


Built from https://develop.svn.wordpress.org/branches/5.0@43781


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43610 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-22 04:04:41 +00:00
Gary Pendergast
433dfae509 Block Editor: Add extra body classes when the block editor is loaded.
See #45037.


Built from https://develop.svn.wordpress.org/branches/5.0@43780


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43609 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-22 03:14:40 +00:00
Gary Pendergast
6800a811b6 Meta Boxes: Add __back_compat_meta_box and __block_editor_compatible_meta_box flags to meta boxes.
When meta boxes are registered, they can use the `__back_compat_meta_box` and `__block_editor_compatible_meta_box` flags, to show whether this registration just exists for if the classic editor is loaded, and whether this meta box is compatible with the block editor.

When a meta box marks itself as incompatible with the block editor, and `WP_DEBUG` is enabled, a warning will show inside that meta box in the classic editor.

As all core meta boxes have been recreated in the block editor, they can be marked with the `__back_compat_meta_box` flag.

See #45112.


Built from https://develop.svn.wordpress.org/branches/5.0@43779


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43608 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-22 02:32:41 +00:00
Gary Pendergast
acda70184d Block Editor: Add helper functions to collect meta box information.
To allow the block editor to render meta boxes, it needs to collect information about how those meta boxes are registered, and format it for the block editor to make use of.

See #45112.


Built from https://develop.svn.wordpress.org/branches/5.0@43778


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43607 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-22 02:16:39 +00:00
Gary Pendergast
e0361726c2 Block Editor: Add an is_block_editor() method to WP_Screen.
This method allows checking (or setting) whether the block editor is loading on the current screen.

See #45037.


Built from https://develop.svn.wordpress.org/branches/5.0@43777


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43606 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-22 02:06:40 +00:00
danielbachhuber
d6895a1e65 REST API: Render response in user locale with ?_locale=user.
Introduces new `determine_locale()` function for deciding the proper locale to use for a response. Default value is `get_user_locale()` in the admin, and `get_locale()` on the frontend. Because REST API requests are considered frontend requests, `?_locale=user` can be used to render the response in the user's locale.

Also updates `wp-login.php?wp_lang` implementation to benefit from this abstraction.

Props flixos90, mnelson4, swissspidy, TimothyBlynJacobs.
Fixes #44758.

Built from https://develop.svn.wordpress.org/branches/5.0@43776


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43605 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-21 15:03:40 +00:00
Gary Pendergast
648850ea73 Revisions: Improve performance of WP_Text_Diff_Renderer_Table.
`WP_Text_Diff_Renderer_Table` is used to generate the diff view in revisions, but there were some cases that could cause it to take excessive amounts of time to run.

Some noteable cases include:
- When a large number of new lines were inserted in the middle of the post from one revision to the next.
- When both revisions contain >100 lines.
- When either revision contains a lot of long lines.

In one extreme test case, the diff view took over a minute to generate. With this change, it now takes less than a second.

See #35667.


Built from https://develop.svn.wordpress.org/branches/5.0@43775


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-20 08:36:40 +00:00
Sergey Biryukov
bae53caa70 REST API: Restore Autosaves controller test for multisite.
PHPUnit 3.6.x requires `exclude` and `file` paths to be relative to the checkout root.

PHPUnit 4.0.0+ requires the paths to be relative to the configuration file.

See #45131.
Built from https://develop.svn.wordpress.org/branches/5.0@43774


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43603 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-20 04:21:38 +00:00
danielbachhuber
0a3bb63b8f REST API: Limit the scope of wp-admin files required in WP_REST_Attachments_Controller methods.
Narrow the scope of the included wp-admin files loaded for `wp_generate_attachment_metadata()`, `wp_handle_upload()`, `wp_tempnam()`, and `wp_handle_sideload()`. Requires only `wp-admin/includes/file.php` and `wp-admin/includes/image.php` instead of `wp-admin/includes/admin.php`.

Props ocean90, lonelyvegan, soulseekah, pratikthink.
Merges [43589], [43604] to the 5.0 branch.
Fixes #43757.

Built from https://develop.svn.wordpress.org/branches/5.0@43773


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 18:53:41 +00:00
danielbachhuber
5a627786bf Help/About: Ensure the space after the period for the 4.9.8 changelog entry is preserved.
Props chetan200891, burhandodhy, swissspidy.
Merges [43622] to the 5.0 branch.
See #44717.

Built from https://develop.svn.wordpress.org/branches/5.0@43772


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 18:41:40 +00:00
danielbachhuber
6c9675bf37 REST API: Handle api-request query parameters with plain permalinks.
When constructing the request URL, ensure that `?` is replaced with `&` when the API root already contains a `?`. Fixes an issue where requests were broken when sites had permalinks set to plain.

Props aduth.
Merges [42965] to the 5.0 branch.
Fixes #42382.

Built from https://develop.svn.wordpress.org/branches/5.0@43771


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 18:33:39 +00:00
danielbachhuber
58ea8c82e4 REST API: Include block_version on Post content object.
The `block_version` denotes which version of Blocks the `post_content` contains. Introduces new `block_version()` function for versioning Blocks.

Props danielbachhuber, birgire.
Fixes #43887.

Built from https://develop.svn.wordpress.org/branches/5.0@43770


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43599 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 17:58:39 +00:00
danielbachhuber
7700a3ef3e REST API: Skip Autosaves controller test for multisite.
There's some PHP 5.2 (cough, cough) edge case where paths calculated differently, possibly caused by differing version of PHPUnit.

See #45132, #45131, #43316.

Built from https://develop.svn.wordpress.org/branches/5.0@43769


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43598 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 14:09:38 +00:00
danielbachhuber
50b0bf94c4 REST API: Introduce Autosaves controller and endpoint.
* Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
* Autosaves endpoint is registered for all post types except `attachment` because even post types without revisions enabled are expected to autosave.
* Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.

Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue.
Fixes #43316.

Built from https://develop.svn.wordpress.org/branches/5.0@43768


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43597 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 13:49:41 +00:00
danielbachhuber
53002c68c4 REST API: Use a truly impossibly high number in User Controller tests.
The `100` number could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.

Fixes #45128.

Built from https://develop.svn.wordpress.org/branches/5.0@43767


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43596 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 11:57:39 +00:00
danielbachhuber
7edc3e2b98 REST API: Ensure rest_url() consistently has leading slash.
`rest_url()` inconsistent addes slashes to the passed path depending on whether the site has pretty permalinks enabled. Apart from being inconsistent, this also caused the unit tests to fail when pretty permalinks are enabled.

Props frank-klein.
Merges [42250] to the 5.0 branch.
Partially reverts [43720].
Fixes #42452. See #41451, #45017.

Built from https://develop.svn.wordpress.org/branches/5.0@43766


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43595 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 11:14:39 +00:00
mcsf
326cd6af15 Deactivate Gutenberg plugin on update to 5.0.
Fixes #45123.


Built from https://develop.svn.wordpress.org/branches/5.0@43765


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43594 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 10:51:39 +00:00
Gary Pendergast
93343de1bd i18n: Remove some translation domains accidentally included in [43762].
See #45110.


Built from https://develop.svn.wordpress.org/branches/5.0@43764


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 09:12:38 +00:00
Gary Pendergast
2ccaeedbda REST API: Introduce the rest_preload_api_request() function.
This function helps perform multiple REST API requests, for the purpose of preloading data into a page.

See #45110.


Built from https://develop.svn.wordpress.org/branches/5.0@43763


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 08:57:40 +00:00
Gary Pendergast
de323bc14c Block Editor: Add helper functions for displaying the editor.
`use_block_editor_for_post()` and `use_block_editor_for_post_type()` determine if the block editor should be loaded.

`get_block_categories()` and `get_block_editor_server_block_settings()` provide data be included while the block editor is loading.

See #45110.


Built from https://develop.svn.wordpress.org/branches/5.0@43762


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43591 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 08:44:41 +00:00
Gary Pendergast
99d061b53c General: Extract the code editor settings from wp_enqueue_code_editor().
They're now returned by a new function, `wp_get_code_editor_settings()`, so they can be reused by the block editor.

See #45127.


Built from https://develop.svn.wordpress.org/branches/5.0@43761


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43590 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 06:45:39 +00:00
Gary Pendergast
158cbdbf03 Build Tools: Copy package JavaScript and CSS into wp-includes.
- `grunt webpack:dev` now copies packages JS into `/src/wp-includes/js/dist`, and CSS into `/src/wp-includes/css/dist`.
- `grunt webpack:prod` does the same, but into `/build` instead of `/src`.
- `grunt build` now runs the `webpack:prod` task.

Props atimmer, pento.
Fixes #45119.


Built from https://develop.svn.wordpress.org/branches/5.0@43760


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43589 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 06:06:46 +00:00
Gary Pendergast
98eb507bbe i18n: Add the wp_get_jed_locale_data() function.
This function formats locale information to be used by Jed.

Props desrosj.
See #45111.


Built from https://develop.svn.wordpress.org/branches/5.0@43759


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43588 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 05:52:25 +00:00
Gary Pendergast
dbb5cd9960 Classic Editor: Disable the wpautop TinyMCE plugin on block posts.
As the block editor adds its own `<p>` tags, disabling the wpautop stops the classic editor from removing them.

See #45113.


Built from https://develop.svn.wordpress.org/branches/5.0@43758


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43587 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 01:43:26 +00:00
danielbachhuber
a5bd8cb64c REST API: generate a valid fallback URI in wp.api.utils.getRootURL.
When window.location.origin isn't set, correctly insert two slashes between the protocol and host when constructing the fallback URL.

Props abdullahramzan.
Merges [43566] into the 5.0 branch.
Fixes #44764.

Built from https://develop.svn.wordpress.org/branches/5.0@43757


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43586 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-18 20:49:25 +00:00
danielbachhuber
699bf044ef REST API: Correct HTTP status code in error for requests to create a duplicate term.
The 409 error code is intended for situations where it is expected that the user will resolve the conflict and resubmit the same request. We use 400 error codes for other routes when a duplicate request is made. The 400 status code tells the user they need to modify their request for it to be successful.

Props shooper.
Merges [42354] to the 5.0 branch.
Fixes #42781. See #41370.

Built from https://develop.svn.wordpress.org/branches/5.0@43756


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43585 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-18 20:32:27 +00:00
danielbachhuber
8023795f7d REST API: Fix permissions error message in post statuses controller.
The permissions error message when a request tries to fetch post statuses unauthenticated is incorrect. It was a copy/paste from elsewhere, as indicated by the use of "in this post type" where this is no post type referenced.

Props schlessera.
Merges [42356] to the 5.0 branch.
Fixes #42303.

Built from https://develop.svn.wordpress.org/branches/5.0@43755


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-18 20:26:25 +00:00
atimmer
72c9037248 Script loading: Fix a PHP error introduced in [43753].
See #45065.
Props swissspidy.

Built from https://develop.svn.wordpress.org/branches/5.0@43754


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43583 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-18 13:27:26 +00:00
atimmer
ab6b171b1d Script loading: Fix regression after [43738].
After [43738], TinyMCE would be loaded earlier than before, which
makes filters run at a different time relative to the loading of
TinyMCE. Fix this by calling `wp_print_scripts` at the location where
TinyMCE would previously be inserted as a `<script>` tag in the page.

Props azaozz, omarreiss.
Fixes #45065.

Built from https://develop.svn.wordpress.org/branches/5.0@43753


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43582 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-18 13:22:26 +00:00
Gary Pendergast
798c2581b1 Blocks: Parse blocks when displaying posts.
Posts containing blocks are now correctly handled when displaying on the front end, including dynamic blocks and nested blocks.

See #45109.


Built from https://develop.svn.wordpress.org/branches/5.0@43752


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43581 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-18 11:54:26 +00:00
Gary Pendergast
f7d01b4e70 Blocks: Introduce the block parser.
The `WP_Block_Parser` class, and the accompanying `parse_blocks()` helper function, can be used to parse an array of blocks out of a content string.

`WP_Block_Parser` is copied from the `@wordpress/block-serialization-default-parser` package. To ensure it stays in sync with the JavaScript parser, changes should be implemented in the package first, then the package version should be upgraded to include the changes.

See #45109.


Built from https://develop.svn.wordpress.org/branches/5.0@43751


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43580 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-18 04:40:27 +00:00
Sergey Biryukov
591a09dea0 Media: Pass EXIF data to the wp_read_image_metadata filter.
Props desrosj.
Merges [42879] to the 5.0 branch.
Fixes #43624.
Built from https://develop.svn.wordpress.org/branches/5.0@43750


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-18 04:15:26 +00:00
Sergey Biryukov
b6e0d06fff Media: In wp_read_image_metadata(), rename $sourceImageType variable to $image_type to match coding standards.
Merges [42878] to the 5.0 branch.
See #43624.
Built from https://develop.svn.wordpress.org/branches/5.0@43749


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43578 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-18 04:14:25 +00:00
Sergey Biryukov
7a47da86e0 Build/Test Tools: Instruct Git and Subversion to ignore Composer's vendor directory.
Props netweb.
Merges [42405] to the 5.0 branch.
Fixes #42909.
Built from https://develop.svn.wordpress.org/branches/5.0@43748


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-18 04:13:25 +00:00
Sergey Biryukov
e3018db874 Build/Test Tools: Remove vendor file name entry from .gitignore.
Props netweb.
Merges [42733] to the 5.0 branch.
Fixes #43411.
Built from https://develop.svn.wordpress.org/branches/5.0@43747


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43576 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-18 04:09:25 +00:00
Sergey Biryukov
3deded1729 General: PHP 7.3 throws an E_WARNING when using continue to target a switch.
Applying continue to a switch is equivalent to using break and quite possibly, a continue targeting a higher level control structure is actually intended.

To target the higher level control structure, a numeric argument has to be passed to continue. This fixes two cases in WordPress Core where this is currently happening.

See: https://github.com/php/php-src/pull/3364
See: https://wiki.php.net/rfc/continue_on_switch_deprecation

Props jrf.
Merges [43653] to the 5.0 branch.
Fixes #44543.
Built from https://develop.svn.wordpress.org/branches/5.0@43746


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43575 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-18 03:42:27 +00:00
Sergey Biryukov
38235a183e Media: Remove checkered background for icons in Attachment Details.
Props BandonRandon.
Merges [42642] to the 5.0 branch.
Fixes #42535. See #41948.
Built from https://develop.svn.wordpress.org/branches/5.0@43745


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43574 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-18 03:11:26 +00:00
danielbachhuber
883d237689 Posts, Post Types: Add labels for post transformation messages.
Because the existing `post_updated_messages` filter can be modified dynamically based on post state, it's unreliable to use with REST API clients. Instead, these new labels give clients stateless equivalents.

Props earnjam.
Fixes #45101.

Built from https://develop.svn.wordpress.org/branches/5.0@43744


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43573 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-18 02:04:26 +00:00
Gary Pendergast
28310289bd Blocks: Introduce register_block_type(), unregister_block_type(), and get_dynamic_blocks() functions.
These helper functions allow easy access to the global block registry.

See #45109.


Built from https://develop.svn.wordpress.org/branches/5.0@43743


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-18 01:53:26 +00:00
Gary Pendergast
22840639e8 Blocks: Introduce WP_Block_Type and WP_Block_Type_Registry classes.
These are the foundational classes allowing blocks to be registered and used throughout WordPress.

This commit also includes the `has_block()` and `has_blocks()` functions, which are required for unit testing these classes.

Props adamsilverstein, danielbachhuber, desrosj.
See #45097, #45109.


Built from https://develop.svn.wordpress.org/branches/5.0@43742


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43571 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-18 01:31:26 +00:00
danielbachhuber
e4b0ddbf4d REST API: Fix version number in _doing_it_wrong() call.
`_doing_it_wrong()`, indeed.

Props joehoyle.
See #39965.

Built from https://develop.svn.wordpress.org/branches/5.0@43741


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43570 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-17 22:20:25 +00:00
K. Adam White
a943d902c1 REST API: Slash existing meta values when comparing with incoming meta upates.
When comparing the old and new values for a meta key being set, ensure both values are sanitized using the same logic so that equal values match.

props boonebgorges, dcavins, MattGeri, pilou69, TimothyBlynJacobs.
Fixes #42069.

Built from https://develop.svn.wordpress.org/branches/5.0@43740


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43569 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-17 20:10:25 +00:00
danielbachhuber
a2d601024f REST API: Introduce controller for searching across post types.
Introduces a `WP_REST_Search_Controller` class which registers a `/wp/v2/search` endpoint. Search types are handled by extending `WP_REST_Search_Handler`. The default search type is `WP_REST_Post_Search_Handler` but can be filtered by plugins or a theme.

Props danielbachhuber, flixos90, pento, rmccue.
Fixes #39965.

Built from https://develop.svn.wordpress.org/branches/5.0@43739


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43568 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-17 17:03:26 +00:00
atimmer
07ea394b44 Script loader: Adjust JS packages registration.
Adjusts the packages registration after [43723]:

* Combine the different registration functions into one
`wp_default_packages` function. To reach this goal move the prefix
logic into a function so it can be called from different locations.
Use a `static` variable there to prevent duplicate inclusion of
`version.php`.
* Call this function from the `wp_default_scripts` action by
registering it as a default filter.
* Combine some of the logic in `_WP_Editors::print_tinymce_scripts`
into `wp_register_tinymce_scripts`. The logic to force an uncompressed
TinyMCE script file stays in `_WP_Editors::force_uncompressed_tinymce`
because that logic is very specific to the classic editor.
* The script handle `wp-tinymce` is now a dependency of the `editor`
script handle. In combination with the previous item, this makes the
classic editor work.
* Adjust the syntax of the script paths to be more consistent with
other WordPress code.
* Always use `"production"` mode for the media files to prevent people
from inadvertently committing development files.

Props pento, omarreiss.
Fixes #45065.

Built from https://develop.svn.wordpress.org/branches/5.0@43738


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-17 15:29:26 +00:00
danielbachhuber
fbd004bbbd REST API: Fire actions after items are completely updated/inserted.
The existing `rest_insert_*` actions are fired before meta and additional fields are updated. These new `rest_after_*` actions fire after all write operations have completed.

Props timothyblynjacobs.
Fixes #42864.

Built from https://develop.svn.wordpress.org/branches/5.0@43737


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43566 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-17 11:20:26 +00:00
danielbachhuber
12b674fb3a REST API: Don't add fields to object when not included in ?_fields=.
In [43087], we improved REST API performance by only rendering the fields specified in the request. Similarly, any fields registered with `register_rest_field()` should only be rendered when included in `?_fields=`.

Props dlh.
Fixes #45099.

Built from https://develop.svn.wordpress.org/branches/5.0@43736


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43565 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-17 02:41:27 +00:00
K. Adam White
9cafddd841 REST API: Add new class file and tests missed in [43734].
See #45016.

Built from https://develop.svn.wordpress.org/branches/5.0@43735


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43564 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-16 22:50:26 +00:00
K. Adam White
81a4d0a10c REST API: Introduce themes endpoint to expose theme-supports values for the active theme.
In order to correctly render parts of its UI, the new editor needs to be aware of the active theme's post-formats and post-thumbnails support. This data is exposed by querying for the active theme on a new /wp/v2/themes endpoint for sufficiently privileged users.

props desrosj.
Fixes #45016.

Built from https://develop.svn.wordpress.org/branches/5.0@43734


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-16 22:28:28 +00:00
Peter Wilson
f09938cd01 Formatting: Add new tests missed in [43732].
Completes merging [42770] to the 5.0 branch.
See #43187.

Built from https://develop.svn.wordpress.org/branches/5.0@43733


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43562 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-16 04:42:27 +00:00
Peter Wilson
bf672769c2 Formatting: Add pre-save content filter to make target=_blank always secure.
Props notnownikki, iseulde, azaozz.
Merges [42770] to the 5.0 branch.
Fixes #43187.

Built from https://develop.svn.wordpress.org/branches/5.0@43732


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43561 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-16 04:13:30 +00:00
Peter Wilson
f7ace6f1b2 KSES: Add selected ARIA attributes support.
Allow low-privileged users to use the ARIA attributes `aria-describedby`, `aria-details`, `aria-label`, `aria-labelledby` and `aria-hidden`.

Props mattheu, swissspidy, rianrietveld, afercia, GaryJ.
See #30421.

Built from https://develop.svn.wordpress.org/branches/5.0@43731


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-15 23:44:26 +00:00
danielbachhuber
760b131bec Load: Disable PHP errors for JSON requests
Because WP REST API requests aren't identified until `parse_request`, it's impractical to reference the `REST_REQUEST` constant in `wp_debug_mode()`. Instead, it's more helpful to assume that a request wanting a JSON response probably doesn't want PHP errors breaking the response.

Props chrisl27, duanestorey, earnjam.
Fixes #44534.

Built from https://develop.svn.wordpress.org/branches/5.0@43730


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-15 22:06:27 +00:00
Felix Arntz
0dde03e3f0 REST API: Move object type-specific metadata integrations from the wrapper functions to the low-level Meta API functions.
Object type-specific actions that should happen before or after modification of metadata have so far been part of the respective wrapper functions. By using action and filter hooks, this changeset ensures they are always executed, even when calling the lower-level Meta API functions directly, which the REST API does as a prime example.

Props flixos90, spacedmonkey.
Fixes #44467.

Built from https://develop.svn.wordpress.org/branches/5.0@43729


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-15 11:46:25 +00:00
Gary Pendergast
392f33495f Posts: Remove the slug from Quick Edit for CPTs with publicly_queryable disabled.
In the full edit screen, CPTs that have disabled the `publicly_queryable` option will hide the slug field, as it doesn't need to be edited. This change brings the Quick Edit view into line with that behaviour.

Merges [43664] to the 5.0 branch.

Props bhargavmehta, krutidugade.
Fixes #43278.


Built from https://develop.svn.wordpress.org/branches/5.0@43728


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-15 05:35:25 +00:00
Peter Wilson
4b3d92a0db KSES: Allow HTML data-* attributes.
Add global support for HTML attributes prefixed `data-` for authors and contributors, as required by the new editor.

Props azaozz, peterwilsoncc.
Fixes #33121.

Built from https://develop.svn.wordpress.org/branches/5.0@43727


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-15 05:22:25 +00:00
Aaron Jorbin
73f5d3d4d9 Build/Test Tools: Use 7.3 for PHP 7.3
Travis now supports PHP7.3 without workarounds, so let's remove the workarounds.

Previously [43692].

See #44771.


Built from https://develop.svn.wordpress.org/branches/5.0@43726


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43555 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-15 02:48:26 +00:00
Gary Pendergast
c738add83e Build/Test Tools: Remove an extra line incorrectly included in [43724].
See #44858.


Built from https://develop.svn.wordpress.org/branches/5.0@43725


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-13 03:52:06 +00:00
Gary Pendergast
86d8caa61d Build/Test Tools: Implement the automatic retry functionality that Travis CI provides.
This functionality will cause the command to be retried up to three times in case of a non-zero return value. Implementing it on commands that perform network requests means that intermittent network failures are less likely to cause a build to fail, as they'll be retried up to three times.

Merges [43645] to the 5.0 branch.

Props johnbillion.
Fixes #44858.


Built from https://develop.svn.wordpress.org/branches/5.0@43724


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43553 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-13 03:51:40 +00:00
atimmer
c8625c33ee Script loader: Register @wordpress scripts.
This allows the packages to be consumed by plugins and core itself.
The code has been based on the work done in the Gutenberg plugin.

We've added an array with all the packages and the vendor packages to
loop through. This sets a convention so all packages will be
registered in the same way. This array can eventually be generated by
a webpack plugin.

We need to register TinyMCE explicitly. Previously TinyMCE was used
by inserting custom `<script>` tags into the relevant admin pages.
This is not suitable for the new editor, so we need to explicitly
register TinyMCE. We could, in the future, refactor the custom
`<script>` tags to use the registered TinyMCE script instead.

Polyfills are inserted into the page only when necessary using
`document.write`.

Props omarreiss, herregroen, youknowriad, gziolo.
Fixes #45065.

Built from https://develop.svn.wordpress.org/branches/5.0@43723


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43552 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-13 03:51:14 +00:00
Sergey Biryukov
9bc4e12e18 Database: In require_wp_db(), check if database constants are defined before using them.
Otherwise, `wp-admin/setup-config.php` triggers an undefined constant warning in PHP 7.2.

Props mariusvw, jryancard for initial patch.
Merges [42701] to the 5.0 branch.
Fixes #35560.
Built from https://develop.svn.wordpress.org/branches/5.0@43722


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-13 03:50:49 +00:00
Sergey Biryukov
8d85630358 Build: Bump the version of node used on Travis to match package.json for 5.0.
See [43684].
See #45064.
Built from https://develop.svn.wordpress.org/branches/5.0@43721


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43550 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-13 03:50:23 +00:00
danielbachhuber
bab0d57578 REST API: Include permalink_template/generated_slug for Posts
In order for clients to present permalink previews, the REST API must share the computed results of `get_sample_permalink()`. These two values are now exposed as `permalink_template` and `generated_slug` for public, viewable post types, but only for `context=edit`.

Props danielbachhuber, rahulsprajapati.
Fixes #45017.

Built from https://develop.svn.wordpress.org/branches/5.0@43720


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43549 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-13 03:49:57 +00:00
atimmer
49bf485724 Build tools: Build @wordpress packages with webpack.
We decided to split the media webpack config into it's own file. The
main webpack config then combines this file with the packages config.

Include vendor scripts by copying them. We copy the minified files if
they are available. If they aren't available we minify the original
files ourselves.

Props omarreiss, herregroen, gziolo, youknowriad, netweb, adamsilverstein.
See #45065.

Built from https://develop.svn.wordpress.org/branches/5.0@43719


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43548 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-13 03:49:31 +00:00
Sergey Biryukov
047949afab Media: Ensure the "Edit more details" link in the attachment details modal always points to the correct editing URL.
Merges [43601] to the 5.0 branch.
Fixes #44620.
Built from https://develop.svn.wordpress.org/branches/5.0@43718


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43547 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-11 08:14:23 +00:00
Sergey Biryukov
b7de0935b9 Media: In WP_Image_Editor::make_image(), close previously opened output buffer if the file could not be created.
In addition to the merge noted below, includes important brackets added in [42343].

Props dhanendran, gnif, SergeyBiryukov.
Merges [42695] and [42702] to the 5.0 branch.
Fixes #43255.
Built from https://develop.svn.wordpress.org/branches/5.0@43717


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-11 08:11:23 +00:00
Sergey Biryukov
a6a20b29d8 REST API: Support pagination, order, search and other common query parameters for revisions.
The original REST API revisions controller relied on `wp_get_post_revisions()`, getting all revisions of a post without any possibility to restrict the result. This changeset replaces that function call with a proper `WP_Query` setup, replicating how `wp_get_post_revisions()` works while offering parameters to alter the default behavior.

Props adamsilverstein, birgire, flixos90.
Merges [43584-43586], [43647] to the 5.0 branch.
Fixes #40510.
Built from https://develop.svn.wordpress.org/branches/5.0@43716


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-11 07:16:46 +00:00
Sergey Biryukov
c288d39db2 REST API: Pass correct ID to meta->update_value to permit setting term meta during term creation.
Props joehoyle.
Merges [43636] to the 5.0 branch.
Fixes #44834.
Built from https://develop.svn.wordpress.org/branches/5.0@43714


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43543 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-11 06:35:23 +00:00
Sergey Biryukov
b9fb2a42b1 Tests: Improve coverage for REST API term meta registration.
Introduce tests to validate that register_meta and register_term_meta work as expected in WP_REST_Terms_Controller.

Props timmydcrawford.
Merges [43567] to the 5.0 branch.
Fixes #39122.
Built from https://develop.svn.wordpress.org/branches/5.0@43713


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43542 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-11 06:32:22 +00:00
Sergey Biryukov
531992ff1d Taxonomy: Make sure wp_list_categories() correctly outputs term name of 0.
Props joyously, SergeyBiryukov.
Merges [43605] to the 5.0 branch.
Fixes #44872.
Built from https://develop.svn.wordpress.org/branches/5.0@43712


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43541 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-11 04:42:49 +00:00
Sergey Biryukov
37dcf205e6 Docs: Correct @since value for _wp_privacy_statuses().
Fix typo in `@since` entry for `WP_Privacy_Policy_Content:add()`.

Props dimadin.
Merges [43638] to the 5.0 branch.
Fixes #44915.
Built from https://develop.svn.wordpress.org/branches/5.0@43710


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43539 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-11 04:32:22 +00:00
Sergey Biryukov
f9ba011f33 Docs: Correct parameter type for WP_Privacy_Policy_Content::notice().
Props burhandodhy.
Merges [43609] to the 5.0 branch.
Fixes #44877.
Built from https://develop.svn.wordpress.org/branches/5.0@43709


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43538 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-11 04:31:23 +00:00
Sergey Biryukov
7bd842a4ef Docs: Update $meta_type descriptions to include ’term’ as a valid type in meta.php and class-wp-term-query.php.
Props macbookandrew.
Merges [43557] to the 5.0 branch.
Fixes #44751.
Built from https://develop.svn.wordpress.org/branches/5.0@43706


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-11 04:15:23 +00:00
Sergey Biryukov
4af0279f2a Embeds: Avoid a JS error in wp.receiveEmbedMessage if data parameter is not set.
Props dsifford, kadamwhite.
Merges [43593] and [43597] to the 5.0 branch.
Fixes #44832.
Built from https://develop.svn.wordpress.org/branches/5.0@43704


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-11 04:00:23 +00:00
Sergey Biryukov
269fb1276f Docs: Convert @see reference in wp_checkdate() DocBlock to @link.
Props WiZZarD_.
Merges [43599] to the 5.0 branch.
Fixes #44866.
Built from https://develop.svn.wordpress.org/branches/5.0@43703


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-11 03:56:22 +00:00
Sergey Biryukov
7860cb4a83 Customize: Increase the colour contrast of the line numbers in CodeMirror.
Props earnjam, abdullahramzan, audrasjb, Luminus.
Merges [43574] to the 5.0 branch.
Fixes #44763.
Built from https://develop.svn.wordpress.org/branches/5.0@43700


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43529 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-11 03:42:22 +00:00
Sergey Biryukov
15d1c6398c Script loader: remove (PHP based) compression from load-styles.php and load-scripts.php. WIth the amount of scripts and stylesheets grown a lot over the years, it has become pretty slow and consumes a lot of server resources. Also, most servers are set to compress PHP output anyway.
Props LucasRolff, azaozz.
Merges [43580] to the 5.0 branch.
Fixes #44815. See #43308.
Built from https://develop.svn.wordpress.org/branches/5.0@43697


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43526 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-11 03:23:22 +00:00
Sergey Biryukov
a2343dc51b Tests: Introduce Tests_HTTP_Functions::skipTestOnTimeout(), mirroring the same WP_HTTP_UnitTestCase method.
Merges [43512] to the 5.0 branch.
Fixes #44613.
Built from https://develop.svn.wordpress.org/branches/5.0@43696


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43525 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-11 03:20:22 +00:00
Sergey Biryukov
d0ecbb107e Tests: Use WP_HTTP_UnitTestCase::skipTestOnTimeout() in more HTTP tests.
Adjust it to handle more types of timeouts, e.g. "Resolving timed out", "Connection timed out".

Merges [43511] to the 5.0 branch.
See #44613.
Built from https://develop.svn.wordpress.org/branches/5.0@43695


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43524 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-11 03:18:23 +00:00
danielbachhuber
4bf87727a4 REST API: Enable users with read_private_posts to query for them.
An authorized request with the `read_private_posts` capability for a post type should be able to `GET /wp/v2/posts` for posts of `status=private`. This query is further sanity-checked by `WP_REST_Posts_Controller->check_read_permission()`, which is unchanged.

Props rachelbaker, soulseekah, twoelevenjay.
Fixes #43701.

Built from https://develop.svn.wordpress.org/branches/5.0@43694


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43523 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-10 20:49:23 +00:00
John Blackbourn
b9e3d4c42e General: Instruct file editors not to trim trailing whitespace in markdown files.
Two trailing spaces in a markdown file indicates a line break.

Props netweb

Fixes #43104

Merges [42862] to the 5.0 branch.

Built from https://develop.svn.wordpress.org/branches/5.0@43693


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-10 16:29:24 +00:00
John Blackbourn
1116c494b6 Build/Test Tools: Add PHP7.3 RC1 to the build matrix
Currently, we need to do some extra steps to run 7.3, but this will help us with testing compatibility.

See: https://github.com/travis-ci/travis-ci/issues/9717

See #44771.

Merges [43673] to the 5.0 branch.

Built from https://develop.svn.wordpress.org/branches/5.0@43692


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43521 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-10 16:09:23 +00:00
danielbachhuber
8a5e5b0cf9 REST API: Load missing required file for multisite users
Requires wp-admin/includes/ms.php to make `upload_is_user_over_quota()` function available to multisite users uploading files.

Props JakePT, rachelbaker.
Merges [43603] to the 5.0 branch.
Fixes #44864.

Built from https://develop.svn.wordpress.org/branches/5.0@43691


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43520 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-10 12:37:24 +00:00
Boone Gorges
d3fb6d96c4 Correct param documentation for WP_Term_Query.
The description of `$meta_type` introduced in [40053] was incorrect.

Props dlh.
Merges [43559] to the 5.0 branch.
Fixes #44608.

Built from https://develop.svn.wordpress.org/branches/5.0@43689


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-10 04:16:47 +00:00
atimmer
3810f7a3ef Build tools: Upgrade webpack to version 4.
* Minification is done by uglify, so disable that in the media build.
* The webpack boilerplate has changed, which explains the changes in the build files.
* `ModuleConcatenationPlugin` is enable by default for production builds so we don't have to specify that ourselves.

See #45065.

Built from https://develop.svn.wordpress.org/branches/5.0@43688


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43517 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-10 04:16:23 +00:00
atimmer
ccb4e22896 Build tools: Combine webpack config files.
This prepares us for building the Gutenberg packages.

See #45065.

Built from https://develop.svn.wordpress.org/branches/5.0@43687


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-10 04:11:47 +00:00
Aaron Jorbin
dda1111bdf Build/Test Tools: Revert grunt-contrib-uglify update
Follow up to [43684].
See #45064.

Built from https://develop.svn.wordpress.org/branches/5.0@43686


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-10 04:11:25 +00:00
Aaron Jorbin
399e1315c9 Build/Test: Use same grunt-qunit as trunk for 5.0
See [43684].
See #45064.

Built from https://develop.svn.wordpress.org/branches/5.0@43685


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43514 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-10 04:07:28 +00:00
Aaron Jorbin
a870c7e8f3 Build/Test: Update dependencies for 5.0
Updates package dependencies to more modern versions, also adds .nvmrc and package-lock.json as followups to [43683] and [43571].

See #44600.
Fixes #45064.


Built from https://develop.svn.wordpress.org/branches/5.0@43684


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-09 02:52:45 +00:00
Aaron Jorbin
f08a2c6ef5 Build/Test: Remove npm-shrinkwrap.json
Shrinkwraping is done to keep dependencies the same. Historically, WordPress Core has done it after a release. As the 5.0 branch was created from the 4.9.8 tag which was created from the 4.9 branch, it included it. The 5.0 branch will have some dependency updates so this shrinkwrap is not needed here.

See #45064.

Built from https://develop.svn.wordpress.org/branches/5.0@43683


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-09 02:09:23 +00:00
danielbachhuber
bc07c9dd9f REST API: Declare unfiltered_html capability in links.
Because user capabilities can be modified at runtime, the REST API needs to expose them in some evaluated but declarative manner for clients to interpret. JSON Hyper Schema `targetSchema` provides an appropriate paradigm for doing so.

Props timothyblynjacobs.
Fixes #45014.

Built from https://develop.svn.wordpress.org/branches/5.0@43682


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43511 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-08 22:45:25 +00:00
danielbachhuber
c1ddf45869 REST API: Persist attributes for attachment links
In [43437], the link definition implementation caused attachment links to be unexpectedly nested under an `attributes` key. This changeset restores the prior behavior.

Props TimothyBlynJacobs.
Fixes #44750.

Built from https://develop.svn.wordpress.org/branches/5.0@43681


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43510 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-08 18:19:28 +00:00
danielbachhuber
62a35c8545 REST API: Define taxonomy visibility settings in schema
For Gutenberg and other admin-type interfaces, it's
useful to be able to see the visibility settings for
taxonomies.

The original changeset was partially included in [43445].

Merges [42729], [42730], [42973] to the 5.0 branch.
Props joehoyle, TimothyBlynJacobs, pento.
Fixes #42707

Built from https://develop.svn.wordpress.org/branches/5.0@43680


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43509 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-08 13:50:27 +00:00
Gary Pendergast
01f1bf13c3 Bump the 5.0 branch package.json version to 5.0.0.
Built from https://develop.svn.wordpress.org/branches/5.0@43679


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43508 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-05 20:44:23 +00:00
Gary Pendergast
47c819c37a Bump 5.0 branch version to 5.0-alpha.
Built from https://develop.svn.wordpress.org/branches/5.0@43676


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43505 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-05 20:18:57 +00:00
Dominik Schilling
4ae8f8d4e6 Bump 4.9 branch to version 4.9.8.
Built from https://develop.svn.wordpress.org/branches/4.9@43552


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43381 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-08-02 20:13:24 +00:00
Sergey Biryukov
c6e2c61454 Twenty Seventeen: Bump version number and update changelog for 4.9.8 release.
Props pbiron, laurelfulford.
Merges [43541] and [43550] to the 4.9 branch.
Fixes #44646.
Built from https://develop.svn.wordpress.org/branches/4.9@43551


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43380 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-08-02 16:43:30 +00:00
Aaron Campbell
fe08364556 Post WordPress 4.9.8 RC 3 version bump.
Built from https://develop.svn.wordpress.org/branches/4.9@43547


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43376 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-31 20:26:26 +00:00
Aaron Campbell
924e124a79 WordPress 4.9.8 RC 3.
Built from https://develop.svn.wordpress.org/branches/4.9@43546


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43375 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-31 20:06:28 +00:00
Aaron Jorbin
9f6f75bd8b Gutenberg: Restrict "Try Gutenberg" based on capability and gutenstatus
When Gutenberg is either not installed, or not activated, only show the callout to users with the `install_plugins` capability.
When Gutenberg is activated, expand that to include all users with the `edit_posts` capability.

4.9 branch commit.

Props pento.
Fixes #44680.


Built from https://develop.svn.wordpress.org/branches/4.9@43544


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43373 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-31 14:52:28 +00:00
Aaron Campbell
08f6d4873b Post WordPress 4.9.8 RC 2 version bump.
Built from https://develop.svn.wordpress.org/branches/4.9@43539


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43368 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-26 22:56:25 +00:00
Aaron Campbell
69fe41fc39 WordPress 4.9.8 RC 2.
Built from https://develop.svn.wordpress.org/branches/4.9@43538


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43367 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-26 22:40:25 +00:00
Sergey Biryukov
deee543f0d Dashboard: Tweak the "Try Gutenberg" callout:
* Introduce `try_gutenberg_learn_more_link` filter that allows hosts or site owners to change the link, to provide extra information about Gutenberg, specific to their service.
* Only display the "Install" buttons if we're able to directly write to disk to install the plugins.
* Make sure the "Dismiss" link works correctly.

Props pento, andrew.taylor, leemon.
Fixes #41316.
Built from https://develop.svn.wordpress.org/branches/4.9@43537


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43366 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-26 15:06:26 +00:00
Gary Pendergast
da5f52aae3 Dashboard: Tweak the "Try Gutenberg" subheading line height.
Props pento, pbiron, afercia, SergeyBiryukov.
Fixes #44627.


Built from https://develop.svn.wordpress.org/branches/4.9@43536


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43365 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-26 03:54:24 +00:00
Aaron Campbell
e3bce2d81a Post WordPress 4.9.8 RC 1 version bump.
Built from https://develop.svn.wordpress.org/branches/4.9@43534


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43363 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-24 19:47:26 +00:00
Aaron Campbell
fccc99f43f WordPress 4.9.8 RC 1.
Built from https://develop.svn.wordpress.org/branches/4.9@43533


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-24 18:51:25 +00:00
Sergey Biryukov
e7c1553bde Privacy: Revert [43525].
The commenter cookies checkbox is not legally required, so should be disabled by default.

Merges [43531] to the 4.9 branch.
Fixes #44373.
Built from https://develop.svn.wordpress.org/branches/4.9@43532


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-24 17:08:26 +00:00
Sergey Biryukov
4c11410c58 REST API: Ensure attachments created with WP_REST_Attachments_Controller::create_item() on Windows have a relative path.
Props ocean90, SergeyBiryukov, redcastor.
Merges [43529] to the 4.9 branch.
Fixes #40861.
Built from https://develop.svn.wordpress.org/branches/4.9@43530


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43359 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-24 16:54:26 +00:00
Sergey Biryukov
fa163b9c0a I18N: Separate two "About" strings with different context.
Props desrosj, XpertOne, Nao.
Merges [43527] to the 4.9 branch.
Fixes #44139.
Built from https://develop.svn.wordpress.org/branches/4.9@43528


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43357 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-24 15:06:26 +00:00
Sergey Biryukov
c0a7aaf659 Privacy: Remove the setting to enable comment cookies consent added in [43469].
This needs some more work to ensure expected behaviour.

Merges [43525] to the 4.9 branch.
See #44373.
Built from https://develop.svn.wordpress.org/branches/4.9@43526


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43355 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-24 12:53:26 +00:00
Sergey Biryukov
92096f4c64 Comments: Ensure that themes overriding default comment_form() fields still display the cookies consent checkbox.
The `comment_form_default_fields` filter can be used to remove the checkbox.

Props pross, SergeyBiryukov.
Merges [43518] to the 4.9 branch.
Fixes #44126.
Built from https://develop.svn.wordpress.org/branches/4.9@43524


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43353 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-24 12:43:28 +00:00
Gary Pendergast
b20bfba009 Dashboard: Improve "Try Gutenberg" subheading appearance for long headings.
When translated, the callout subheadings can wrap onto a new line, which caused them to overlap the paragraph text.

Props earnjam, fierevere.
Fixes #44611.


Built from https://develop.svn.wordpress.org/branches/4.9@43523


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43352 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-24 03:05:26 +00:00
Gary Pendergast
a9ea4a1f7d Dashboard: Make some of the "Try Gutenberg" links translatable.
Some of the links in the "Try Gutenberg" callout go to wordpress.org, so would potentially be better served by localised site.

Props dimadin.
See #41316.


Built from https://develop.svn.wordpress.org/branches/4.9@43522


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43351 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-24 02:52:29 +00:00
Aaron Campbell
67256370f1 Post WordPress 4.9.8 Beta 2 version bump.
Built from https://develop.svn.wordpress.org/branches/4.9@43516


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43345 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-19 20:48:27 +00:00
Aaron Campbell
1f9acd5fec WordPress 4.9.8 Beta 2.
Built from https://develop.svn.wordpress.org/branches/4.9@43515


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43344 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-19 20:25:24 +00:00
Sergey Biryukov
0dfd159712 Privacy: Improve grammar on Privacy Settings screen.
Props ianbelanger, garrett-eclipse.
Merges [43513] to the 4.9 branch.
Fixes #44612.
Built from https://develop.svn.wordpress.org/branches/4.9@43514


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-19 20:16:26 +00:00
K. Adam White
2afa2b446f REST API: Support meta registration for specific object subtypes.
Introduce an object_subtype argument to the args array for register_meta() which can be used to limit meta registration to a single subtype (e.g. a custom post type or taxonomy, vs all posts or taxonomies).

Introduce register_post_meta() and register_term_meta() wrapper methods for register_meta to provide a convenient interface for the common case of registering meta for a specific taxonomy or post type. These methods work the way plugin developers have often expected register_meta to function, and should be used in place of direct register_meta where possible.

Props flixos90, tharsheblows, spacedmonkey.

Merges [43378] to the 4.9 branch.
Fixes #38323.

Built from https://develop.svn.wordpress.org/branches/4.9@43510


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43339 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-19 18:49:25 +00:00
Sergey Biryukov
76138b9b66 Privacy: Use a consistent case for "Privacy Policy page" on Privacy Settings screen.
Props XpertOne, idea15, garrett-eclipse.
Merges [43508] to the 4.9 branch.
Fixes #44130.
Built from https://develop.svn.wordpress.org/branches/4.9@43509


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43338 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-19 12:17:25 +00:00
Sergey Biryukov
53ae774168 Privacy: Use the actual Privacy Policy page title in get_the_privacy_policy_link().
Props desrosj, birgire, ianbelanger, Ov3rfly.
Merges [43506] to the 4.9 branch.
Fixes #44192.
Built from https://develop.svn.wordpress.org/branches/4.9@43507


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43336 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-18 11:52:25 +00:00
Sergey Biryukov
4a6101fc53 I18N: Update list of continents and cities for the timezone selection.
Props soulseekah, dyrer.
Merges [43504] to the 4.9 branch.
Fixes #44574.
Built from https://develop.svn.wordpress.org/branches/4.9@43505


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43334 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-18 11:27:24 +00:00
Gary Pendergast
bf820c9036 Dashboard: Introduce the "Try Gutenberg" callout.
To encourage folks to prepare for Gutenberg, this new Dashboard box allows site users to easily install and try the Gutenberg plugin now, or to install the Classic Editor plugin before WordPress 5.0 is released.

Props pento, melchoyce, joen, karmatosed, joemcgill, SergeyBiryukov, jorbin, bph, Clorith, afercia, chanthaboune, chrislema, kjellr, matveb, michelleweber.
Fixes #41316.


Built from https://develop.svn.wordpress.org/branches/4.9@43502


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-18 06:42:26 +00:00
Sergey Biryukov
c74898bab3 Privacy: Add unit tests for _wp_privacy_send_request_confirmation_notification(), introduced in [43211].
Props birgire, desrosj, garrett-eclipse.
Merges [43499] to the 4.9 branch.
Fixes #43967.
Built from https://develop.svn.wordpress.org/branches/4.9@43500


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43327 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-17 23:03:25 +00:00
Aaron Campbell
98d47f2c7e Post WordPress 4.9.8 Beta 1 version bump.
Built from https://develop.svn.wordpress.org/branches/4.9@43498


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-17 19:41:25 +00:00
Aaron Campbell
33ff5ac5f0 WordPress 4.9.8 Beta 1.
Built from https://develop.svn.wordpress.org/branches/4.9@43497


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43324 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-17 19:28:25 +00:00
Sergey Biryukov
9ebbcad7a0 Privacy: Mark Privacy Policy page as such in the Pages list table.
Props desrosj, subrataemfluence, ianbelanger, danieltj.
Merges [43495] to the 4.9 branch.
Fixes #44006.
Built from https://develop.svn.wordpress.org/branches/4.9@43496


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-17 16:47:26 +00:00
Sergey Biryukov
e8b54ed885 Twenty Seventeen: Correct list item style for nested unordered lists.
Props macbookandrew, audrasjb.
Merges [43493] to the 4.9 branch.
Fixes #44109.
Built from https://develop.svn.wordpress.org/branches/4.9@43494


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-17 16:37:25 +00:00
Sergey Biryukov
1f1b7df292 Taxonomy: Ensure that invalid term objects are discarded in WP_Term_Query.
The `get_term()` mapping may result in term objects that are `null` or
`WP_Error` when plugins use `get_term` or a related filter. Since `null`
and error objects are not valid results for a term query, we discard
them.

Props GM_Alex.
Merges [43049] and [43491] to the 4.9 branch.
Fixes #42691.
Built from https://develop.svn.wordpress.org/branches/4.9@43492


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43319 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-17 16:28:25 +00:00
Sergey Biryukov
63779784f3 REST API: Fix some incorrect @since tags.
[43437] included some new methods, which were incorrectly tagged as being `@since 4.9.7`. This updates them to `4.9.8`.

Props danielbachhuber.
Merges [43463] to the 4.9 branch.
Fixes #44287.
Built from https://develop.svn.wordpress.org/branches/4.9@43490


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43317 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-17 16:16:26 +00:00
Sergey Biryukov
d413bb103d REST API: Attachments controller should respect upload limits.
When the REST API is in use on WordPress multisite, the `WP_REST_Attachments_Controller` should respect the "Max upload file size" and "Site upload space" site options.

Props flixos90, danielbachhuber.
Merges [43462] to the 4.9 branch.
Fixes #43751.
Built from https://develop.svn.wordpress.org/branches/4.9@43489


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43316 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-17 16:12:27 +00:00
Sergey Biryukov
c22ddf38ed Privacy: Add $request to $email_data to make it available to all filters.
Props desrosj.
Merges [43477] to the 4.9 branch.
Fixes #44379.
Built from https://develop.svn.wordpress.org/branches/4.9@43488


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-17 16:10:27 +00:00
Sergey Biryukov
d954d6213a Privacy: Enable pagination screen options for privacy requests list tables.
Props birgire, pbiron.
Merges [43486] to the 4.9 branch.
Fixes #44025.
Built from https://develop.svn.wordpress.org/branches/4.9@43487


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43314 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-17 16:08:26 +00:00
Sergey Biryukov
7aab30a907 Privacy: Remove some unnecessary code comments.
[42967] introduced some WPCS-related comments, probably accidentally saved by an IDE.

Props burhandodhy.
Merges [43465] to the 4.9 branch.
Fixes #44590.
Built from https://develop.svn.wordpress.org/branches/4.9@43485


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43312 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-17 15:25:24 +00:00
Sergey Biryukov
1fadf698a1 Streams: Return early from wp_is_stream() for paths that aren't streams.
Some versions of PHP appear to have a memory leak that is occasionally triggered by calling `stream_get_wrappers()`. In order to avoid calling this, we can return early from `wp_is_stream()` when `$path` doesn't contain `://`.

Props pbiron, JPry, dontstealmyfish.
Merges [43466] to the 4.9 branch.
Fixes #44532.
Built from https://develop.svn.wordpress.org/branches/4.9@43484


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-17 15:20:26 +00:00
Sergey Biryukov
227534fae8 Streams: When checking in wp_is_stream() escape the stream wrapper names for PCRE to avoid PHP warnings when invalid stream wrappers are registered.
Props dd32.
Merges [42432] to the 4.9 branch.
Fixes #43054.
Built from https://develop.svn.wordpress.org/branches/4.9@43483


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43310 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-17 15:19:24 +00:00
Sergey Biryukov
ec980c34e0 Editor: Use apply_filters_deprecated() for some deprecated filters.
The `htmledit_pre` and `richedit_pre` filters have been deprecated since 4.3.0, since before `apply_filters_deprecated()` existed. They're now correctly run using `apply_filters_deprecated()`.

Props sebastienthivinfocom, lbenicio, ianbelanger.
Merges [43464] to the 4.9 branch.
Fixes #44341.
Built from https://develop.svn.wordpress.org/branches/4.9@43482


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43309 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-17 15:05:25 +00:00
Andrew Ozz
dcb9622465 Customize: Do not attempt to count uncountable value.
Props dlh.
Merges [43480] to the 4.9 branch.
Fixes #44104.
Built from https://develop.svn.wordpress.org/branches/4.9@43481


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-17 14:40:23 +00:00
Sergey Biryukov
29dfd13361 Privacy: Rename username_or_email_to_export POST variable on Erase Personal Data screen to a more generic username_or_email_for_privacy_request.
Props ianbelanger, allendav.
Merges [43478] to the 4.9 branch.
Fixes #44181.
Built from https://develop.svn.wordpress.org/branches/4.9@43479


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43306 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-17 14:18:27 +00:00
Andrew Ozz
42a2dc2f7a Privacy: Add filter for the subject of the erasure complete notification emails.
Props desrosj.
Merges [43475] to the 4.9 branch.
Fixes #44265.


Built from https://develop.svn.wordpress.org/branches/4.9@43476


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-17 13:44:25 +00:00
Andrew Ozz
249407985c TinyMCE: do not force-load external plugins, not needed any more and may cause issues.
Merges [43337] to the 4.9 branch.
Fixes #44330.
Built from https://develop.svn.wordpress.org/branches/4.9@43474


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43301 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-17 10:09:24 +00:00
Andrew Ozz
fa393c7fdc Privacy: Fix tests after [43467].
Merges [43471] to the 4.9. branch.
See #44141.

Built from https://develop.svn.wordpress.org/branches/4.9@43473


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43300 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-17 10:07:25 +00:00
Andrew Ozz
6547731cfe TinyMCE: update to 4.8.0, changelog: https://www.tiny.cloud/docs/changelog/#version480july112018
Merges [43447] to the 4.9 branch.
Fixes #44134.
Built from https://develop.svn.wordpress.org/branches/4.9@43472


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43299 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-17 10:04:26 +00:00
Andrew Ozz
eeef639639 Privacy: Add a setting to disable comment cookie consent.
Merges [43469] to the 4.9 branch.
Fixes #44373.
Built from https://develop.svn.wordpress.org/branches/4.9@43470


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43297 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-17 09:30:25 +00:00
Andrew Ozz
672ccbbc3c Privacy: Don't replace comment author URL and email with anything.
Props TZ-Media, desrosj, birgire.
Merges [43467] to the 4.9 branch.
Fixes #44141.
Built from https://develop.svn.wordpress.org/branches/4.9@43468


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43295 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-17 09:04:28 +00:00
Sergey Biryukov
c0903e830b Posts, Post Types: Add a new add_inline_data action which allows extra fields to be added to the inline editing fields.
Props mensmaximus, NathanAtmoz.
Merges [42676] and [43460] to the 4.9 branch.
Fixes #36085.
Built from https://develop.svn.wordpress.org/branches/4.9@43461


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43288 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-16 15:34:25 +00:00
Sergey Biryukov
cb2625e260 Privacy: Use consistent values for the site name and URL used in notification emails.
The functions `send_confirmation_on_profile_email()`, `_wp_privacy_send_request_confirmation_notification()`, `_wp_privacy_send_erasure_fulfillment_notification()`, and `wp_send_user_request()` all include a title and URL indicating the current site. However, so far they have dealt with those values inconsistently, sometimes using the site values, other times using the network values if in a multisite. This changeset ensures that only the current site is taken into account in all cases and that special characters in the site name are consistently decoded.

Props subrataemfluence, desrosj.
Merges [43388], [43390], and [43435] to the 4.9 branch.
Fixes #44396.
Built from https://develop.svn.wordpress.org/branches/4.9@43459


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43286 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-16 14:24:26 +00:00
Sergey Biryukov
d2342e75d0 Login and Registration: Set a better default value for $wp_error parameter in login_header().
To prevent someone from passing a string (which would not be added to a new `WP_Error` instance), check for `is_wp_error()` explicitly.

Props desrosj, chetan200891, spyderbytes, lbenicio, sebastien@thivinfo.com, abdullahramzan.
Merges [43457] to the 4.9 branch.
Fixes #44052.
Built from https://develop.svn.wordpress.org/branches/4.9@43458


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43285 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-16 14:14:27 +00:00
Sergey Biryukov
665b28aad0 Privacy: use wp_login_url() for the link in the user confirmation email.
Props desrosj, usmankhalid.
Merges [43379] to the 4.9 branch.
Fixes #44353.
Built from https://develop.svn.wordpress.org/branches/4.9@43456


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43283 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-16 13:54:26 +00:00
Sergey Biryukov
30b402c24b Privacy: append (Draft) to draft page titles in the page drop-down on the Privacy Settings screen.
Props allendav, desrosj.
Merges [43376] and [43454] to the 4.9 branch.
Fixes #44100.
Built from https://develop.svn.wordpress.org/branches/4.9@43455


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43282 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-16 13:52:26 +00:00
Sergey Biryukov
8040b247a4 Privacy: on the Privacy Settings screen change view to preview when a draft page is selected for the privacy policy.
Props garrett-eclipse, desrosj.
Merges [43374] to the 4.9 branch.
Fixes #44131.
Built from https://develop.svn.wordpress.org/branches/4.9@43453


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43280 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-16 13:30:26 +00:00
Sergey Biryukov
14a11fc4db Privacy: Change @since entry for user_request_confirmed_email_subject filter added in [43373] to 4.9.8.
Merges [43451] to the 4.9 branch.
Fixes #44382.
Built from https://develop.svn.wordpress.org/branches/4.9@43452


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43279 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-16 13:24:27 +00:00
Sergey Biryukov
8f33283493 Privacy: add user request type to the admin notification email subject.
Merges [43375] to the 4.9 branch.
Props birgire, desrosj.
Fixes #44099.
Built from https://develop.svn.wordpress.org/branches/4.9@43450


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43277 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-16 12:09:26 +00:00
Sergey Biryukov
9ad59101ab Privacy: do not show the comment cookies opt-in checkbox (on the front-end comments form) when comment cookies are disabled.
Props felipeelia, johnbillion.
Merges [43370] to the 4.9 branch.
Fixes #44342.
Built from https://develop.svn.wordpress.org/branches/4.9@43449


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43276 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-16 12:07:25 +00:00
Sergey Biryukov
b74a18dc8b Privacy: Silence is golden and invisible.
"Be more discrete." declared matt in [3155], and since then, "Silence is Golden" has been the calling card of placeholder index files. Historically, these have been php files, but [43012] changed that and added index.html files for privacy export generated folders.

The php silence files produce no visible content. This adds consistency with these new html files in that there will be no visible content. Silence will fall when the question is asked.

Merges [43446] to the 4.9 branch.
Fixes #44195.
Props audrasjb, rafsuntaskin, Ov3rfly, johnbillion, pento
Built from https://develop.svn.wordpress.org/branches/4.9@43448


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-16 12:02:29 +00:00
Gary Pendergast
595cd450eb REST API: Filter responses based on the _fields parameter, before data is processed.
Historically, the REST API would generate the entire response object, including running expensive filters, then it would apply the `_fields` parameter, discarding the fields that weren't specificed.

This change causes `_fields` to be applied earlier, so that only requested fields are processed.

Merges [43087] to the 4.9 branch.

Props danielbachhuber.
See #43874.


Built from https://develop.svn.wordpress.org/branches/4.9@43445


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43272 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-13 06:51:27 +00:00
Gary Pendergast
cb0ea9d291 Emoji: Update Twemoji to version 11.0.
🦹

Backport of [43377] to the 4.9 branch.

Props kraftbj,
Fixes #44339.


Built from https://develop.svn.wordpress.org/branches/4.9@43444


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43271 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-13 06:37:26 +00:00
Gary Pendergast
547a500699 REST API: Tweak permission checks for taxonomy and term endpoints
To match behaviour in the Classic Editor, we need to slightly loosen permissions on taxonomy and term endpoints. This allows users to create terms to assign to a post that they're editing.

Merges [43440] to the 4.9 branch.

Props danielbachhuber.
Fixes #44096.


Built from https://develop.svn.wordpress.org/branches/4.9@43443


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-13 06:29:25 +00:00
Gary Pendergast
d802d709c7 REST API: Expose revision count and last revision ID on Post response
So that REST API clients can show appropriate UI for a post's revisions, it needs to know how many revisions the post has, and what the latest revision ID is.

Merge of [43439] and [43441] to the 4.9 branch.

Props kadamwhite, danielbachhuber, birgire, TimothyBlynJacobs, pento.
Fixes #44321.


Built from https://develop.svn.wordpress.org/branches/4.9@43442


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43269 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-13 06:14:25 +00:00
Gary Pendergast
26f6aeaeea REST API: Declare user capabilities using JSON Hyper Schema's "targetSchema".
There are a variety of operations a WordPress user can only perform if they have the correct capabilities. A REST API client should only display UI for one of these operations if the WordPress user can perform the operation.

Rather than requiring REST API clients to calculate whether to display UI based on potentially complicated combinations of user capabilities, `targetSchema` allows us to expose a single flag to show whether the corresponding UI should be displayed.

This change also includes flags on post objects for the following actions:

- `action-publish`: The current user can publish this post.
- `action-sticky`: The current user can make this post sticky, and the post type supports sticking.
- `action-assign-author': The current user can change the author on this post.
- `action-assign-{$taxonomy}`: The current user can assign terms from the "$taxonomy" taxonomy to this post.
- `action-create-{$taxonomy}`: The current user can create terms int the "$taxonomy" taxonomy.

Merges [43437] to the 4.9 branch.

Props TimothyBlynJacobs, danielbachhuber.
Fixes #44287.


Built from https://develop.svn.wordpress.org/branches/4.9@43438


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43265 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-11 09:21:29 +00:00
Aaron Campbell
cf8c4fa0d8 Bump 4.9 branch to version 4.9.7
Built from https://develop.svn.wordpress.org/branches/4.9@43407


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43235 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-05 16:05:26 +00:00
John Blackbourn
b564da95fb Media: Limit thumbnail file deletions to the same directory as the original file.
Built from https://develop.svn.wordpress.org/branches/4.9@43393


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-05 14:45:31 +00:00
Andrew Ozz
b4aaf4a73c Privacy: add esc_html to assertion in test_wp_comments_personal_data_exporter.
Props mermel, 1naveengiri.
Merges [43371] to the 4.9 branch.
Fixes #44113.
Built from https://develop.svn.wordpress.org/branches/4.9@43372


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43200 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-06-28 02:40:47 +00:00
John Blackbourn
1f5f8129de Security: Harden the random aspect of the hash used for user profile and admin email address changes.
Props BjornW

Fixes #43771

Merges [43367] to the 4.9 branch.

Built from https://develop.svn.wordpress.org/branches/4.9@43368


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43196 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-06-28 02:39:07 +00:00
John Blackbourn
15054d8a94 Options, Meta APIs: Use the correct escaping function when outputting the meta box context.
Props khaihong, abdullahramzan, leanderiversen, aryamaaru, lbenicio, palmiak

Fixes #44274

Merges [43365] to the 4.9 branch.

Built from https://develop.svn.wordpress.org/branches/4.9@43366


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43194 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-06-28 02:38:18 +00:00
Sergey Biryukov
cd2f52dda1 Privacy: Make sure wp_add_privacy_policy_content() does not cause a fatal error by unintentionally flushing rewrite rules outside of the admin context.
Add a `_doing_it_wrong()` message describing the correct usage of the function.

Props kraftbj, azaozz, SergeyBiryukov, YuriV.
Merges [43361], [43362], [43363] to the 4.9 branch.
Fixes #44142.
Built from https://develop.svn.wordpress.org/branches/4.9@43364


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43192 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-06-28 02:37:26 +00:00
Sergey Biryukov
ea7c189825 Privacy: Only link to menus panel in Customizer if selected privacy page can be accessed there.
Props dlh.
Merges [43343] to the 4.9 branch.
Fixes #44117.
Built from https://develop.svn.wordpress.org/branches/4.9@43358


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43186 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-06-28 02:34:55 +00:00
Sergey Biryukov
567d4b0961 Community Events Dashboard: Always show a WordCamp if one is coming up.
WordCamps are celebrations of the local WordPress Community and once a local one is scheduled, people in that community should know it is coming. This adjusts the WordPress Events in the dashboard widgets to always display a WordCamp, even if there are multiple Meetups happening first.

Props iandunn, metalandcoffee, warmlaundry, alejandroxlopez, jorbin.
Merges [42726], [42728], and [43356] to the 4.9 branch.
Fixes #41112.
Built from https://develop.svn.wordpress.org/branches/4.9@43357


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43185 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-06-28 02:34:30 +00:00
Sergey Biryukov
e2bf0ae498 Privacy: Remove unnecessary This email has been sent to ###EMAIL### from privacy emails.
The line was copied from the emails that get sent when an email address changes, without considering if it made sense in the new context.

Props iandunn, ianbelanger, desrosj.
Merges [43353] to the 4.9 branch.
Fixes #44030.
Built from https://develop.svn.wordpress.org/branches/4.9@43354


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43182 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-06-28 02:33:14 +00:00
Sergey Biryukov
eaf96830ce Privacy: Fix typo in default privacy policy text.
Props garetharnold, abdullahramzan.
Merges [43350] to the 4.9 branch.
Fixes #44166.
Built from https://develop.svn.wordpress.org/branches/4.9@43351


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43179 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-06-28 02:31:57 +00:00
Sergey Biryukov
1bb5174584 Posts, Post Types: Clear post password cookie when logging out.
Props skoldin, subrataemfluence, ianbelanger, johnbillion.
Merges [43317] and [43318] to the 4.9 branch.
Fixes #44089.
Built from https://develop.svn.wordpress.org/branches/4.9@43349


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43177 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-06-28 02:31:05 +00:00
Sergey Biryukov
ddc8032efd Users: In wp_validate_user_request_key(), properly return the WP_Error object in case the confirmation email has expired.
Props itowhid06.
Merges [43331] to the 4.9 branch.
Fixes #44298.
Built from https://develop.svn.wordpress.org/branches/4.9@43342


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43170 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-06-28 02:28:08 +00:00
John Blackbourn
d668b72f5b Build/Test Tools: Allow the unit test framework to be used without the data directory in place.
Fixes #43982

Merges [43315] to the 4.9 branch.

Built from https://develop.svn.wordpress.org/branches/4.9@43316


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43145 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-25 22:48:28 +00:00
Boone Gorges
30b40c8f52 Taxonomy: Improve cache handling when querying for terms using all_with_object_id.
When a term query using `fields=all_with_object_id` hits the cache, the
cached `stdClass` objects must be converted to `WP_Term` objects. This
was overlooked when `WP_Term_Query` was refactored to support object
queries in [38667].

Merges [43313] to the 4.9 branch.

Props dlh.
Fixes #44221.

Built from https://develop.svn.wordpress.org/branches/4.9@43314


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43143 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-25 01:26:29 +00:00
Sergey Biryukov
5129da3af5 Docs: Document the cookies default comment field added in [42772].
Props desrosj, chetan200891.
Merges [43304] to the 4.9 branch.
See #44125.
Built from https://develop.svn.wordpress.org/branches/4.9@43306


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-21 13:17:25 +00:00
Sergey Biryukov
98eb869d8b Docs: Add missing documentation and duplicate hook references for wp_privacy_personal_data_export_file, wp_privacy_personal_data_exporters, and wp_privacy_personal_data_erasers hooks.
Props birgire.
Merges [43303] to the 4.9 branch.
See #44125.
Built from https://develop.svn.wordpress.org/branches/4.9@43305


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43134 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-21 13:16:25 +00:00
Sergey Biryukov
f1773beb0c Widgets: Allow basic inline tags in wp_sidebar_description().
The customizer has allowed HTML in sidebar descriptions since adding support for sidebars. This change ensures that basic HTML is also allowed for them in the widgets admin screen.

Props flixos90.
Merges [43275] to the 4.9 branch.
Fixes #42608.
Built from https://develop.svn.wordpress.org/branches/4.9@43302


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43131 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-21 12:43:27 +00:00
Sergey Biryukov
e782caa1e7 Comments: Escape permalink values on edit screen to prevent XSS.
There doesn't appear to be any way for an attacker to introduce malicious input into the URL, unless a plugin is filtering the URL to add it, but it's better to be safe than sorry.

Props 1naveengiri, joyously.
Merges [43290] to the 4.9 branch.
Fixes #44115.
Built from https://develop.svn.wordpress.org/branches/4.9@43301


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43130 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-21 12:40:26 +00:00
Sergey Biryukov
4d9aadc80c Privacy: Correct the error check when creating an export folder in wp_privacy_generate_personal_data_export_file().
`wp_mkdir_p()` returns `false` on error, not a `WP_Error` object.

Props birgire.
Merges [43299] to the 4.9 branch.
Fixes #44158.
Built from https://develop.svn.wordpress.org/branches/4.9@43300


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43129 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-21 12:02:29 +00:00
Dominik Schilling
09734c5576 Branch 4.9 is now 4.9.7-alpha.
Built from https://develop.svn.wordpress.org/branches/4.9@43298


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43127 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-17 19:57:27 +00:00
iandunn
0afda3e678 Bump 4.9 branch to version 4.9.5.
Built from https://develop.svn.wordpress.org/branches/4.9@43296


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43125 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-17 18:56:26 +00:00
iandunn
05d3ae380d Bundled Themes: Bump version numbers and update changelogs for 4.9.6 release
Also, updates POT files for Twenty Ten and Twenty Eleven.

Props earnjam, laurelfulford.
Merges [43293] to the 4.9 branch.
Fixes #43915.

Built from https://develop.svn.wordpress.org/branches/4.9@43295


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43124 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-17 18:27:27 +00:00
iandunn
d097213a7b Bundled Themes: Add link to privacy policy page in footer.
If a privacy policy has been set, then a link to it will automatically be shown in the footer.

The element containing the "Proudly powered by WordPress" link was chosen for the new policy link, in order to minimize visual conflicts with custom CSS that was written before the new link existed. Unfortunately, some minor conflicts are expected and unavoidable. Adding this link is required as part of GDPR compliance, and the benefits outweigh the downsides. 

To further mitigate the conflicts, a new imprint class was added to the "Proudly powered..." link, in order to facilitate targeting each link invididually with custom styles.

This was accidentally not backported to the `4.9` branch before the beta/RC phase, but there was a consensus that it is safe to do that this late in the release cycle. 
See https://wordpress.slack.com/archives/C02RQBWTW/p1526577643000132.
See https://wordpress.slack.com/archives/C02RQBWTW/p1526580781000240.

Props xkon, laurelfulford, birgire, azaozz, iandunn.
Merges [43051] to the 4.9 branch.
See #43715.

Built from https://develop.svn.wordpress.org/branches/4.9@43294


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43123 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-17 18:21:26 +00:00
iandunn
bed757a726 Post WordPress 4.9.6 RC 2 version bump.
Built from https://develop.svn.wordpress.org/branches/4.9@43289


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43118 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-15 21:29:26 +00:00
iandunn
68c6632f86 WordPress 4.9.6 RC 2.
Built from https://develop.svn.wordpress.org/branches/4.9@43288


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43117 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-15 21:20:27 +00:00
iandunn
4bfee774d5 Privacy: Require manage_privacy_options to edit policy page.
A user is required to have the `manage_privacy_options` capability in order to determine which page is set as the privacy policy (the `wp_page_for_privacy_policy`). Given that, it doesn't make sense to allow users without that capability to edit or delete the page. 

A similar situation exists with the `page_for_posts` and `page_on_front` options, but Editors are allowed to edit those pages. The reason that this situation is different is because it is more likely that an administrator will want to restrict modifications to the privacy policy, than it is that they will want to allow modifications. Modifications to the policy often require specialized knowledge of local laws, and can have implications for compliance with those laws.

Props dlh, desrosj.
Merges [43286] to the 4.9 branch.
Fixes #44079.

Built from https://develop.svn.wordpress.org/branches/4.9@43287


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43116 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-15 20:59:25 +00:00