Commit Graph

5907 Commits

Author SHA1 Message Date
Gary Pendergast
36a2ed3f56 Docs: Document the $page_hook action.
Props johnbillion.
Fixes #43643.



git-svn-id: https://develop.svn.wordpress.org/trunk@44501 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-09 06:13:44 +00:00
Gary Pendergast
acba2e55df Privacy: Tweak the wording of the success notice when updating the privacy policy page setting.
Props garrett-eclipse.
Fixes #44129.



git-svn-id: https://develop.svn.wordpress.org/trunk@44493 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-09 04:18:10 +00:00
Gary Pendergast
1c6336c881 Privacy: Always show the privacy policy guide.
Previously, the link to the privacy policy guide would only be displayed when a privacy policy page had been selected, but the guide is generally useful without that.

Props mukesh27, birgire.
Fixes #44871.



git-svn-id: https://develop.svn.wordpress.org/trunk@44492 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-09 04:00:10 +00:00
Gary Pendergast
bd7415490e Docs: Update the @since tag for the comment_status_links filter.
Fixes #42379.



git-svn-id: https://develop.svn.wordpress.org/trunk@44487 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-09 01:05:04 +00:00
Gary Pendergast
b9e752770c Admin: Add a "Set up your homepage" link to the Welcome panel.
As many WordPress sites use a static homepage rather than a blog, this link gives a natural next step for new sites owners wanting to configure their site in this manner.

Props professor44, joyously, nielslange, mukesh27, melchoyce.
Fixes #45019.



git-svn-id: https://develop.svn.wordpress.org/trunk@44485 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-09 00:11:25 +00:00
Jonathan Desrosiers
49509a1c6a Docs: Specify missing global variables used in wp_print_theme_file_tree().
The `$relative_file` and `$stylesheet` variables are used in the `wp_print_theme_file_tree()` function but were not noted within the inline documentation.

Props mukesh27, desrosj,
Fixes #43682.

git-svn-id: https://develop.svn.wordpress.org/trunk@44477 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-08 18:32:10 +00:00
Felix Arntz
aea4b2765a General: Make Update PHP notice link customizable.
After [42832], [42891] and [43006], this changeset refines the core notice informing about an outdated PHP version:

* The link to the Update PHP information page can now be adjusted using either a `WP_UPDATE_PHP_URL` environment variable, or a new `wp_update_php_url` filter.
* If that URL is different from the default one that points to https://wordpress.org/support/update-php/ or its localized equivalent, a note indicates that the linked resource has not been provided by WordPress itself, and the default URL is still linked to as an additional resource.
* The URL for the default information page has been updated to use the slug `update-php` instead of `upgrade-php`.
* `@since` annotations have been updated.

Going forward, admin areas that display information related to the PHP version should use the new function `wp_get_update_php_url()`.

Props afragen, fierevere, flixos90, markjaquith, miss_jwo, nerrad, pento, schlessera, SergeyBiryukov, spacedmonkey.
Fixes #45686. See #41191.


git-svn-id: https://develop.svn.wordpress.org/trunk@44476 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-08 17:26:38 +00:00
Jonathan Desrosiers
59bb9742e6 Docs: Fix order of parameter type and variable name.
The order of the type and variable name in the `param` tags for the `wp_get_default_privacy_policy_content` filter is incorrectly reversed. This moves the two into the correct order.

Props ishitaka, mukesh27.
Fixes #45416.

git-svn-id: https://develop.svn.wordpress.org/trunk@44475 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-08 17:02:55 +00:00
Felix Arntz
855606e29d Multisite: Update @since tags for site management APIs.
Fixes #40364. Fixes #41333.


git-svn-id: https://develop.svn.wordpress.org/trunk@44469 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-08 08:57:32 +00:00
Felix Arntz
5fdfac40f2 Multisite: Move site-specific metadata integrations from the wrapper functions to the low-level Meta API functions.
This complements the work in [43729] and prepares site metadata for future REST API support.

Props spacedmonkey.
Fixes #45091. See #44467.


git-svn-id: https://develop.svn.wordpress.org/trunk@44468 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-08 08:47:37 +00:00
Felix Arntz
4657735ba6 Multisite: Update @since tags for site meta introduction.
Fixes #37923. Fixes #40229.


git-svn-id: https://develop.svn.wordpress.org/trunk@44467 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-08 08:17:34 +00:00
Gary Pendergast
34cd08cd37 Comments: Improve the Author box in the Edit Comment screen.
- Add a border below the heading, to match meta boxes.
- Remove the colons from the input labels.
- Tweak the padding and margins.

Props birgire, abdullahramzan, rhetorical, BODA1982, pento.
Fixes #43586.



git-svn-id: https://develop.svn.wordpress.org/trunk@44466 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-08 06:18:17 +00:00
Gary Pendergast
19e46911cf Docs: Fix the @param type for wp_make_plugin_file_tree().
`$plugin_editable_files` is an `array`, not a `string`.

Props subrataemfluence.
Fixes #45593.



git-svn-id: https://develop.svn.wordpress.org/trunk@44464 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-08 06:01:50 +00:00
Gary Pendergast
34d4988db6 Docs: Improve the @return description of network_domain_check().
Props ishitaka, vaishalipanchal.
Fixes #45403.



git-svn-id: https://develop.svn.wordpress.org/trunk@44460 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-08 05:26:29 +00:00
Gary Pendergast
ccc55debda General: Replace "Happy blogging" with "Happy publishing".
As of this commit, WordPress is no longer a simple blogging platform. It's now a comprehensive publishing solution.

This also replaces a couple of other "blog" references that were missed previously.

Props igmoweb, Valer1e, audrasjb, pento.
Fixes #41000.



git-svn-id: https://develop.svn.wordpress.org/trunk@44455 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-08 04:29:06 +00:00
Gary Pendergast
7bf44ed065 Install/Upgrade: Link to HelpHub instead of the Codex.
WordPress version links in the Codex (eg, https://codex.wordpress.org/Version_5.0) are redirected to their HelpHub equivalent.

Rather than relying on the redirect, Core and link directly to HelpHub.

Props swissspidy.
Fixes #45574.



git-svn-id: https://develop.svn.wordpress.org/trunk@44451 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-08 03:28:15 +00:00
Gary Pendergast
36949b760f Docs: Update @since for populate_site_meta().
Fixes #44896.



git-svn-id: https://develop.svn.wordpress.org/trunk@44450 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-08 03:17:16 +00:00
Gary Pendergast
c7ed2d098d Docs: Update @since for populate_network_meta().
Fixes #44895.



git-svn-id: https://develop.svn.wordpress.org/trunk@44449 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-08 03:16:04 +00:00
Gary Pendergast
6b9c60a98a Docs: Update @since for the optional $options parameter to populate_options().
Fixes #44893.



git-svn-id: https://develop.svn.wordpress.org/trunk@44448 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-08 03:14:09 +00:00
Jonathan Desrosiers
c7fb3b36ea Block Editor: Display notice to the user when JavaScript is disabled.
Currently, when viewing the block editor with JavaScript disabled, the user sees a blank admin page with the admin menu sidebar. This adds an admin notice informing the user that JavaScript is required for the new block editor.

Props mkaz, pento, azaozz, ocean90, desrosj.
Fixes #45453.

git-svn-id: https://develop.svn.wordpress.org/trunk@44437 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-07 20:39:56 +00:00
Sergey Biryukov
6d8e3c5864 Plugins: Use newer "Updating PHP" page URL in the notice displayed when a plugin requires a higher PHP version.
Props afragen.
Fixes #43986. See #45686.

git-svn-id: https://develop.svn.wordpress.org/trunk@44420 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-07 15:34:34 +00:00
Sergey Biryukov
7b362c12ed Importers: Use correct l10n variable in wp.updates.installImporterError and filesystem credentials dialog.
Missed in [40034].

Props afercia, abhayvishwakarma.
Fixes #45765.

git-svn-id: https://develop.svn.wordpress.org/trunk@44417 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-07 13:48:32 +00:00
Jonathan Desrosiers
bc9b631bc6 Docs: Update since tag for new intermediate_image_sizes_advanced filter parameter.
Originally added in [42407].

Fixes #42745.

git-svn-id: https://develop.svn.wordpress.org/trunk@44385 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-03 17:46:13 +00:00
Sergey Biryukov
de5ab7155b Taxonomy: Fix typo in taxonomy_meta_box_sanitize_cb_checkboxes() argument name.
Props itowhid06.
Fixes #45756.

git-svn-id: https://develop.svn.wordpress.org/trunk@44367 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-28 18:03:06 +00:00
Sergey Biryukov
f2db5d2bb2 Build Tools: Remove unnecessary sprintf() in translatable strings.
Add a missing `sprintf()` for `npm install` substring.

See #44492.

git-svn-id: https://develop.svn.wordpress.org/trunk@44366 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-28 13:52:31 +00:00
Anton Timmermans
68dd26a4c0 Build tools: Fix the grunt format:php build.
Re-add variable that was removed on accident by [44359]. Also run `grunt format:php` to adjust the code style.
.--This line, and those below, will be ignored--

M    Gruntfile.js
M    src/index.php
M    src/wp-admin/index.php
M    src/wp-includes/class-wp-block-parser.php


git-svn-id: https://develop.svn.wordpress.org/trunk@44360 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-24 13:44:05 +00:00
Anton Timmermans
d2d7243e80 Build tools: Allow building WordPress to src.
After the JavaScript reorganization in [43309], it was no longer possible to test WordPress from the `src` folder. That meant a build step was required to test PHP modifications. That is suboptimal as even a simple copy is slower than a web server just serving the new file.

We achieve building to `src` by setting a `WORKING_DIR` constant in the Gruntfile that is `build` by default, but changes to `src` when the `--dev` flag is present on any Grunt command. We provide sensible defaults so some commands, such as copying `version.php`, always build to `build`.

Because testing from `build` is no longer required, we change the messages present in `index.php` and `wp-admin/index.php` to be more broadly about building WordPress.

We also change the webpack config to have more straightforward behavior based on the `buildTarget` argument. It only determines the build target now and has no implicit behavior anymore. `grunt build` still works as it worked before, to make sure that the build server produces the same `wordpress.zip` we are used to.

We do all this instead of a symlink setup because symlinks don't work on every platform.

Props omarreiss, netweb, flixos90, SergeyBiryukov.
Fixes #44492.


git-svn-id: https://develop.svn.wordpress.org/trunk@44359 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-24 13:28:22 +00:00
Jonathan Desrosiers
96a6ed10dc Administration: Update default fallback color for SVG icons.
Currently, when an SVG is used as a menu icon, the color is inconsistent with the other, default dashicons and the contrast ratio does not meet the minimum requirement for accessibility.

This updates the base color for the default `fresh` color scheme to ensure consistency and proper contrast.

Props swift, dschalk.
Fixes #44209.

git-svn-id: https://develop.svn.wordpress.org/trunk@44353 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-20 19:00:39 +00:00
Sergey Biryukov
14335331e6 Plugins: Colorize plugin card compatibility icons on Add Plugins screen.
Props afragen, melchoyce, daniel-koskinen.
Fixes #44619.

git-svn-id: https://develop.svn.wordpress.org/trunk@44352 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-20 18:14:42 +00:00
Jonathan Desrosiers
47584c7bc0 Posts, Post Types: Correctly show hierarchical post type hierarchy in admin.
In [44185], a bug was introduced where hierarchical post types would not display in the correct default order (hierarchically).

This was caused by a `! isset()` check, which returned `false` after [44185], causing the correct default value to not be applied. This switches that conditional to use an `empty()` check, ignoring the new empty string assignment that was added to prevent a PHP notice when `compact()` is called.

Props davidbinda.
Fixes #45711.

git-svn-id: https://develop.svn.wordpress.org/trunk@44338 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-19 22:22:50 +00:00
Drew Jaynes
cd55551896 Docs: Add a missing DocBlock summary and $action parameter description for wp_ajax_delete_page().
Props abhijitrakas.
Fixes #44206.


git-svn-id: https://develop.svn.wordpress.org/trunk@44335 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-19 16:59:14 +00:00
Drew Jaynes
3e4a5df698 Docs: Fix a few minor inline documentation typos in a variety of files and contexts.
Props ramizmanked.
Fixes #45463.


git-svn-id: https://develop.svn.wordpress.org/trunk@44331 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-19 07:41:41 +00:00
Jeremy Felt
4042ab08ca Build: Update images following [43684].
`grunt-contrib-imagemin` was updated, which included some changes to image minification. Those changes are now applies.

Merges [43785] from the 5.0 branch to trunk.

Props netweb.
See #45080.


git-svn-id: https://develop.svn.wordpress.org/trunk@44320 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-19 00:33:59 +00:00
Jonathan Desrosiers
556e442814 Block Editor: Remove a deprecated notice being generated by the meta box compat functions.
Props pento.

Merges [44248] into trunk.

Fixes #45456.

git-svn-id: https://develop.svn.wordpress.org/trunk@44315 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-18 23:31:54 +00:00
Jonathan Desrosiers
7cda2404b5 PHP 7.3 Compatibility: Fix compact related 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. This fixes a few more instances of unset variables in the WordPress admin.

The full RFC can be viewed here: https://wiki.php.net/rfc/compact.

See #44416.

Merges [44185] into trunk.

Fixes #45483.

git-svn-id: https://develop.svn.wordpress.org/trunk@44297 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-18 21:59:00 +00:00
Jonathan Desrosiers
f28ba0c9f6 Editor: Remove unwanted fields before saving posts.
The meta_input, file, and guid fields are not intended to be updated through user input.

Merges [44047] to trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@44295 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-18 21:31:14 +00:00
Jonathan Desrosiers
07cf8f3073 Block Editor: Show privacy help notice on Privacy Policy page.
When editing a page set to be the Privacy Policy page, display a help notice
containing a link to the Privacy Policy guide.

Merges [43920] to trunk.

Fixes #45057.

git-svn-id: https://develop.svn.wordpress.org/trunk@44291 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-18 16:13:59 +00:00
Jonathan Desrosiers
e318383bd0 Block Editor: Add a placeholder for meta boxes that don't work in the block editor.
If a meta box is registered with the `__block_editor_compatible_meta_box` set to `false`, it's indicating that it doesn't work in the block editor. If that's the case, we can add a place holder to inform the user that they'll need to use the classic interface to work with this meta box.

Props pento, jorgefilipecosta, peterwilsoncc, karmatosed, noisysocks, dd32, ocean90.

Merges [43941] and [43945] to trunk.

Fixes #45217.

git-svn-id: https://develop.svn.wordpress.org/trunk@44280 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-17 21:51:43 +00:00
Jonathan Desrosiers
15fa394a01 Block Editor: Fix the WordPress packages and vendor script registration.
The version is set properly and the scripts are automatically loaded in the footer.

This patch also includes a revert for the reusable blocks enqueue script.

Props pento, swissspidy, youknowriad.

Merges [43942] into trunk.

Fixes #45402.
See #45396.

git-svn-id: https://develop.svn.wordpress.org/trunk@44277 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-17 19:33:09 +00:00
Jonathan Desrosiers
d75cc8612b Block Editor: Refresh nonces used by wp.apiFetch.
Adds heartbeat nonces refreshing support to `wp.apiFetch` requests.

Props pento, adamsilverstein, dd32, desrosj, youknowriad.

Merges [43939] into trunk.

Fixes #45113. 

git-svn-id: https://develop.svn.wordpress.org/trunk@44275 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-17 19:27:08 +00:00
Jonathan Desrosiers
d2ed5529b8 Block Editor: Fix loading the script handling the "Manage Reusable Blocks" page.
This ensures the "import from JSON" and "export JSON" buttons are shown properly. The script is loaded in the footer because it relies on the DOM being already there.

Props noisysocks, mukesh27.

Merges [43936] into trunk.

Fixes #45396.

git-svn-id: https://develop.svn.wordpress.org/trunk@44274 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-17 19:07:35 +00:00
Jonathan Desrosiers
9d85e5050d Block Editor: Update @wordpress package dependencies.
Update packages include:

- block-library
- components
- edit-post
- editor
- format-library
- list-reusable-blocks
- nux

Other changes:

- Fix a translator comment in `edit-form-blocks.php`.
- Rename the `gutenberg_` functions in `blocks/latest-comments.php`.

Props noisy socks, youknowriad, pinto, swissspidy.

Merges [43935] and [43949-43951] into trunk.

See #45145.

git-svn-id: https://develop.svn.wordpress.org/trunk@44273 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-17 19:05:30 +00:00
Jonathan Desrosiers
dab0d40436 Block Editor: Fix PHP warning when loading editor styles while in RTL.
In RTL languages, WordPress adds `style-editor-rtl.css` editor styles to the global `$editor_styles`.
This patch ignores handling these styles if the file is not preset.

Also, clarify the docs for the return value of the `block_version` function.

Props mostafa.s1990, desrosj, mukesh27.

Merges [43923] and [43924] to trunk.

Fixes #45288, #45342.

git-svn-id: https://develop.svn.wordpress.org/trunk@44270 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-17 18:06:42 +00:00
Jonathan Desrosiers
e0942aec0c Block Editor: Expose value of user_can_richedit().
In order for the Block Editor to know whether to allow visual editing, it needs to know the value of `user_can_richedit()`.

Props youknowriad, danielbachhuber.

Merges [43916] into trunk.

Fixes #45375.

git-svn-id: https://develop.svn.wordpress.org/trunk@44267 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-17 17:08:10 +00:00
Jonathan Desrosiers
a229ea9c65 Help/About: WordPress 5.0 About Page.
The About page describes all the great changes in WordPress 5.0.

Highlights:

- Warn users of Gutenberg plugin of its deactivation upon 5.0 upgrade.
- Added illustrations to the Four Freedoms page.
- Include a link to wporg user’s plugin favorites as a way to display only the classic plugin as a suggestion for install.
- Detail the Classic Editor plugin and the support timeline.

Props pixelverbieger, ocean90, karmatosed, pento, boemedia, lonelyvegan, sami.keijonen, TimothyBlynJacobs, xkon, afercia, laurelfulford, joostdevalk, ipstenu, matveb, joen, tinkerbelly, chanthaboune, kjellr, alexislloyd, melchoyce, mcsf, courtney0burton, Otto42, cathibosco, tobifjellner, helen, audrasjb, antpb, jjj, elrae, desrosj, azaozz, joemcgill, skithund, gziolo.

Merges [43913], [43921-43922], [43937-43938], [43946-43947], [43952-43953], [43967-43969] into trunk.

Fixes #45178.

git-svn-id: https://develop.svn.wordpress.org/trunk@44264 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-17 16:35:32 +00:00
Jonathan Desrosiers
7a20625cf0 Block Editor: Update @wordpress dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.

Merges [43891], [43903], and [43919] to trunk.

Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.

git-svn-id: https://develop.svn.wordpress.org/trunk@44262 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-17 15:35:21 +00:00
Jonathan Desrosiers
572207384b Block Editor: Update @wordpress dependencies.
Changes of note:

- Includes the new Annotations API package.
- `wp-polyfill-ecmascript.js` is renamed to `wp-polyfill.js`.
- `strip_dynamic_blocks()` has been removed in favor of `excerpt_remove_blocks()`.
- The PHP block parser is now syncing from the `block-serialization-default-parser` package.
- `do_blocks()` uses the new parser.
- The `do_block` filter has been removed from `do_blocks()`, in favor of a `render_block` filter in `render_block()`.

Also, a little cleanup to `render_block()`. Always normalize `$block['attrs’]` to array in `’render_block’` filter.
Props pento, azaozz.

Merges [43884] and [43888] to trunk.

See #45145, #45190, #45264, #45282.

git-svn-id: https://develop.svn.wordpress.org/trunk@44261 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-17 04:50:48 +00:00
Jonathan Desrosiers
e63acae939 Editor: Add custom fields meta box support in the block editor.
This brings support for the custom fields meta box into the new block editor.

The `webpack` and `copy-webpack-plugin` packages have also been updated.

This does not bump the `@wordpress` packages like in [43861] because of conflicts with package versions already installed in `trunk`. The packages will be brought up to date in a subsequent merge.

Merges [43861] and [43863] into trunk.

See #45145.
Fixes #45257.

git-svn-id: https://develop.svn.wordpress.org/trunk@44260 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-17 03:51:08 +00:00
Sergey Biryukov
e03dee4e87 Block Editor: Load TinyMCE inline scripts later.
Previously, the TinyMCE inline scripts were added on the `init` action in the block editor. In the classic editor, however, these scripts are loaded when the TinyMCE window is printed, and some plugins rely on them being loaded later, so they can attach to the appropriate filters.

Props pento.
Merges [43901] to trunk.
Fixes #45338.

git-svn-id: https://develop.svn.wordpress.org/trunk@44251 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-17 00:28:36 +00:00
Sergey Biryukov
61234818ae Block Editor: Hide the Custom Fields meta box option if that meta box has been removed.
Some plugins remove the Custom Fields meta box, particularly when they provide functionality that replaces it. The block editor would correctly not display this meta box in these circumstances, but it still showed the option to display or hide it.

Props pento, noisysocks.
Merges [43885] to trunk.
See #45282.

git-svn-id: https://develop.svn.wordpress.org/trunk@44244 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 23:23:38 +00:00
Sergey Biryukov
4c20251e6d PHPCS: Fix errors introduced in [44241].
See #45283.

git-svn-id: https://develop.svn.wordpress.org/trunk@44243 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 23:03:25 +00:00
Sergey Biryukov
7dc55e9fbf Tests: Fix tests broken in PHP 5.x after [43879].
Props pento.
Merges [43883] to trunk.
See #45290.

git-svn-id: https://develop.svn.wordpress.org/trunk@44242 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 22:54:46 +00:00
Sergey Biryukov
8002325c92 Meta Boxes: Add the block_editor_meta_box_hidden_fields action.
Lacking an appropriate action in the classic editor, plugins that add meta boxes have historically hooked into various actions in order to add hidden input fields.

This change also adds backwards compatibility for two of the most common: `edit_form_after_title`, and `edit_form_advanced`.

Props pento, danielbachhuber.
Merges [43882] to trunk.
Fixes #45283.

git-svn-id: https://develop.svn.wordpress.org/trunk@44241 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 22:51:01 +00:00
Sergey Biryukov
7f326f92a5 Block Editor: Prevent the meta box form from being accidentally submitted.
Meta boxes are loaded inside a wrapper form, that the block editor submits as part of the saving process. It shouldn't be submitted manually.

Props pento.
Merges [43880] to trunk.
Fixes #45284.

git-svn-id: https://develop.svn.wordpress.org/trunk@44240 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 22:26:30 +00:00
Sergey Biryukov
00f638b6a5 Script Loader: Ensure default packages are registered when loaded via load-scripts.php.
Props CantoThemes, ocean90.
Merges [43877] to trunk.
Fixes #45271.

git-svn-id: https://develop.svn.wordpress.org/trunk@44237 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 20:37:30 +00:00
Jeremy Felt
7f2a7a3f3e Editor: Cast the result of the default_content, default_title, and default_excerpt filters.
If a plugin returns a non-string value (or returns `null`) on these filters, it can cause errors in the block editor. Casting them as a string prevents these errors.

Merges [43858] from the 5.0 branch to trunk.

Props dd32.
See #45236.


git-svn-id: https://develop.svn.wordpress.org/trunk@44224 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 01:58:41 +00:00
Jeremy Felt
3261d687bb Block Editor: Remove CodeMirror settings.
CodeMirror is no longer used in the block editor, so we don't need to load the settings.

Merges [43857] from the 5.0 branch to trunk.

Props noisysocks.
Fixes #45248.


git-svn-id: https://develop.svn.wordpress.org/trunk@44223 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 01:56:44 +00:00
Jeremy Felt
01fbdc0860 Block Editor: Don't show back compat or incompatible meta boxes in Options.
Meta boxes that exist for back compat, or that are incompatible with the block editor aren't displayed, so they don't need an option to display or hide them in the Options dialog.

Merges [43856] from the 5.0 branch to trunk.

Props noisysocks.
Fixes #45249.


git-svn-id: https://develop.svn.wordpress.org/trunk@44222 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 01:55:08 +00:00
Jeremy Felt
5c3f3b8167 Posts: Remove the slug from Quick Edit for posts that are not is_post_type_viewable().
This is a followup to [43728], which added the same check, but using the `publicly_queryable` option. This behaviour is incorrect for `_builtin` post types, which go by the logic in `is_post_type_viewable()`, instead.

Merges [43855] from the 5.0 branch to trunk.

Props pento.
See #43278.


git-svn-id: https://develop.svn.wordpress.org/trunk@44221 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 01:52:50 +00:00
Jeremy Felt
c9c6beb3f3 Blocks: Add "Export as JSON" action to the wp_block post list screen.
Remove the "Quick Edit" for `wp_block`s, too, as they don't need any of that functionality.

Merges [43854] from the 5.0 branch to trunk.

Props noisysocks.
Fixes #45247.


git-svn-id: https://develop.svn.wordpress.org/trunk@44220 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 01:48:05 +00:00
jeremyfelt
67b1a86c40 Blocks: Include necessary labels for the 'wp_block' post type.
Merges [43849] from the 5.0 branch to trunk.

Props danielbachhuber.
See #45098.


git-svn-id: https://develop.svn.wordpress.org/trunk@44215 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 01:24:01 +00:00
Jeremy Felt
9fb651d229 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.

Merges [43837] from the 5.0 branch to trunk.

Props pento, peterwilsoncc.
Fixes #45172.


git-svn-id: https://develop.svn.wordpress.org/trunk@44214 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 01:18:22 +00:00
Anton Timmermans
fa74040a36 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, pento.
Merges [43848] to trunk.
Fixes #44489.


git-svn-id: https://develop.svn.wordpress.org/trunk@44184 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 12:25:16 +00:00
Anton Timmermans
3a66624677 General: Fix code formatting issues.
Fix code formatting after [44174] and [44177].


git-svn-id: https://develop.svn.wordpress.org/trunk@44178 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 11:01:54 +00:00
Anton Timmermans
19800c7b76 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.

Props pento.
Merges [43840] to trunk.
See #45145.


git-svn-id: https://develop.svn.wordpress.org/trunk@44177 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 10:53:17 +00:00
Anton Timmermans
b053b80b59 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.

Props pento.
Merges [43839] to trunk.
Fixes #45207.


git-svn-id: https://develop.svn.wordpress.org/trunk@44175 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 09:41:56 +00:00
Anton Timmermans
f44e3f1740 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, pento.
Merges [43838] to trunk.
Fixes #45206.


git-svn-id: https://develop.svn.wordpress.org/trunk@44174 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 09:38:09 +00:00
Gary Pendergast
fb2f48d81b 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.

Merges [43833] from the 5.0 branch to trunk.

Props imath, mattheu, danielbachhuber.
Fixes #45194.



git-svn-id: https://develop.svn.wordpress.org/trunk@44172 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 06:01:24 +00:00
Gary Pendergast
9e49ba8a97 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`.

Merges [43830] from the 5.0 branch to trunk.

Props DrewAPicture.
Fixes #45192.



git-svn-id: https://develop.svn.wordpress.org/trunk@44170 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 05:54:34 +00:00
Gary Pendergast
ccd35b3c02 Upgrade/Install: Convert Sample Page, Hello World, and Privacy Policy to block content.
Merges [43820,43912] from the 5.0 branch to trunk.

Props desrosj, garrett-eclipse, danielbachhuber, dd32, ocean90.
Fixes #45151.



git-svn-id: https://develop.svn.wordpress.org/trunk@44168 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 05:42:20 +00:00
Gary Pendergast
3011f8c8e7 Editor: Merge some minor bug fixes.
There were some tweaks made to the post editor in WordPress 5.0 that hadn't been merged to `trunk`, this commit rectifies that.

Merges [43815,43816] from the 5.0 branch to trunk.

Props birgire, jorbin, abdullahramzan, adamsilverstein, mrahmadawais, airathalitov, ajitbohra, schlessera, albertomedina, aldavigdis, alexsanford1, xyfi, nitrajka, afercia, andreiglingeanu, euthelup, aduth, sumobi, anevins, azaozz, androb, andrewserong, kallehauge, nosolosw, apeatling, atimmer, arnaudban, asvinballoo, b-07, benlk, blowery, caxco93, benjamin_zekavica, kau-boy, bernhard-reiter, bcolumbia, bph, boblinthorst, bradyvercher, bpayton, brentswisher, bronsonquick, burhandodhy, icaleb, chouby, ehg, chrisvanpatten, butimnoexpert, christophherr, chriskmnds, claudiosanches, danielbachhuber, mrmadhat, danielhw, danieltj, goldsounds, dfangstrom, daniloercoli, dannycooper, nerrad, dsawardekar, davemoran118, davidherrera, dryanpress, davidsword, davisshaver, dmsnell, dlocc, diegoreymendez, dd32, dency, ocean90, donnapep, chopinbach, electricfeet, eliorivero, sewmyheadon, ericnmurphy, foobar4u, circlecube, fabs_pim, flixos90, floriansimeth, gma992, garrett-eclipse, garyj, pento, doomwaxer, revgeorge, gziolo, bordoni, hardeepasrani, helen, luehrsen, herbmiller, toro_unit, ianbelanger, iandunn, igorsch, ipstenu, ireneyoast, israelshmueli, sisanu, jd55, copons, jnylen0, jamestryon, ephoxjames, jamiehalvorson, jsnajdr, jagnew, dciso, octalmage, vengisss, jhoffm34, shenkj, audrasjb, jblz, jeremyfelt, motleydev, jipmoors, sephsekla, joemaller, joemcgill, joen, johndyer, johnjamesjacoby, joshuawold, johnny5, desrosj, jonsurrell, belcherj, sirjonathan, koke, jorgefilipecosta, shelob9, jvisick77, julienmelissas, kopepasah, kadamwhite, codebykat, ryelle, gwwar, kevinwhoffman, coderkevin, ixkaito, kjellr, obenland, lancewillett, postphotos, loicblascos, lucasstark, luigipulcini, lucaskowalski, lukepettway, mahdiyazdani, mahmoudsaeed, mkaz, tyxla, markjaquith, mapk, vindl, m-e-h, mboynes, mattheu, lonelyvegan, mtias, napy84, maurobringolf, maximebj, mayukojpn, woodent, michaelhull, mmtr86, stubgo, simison, mihai2u, mike-haydon-swo, mnelson4, mpheasant, mikeschroder, idpokute, mikeyarce, dimadin, gonzomir, milesdelliott, warmarks, munirkamal, nfmohit, nateconley, greatislander, njpanderson, notnownikki, nielslange, nikschavan, potbot, nshki, webmandesign, oskosk, pglewis, pareshradadiya-1, swissspidy, pbearne, pauldechov, psealock, paulstonier, paulwilde, pedromendonca, ptasker, peterwilsoncc, tyrannous, strategio, piersb, delawski, prtksxna, presskopp, rachelbaker, rachelmcr, rakshans1, rahmon, lamosty, youknowriad, riddhiehta02, noisysocks, deviodigital, sanchothefat, robertsky, _dorsvenabili, rohittm, magicroundabout, rmccue, welcher, ryo511, sagarprajapati, samikeijonen, scottmweaver, kluny, sharaz, giventofly76, designsimply, sstoqnov, hypest, netweb, stevehenty, stuartfeldt, sergioestevao, soean, tammie_l, karmatosed, thrijith, timgardner, timmydcrawford, tjnowell, mirucon, travislopes, truongwp, tjfunke001, vishalkakadiya, vtrpldn, walterebert, westonruter, skorasaurus, somtijds, earnjam, williampatton, willybahuaud, yoavf, zebulan, ziyaddin, abhijitrakas, andreamiddleton, csabotta, dixitadusara, etoledom, faishal, hideokamoto, imath, iseulde, j-falk, jaswrks, johnwatkins0, jomurgel, notlaura, leahkoerper, mcsf, meetjey, 0mirka00, mitogh, ephoxmogran, tacrapo, mzorz, nagayama, omarreiss, ramonopoly, rileybrook, tinkerbelly, shaileesheth, sikander, ssousa, tfrommen, yahil.

Fixes #45037.



git-svn-id: https://develop.svn.wordpress.org/trunk@44165 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 05:11:14 +00:00
Jonathan Desrosiers
88de9a1d7c 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, danielbachhuber.

Merges [43811] to trunk.

Fixes #43559.

git-svn-id: https://develop.svn.wordpress.org/trunk@44153 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 03:16:56 +00:00
Gary Pendergast
c474d190e7 Bundled Themes: Make twentynineteen the default theme.
After [44149], we can now make twentynineteen the default theme. Twentyseventeen has been a great default, but 5.0 and twentynineteen is guten.

Merges [43809,43954] from the 5.0 branch to trunk.

Fixes #45152.
Props jorbin, SergeyBiryukov, pento, mcsf.



git-svn-id: https://develop.svn.wordpress.org/trunk@44151 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 02:48:14 +00:00
Jeremy Felt
6a84afa33c Blocks: Add the reusable block post type, wp_block.
Merges [43804] from the 5.0 branch to trunk.

See #45098.


git-svn-id: https://develop.svn.wordpress.org/trunk@44146 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 02:14:13 +00:00
Jeremy Felt
f77c9bdd84 Meta Boxes: Sync checks for valid meta boxes from do_meta_boxes() to the_block_editor_meta_boxes().
Merges [43792] from the 5.0 branch to trunk.

Props ocean90.
See #45112.


git-svn-id: https://develop.svn.wordpress.org/trunk@44141 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 01:54:40 +00:00
Gary Pendergast
981678ba36 Block Editor: Add extra body classes when the block editor is loaded.
Merges [43780] from the 5.0 branch to trunk.

See #45037.



git-svn-id: https://develop.svn.wordpress.org/trunk@44133 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 01:20:12 +00:00
Gary Pendergast
23efeb45c8 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.

Merges [43779] from the 5.0 branch to trunk.

See #45112.



git-svn-id: https://develop.svn.wordpress.org/trunk@44132 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 01:17:57 +00:00
Gary Pendergast
cb0b292c87 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.

Merges [43778] from the 5.0 branch to trunk.

See #45112.



git-svn-id: https://develop.svn.wordpress.org/trunk@44131 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 01:10:20 +00:00
Gary Pendergast
99dd4f8c38 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.

Merges [43777] from the 5.0 branch to trunk.

See #45037.


git-svn-id: https://develop.svn.wordpress.org/trunk@44130 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 01:07:11 +00:00
Jonathan Desrosiers
8c5f87daf7 Upgrade/Install: Deactivate Gutenberg plugin on update to 5.0.
Props mcsf.

Merges [43765] to trunk.

Fixes #45123.

git-svn-id: https://develop.svn.wordpress.org/trunk@44125 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 21:11:22 +00:00
Jonathan Desrosiers
afa6771c23 i18n: Remove some translation domains accidentally included in [43762], [44122].
Moves [43764] to trunk.

Fixes #45110.

git-svn-id: https://develop.svn.wordpress.org/trunk@44124 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 20:50:52 +00:00
Jonathan Desrosiers
ab070e219b 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.

Props pento.

Merges [43762] to trunk.

See #45110.

git-svn-id: https://develop.svn.wordpress.org/trunk@44122 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 20:22:06 +00:00
peterwilsoncc
cac7b92f77 Multisite: Validate activation links.
git-svn-id: https://develop.svn.wordpress.org/trunk@44048 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 01:25:03 +00:00
Aaron Jorbin
7ec7fadfe7 PHPCS: Fix errors
Fix errors introduced in [43973] due to Jorbin not running the correct tag of wpcs.

Unprops jorbin.



git-svn-id: https://develop.svn.wordpress.org/trunk@43976 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-11 04:44:16 +00:00
Aaron Jorbin
891394af73 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.

Merges [43681] to trunk.

Props TimothyBlynJacobs, danielbachhuber.
Fixes #44750.


git-svn-id: https://develop.svn.wordpress.org/trunk@43973 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-11 04:00:37 +00:00
Mel Choyce
cd574077c8 List Table: Fix formatting issue introduced in r43671.
Props dd32.
See #45028.


git-svn-id: https://develop.svn.wordpress.org/trunk@43672 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-03 21:11:16 +00:00
Mel Choyce
29e8c152f1 List Table: Restore the List Table items property to allow Bulk Actions to be properly determined.
This fixes the display of Bulk Actions where there exists only a single page of results.

Props shaneeckert, jobthomas, dd32.
Fixes #45028.


git-svn-id: https://develop.svn.wordpress.org/trunk@43671 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-03 19:46:51 +00:00
Mel Choyce
cec0385656 List Tables: Arrange action items into a grid with extra space.
On small screens, list table actions were cramped. This makes it easy to press the wrong action by mistake. The items are now arranged into a grid and given extra room to create a larger tap-target.

The plugins list table was excluded because it's current layout doesn't match the others, and we should add more space to this in a future commit.

Props jobthomas, ryelle.
Fixes #45024.


git-svn-id: https://develop.svn.wordpress.org/trunk@43670 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-03 18:55:35 +00:00
Gary Pendergast
1f4ed43c65 Plugin Installer: Allow 4 columns of search results on wide screens.
For screens wider than 2300px, show 4 colums of search results, as 3 columns looked quite stretched out.

This change also increases the default number of search results from 30 to 36, so that the columns have an even number of results, regardless of whether there are 2, 3, or 4 of them.

Props nielslange.
Fixes #43573.



git-svn-id: https://develop.svn.wordpress.org/trunk@43669 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-02 20:06:37 +00:00
Gary Pendergast
53264d2463 Plugins: Pluralise the "unexpected output during activation" message.
When a plugin is activated, it can trigger a warning message if it outputs data at that time. This error message was being run through `__()`, instead of `_n()`, so it wasn't possible to correctly pluralise the message.

Props jamosova.
Fixes #42355.



git-svn-id: https://develop.svn.wordpress.org/trunk@43667 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-02 19:29:18 +00:00
Gary Pendergast
456e243224 Taxonomies: Improve description of default category behaviour.
Add some extra information to the Categories list screen, explaining why the default category doesn't have a Delete button.

Props Codestor.
Fixes #44961.



git-svn-id: https://develop.svn.wordpress.org/trunk@43666 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-02 19:18:58 +00:00
Gary Pendergast
2b49d4660b Docs: Replace incorrect usage of "who's" with "whose".
Whom can say who's "whose" is who's? Is it a Who that Horton heard? Maybe it's The Who whose "who" knowledge will hook whomever hoots "who's" instead of "whose".

Hoot. Hoot.

Props Hafiz.
Fixes #45026.



git-svn-id: https://develop.svn.wordpress.org/trunk@43665 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-02 16:22:46 +00:00
Gary Pendergast
ad1f484317 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.

Props bhargavmehta, krutidugade.
Fixes #43278.



git-svn-id: https://develop.svn.wordpress.org/trunk@43664 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-02 15:52:15 +00:00
Gary Pendergast
75c7cb5acf Taxonomy: Remove the "Note" label from the notes on the Category edit list.
There are notes on both the Tag and Category pages, but only the latter prefixes it with a "Note" label.

Props joanrho, pratikthink, jainnidhi.
Fixes #43800.



git-svn-id: https://develop.svn.wordpress.org/trunk@43663 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-01 21:55:33 +00:00
Felix Arntz
1795dbe25a Multisite: Introduce a site initialization and uninitialization API.
This changeset makes the new CRUD API for sites introduced in [43548] usable for real-world sites. A new function `wp_initialize_site()`, which takes care of creating a site's database tables and populating them with initial values, is hooked into the site insertion process that is initiated when calling `wp_insert_site()`. Similarly, a new function `wp_uninitialize_site()`, which takes care of dropping a site's database tables, is hooked into the site deletion process that is initiated when calling `wp_delete_site()`.

A new function `wp_is_site_initialized()` completes the API, allowing to check whether a site is initialized. Since this function always makes a database request in its default behavior, it should be called with caution. Plugins that would like to use site initialization in special ways can leverage a `pre_wp_is_site_initialized` filter to alter that default behavior.

The separate handling of the site's row in the `wp_blogs` database table and the actual site setup allows for more flexibility in controlling whether or how a site's data is set up. For example, a unit test that only checks data from the site's database table row can unhook the site initialization process to improve performance. At the same time, developers consuming the new sites API only need to know about the CRUD functions, since the initialization and uninitialization processes happen internally.

With this changeset, the foundation for a sites REST API endpoint is fully available. The previously recommended functions `wpmu_create_blog()` and `wpmu_delete_blog()` now call the new respective function internally. Further follow-up work to this includes replacing calls to `wpmu_create_blog()` with `wp_insert_site()`, `update_blog_details()` with `wp_update_site()` and `wpmu_delete_blog()` with `wp_delete_blog()` throughout the codebase.

As a side-effect of this work, the `wpmu_new_blog`, `delete_blog`, and `deleted_blog` actions and the `install_blog()` function have been deprecated.

Fixes #41333. See #40364.


git-svn-id: https://develop.svn.wordpress.org/trunk@43654 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-24 15:08:32 +00:00
Sergey Biryukov
e9eaabaf14 Upgrade/Install: Adjust table prefix string check in setup-config.php for the coding standards change in [42343].
Props shashwatmittal, allendav.
Fixes #44318.

git-svn-id: https://develop.svn.wordpress.org/trunk@43650 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-20 05:14:21 +00:00
John Blackbourn
b2374bf1ad Docs: Correct and improve some docblocks.
See #42505


git-svn-id: https://develop.svn.wordpress.org/trunk@43642 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-14 13:34:50 +00:00
Sergey Biryukov
df261c632a Docs: Correct @since value for _wp_privacy_statuses().
Fix typo in `@since` entry for `WP_Privacy_Policy_Content:add()`.

Props dimadin.
Fixes #44915.

git-svn-id: https://develop.svn.wordpress.org/trunk@43638 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-13 10:19:28 +00:00
Felix Arntz
b33420db6c Upgrade/Install: Fix coding standard errors after [43629].
See #44896.


git-svn-id: https://develop.svn.wordpress.org/trunk@43630 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-05 12:49:29 +00:00
Felix Arntz
46e5c6c91b Upgrade/Install: Introduce populate_site_meta().
Fixes #44896. See #41333.


git-svn-id: https://develop.svn.wordpress.org/trunk@43629 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-05 11:01:36 +00:00