Commit Graph

2800 Commits

Author SHA1 Message Date
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 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
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 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
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
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
flixos90 88b725e1cb Upgrade/Install: Introduce `populate_network_meta()`, moving logic out of `populate_network()`.
Fixes #44895. See #41333.


git-svn-id: https://develop.svn.wordpress.org/trunk@43628 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-05 10:44:02 +00:00
Felix Arntz f1e1b6299e Upgrade/Install: Add support for an optional `$options` parameter to `populate_options()`.
Fixes #44893. See #41333.


git-svn-id: https://develop.svn.wordpress.org/trunk@43627 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-05 09:38:04 +00:00
Sergey Biryukov 39c97a768a Docs: Correct parameter type for `WP_Privacy_Policy_Content::notice()`.
Props burhandodhy.
Fixes #44877.

git-svn-id: https://develop.svn.wordpress.org/trunk@43609 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-03 14:14:15 +00:00
jrf 1730443206 I18n: Improve translators comments [3].
* Add missing translators comments.
* Fix placement of some translators comments.
  Translators comments should be on the line directly above the line containing the translation function call for optimal compatibility with various `.pot` file generation tools.
  The CS auto-fixing, which changed some inconsistent function calls to multi-line function calls, is part of the reason why this was no longer the case for a select group of translators comments.

Includes minor code layout fixes.

Patch `44360-wp-admin-includes-dir.patch` of the series.

Props flipkeijzer, alvarogois, michielatyoast
See #44360


git-svn-id: https://develop.svn.wordpress.org/trunk@43598 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-30 13:35:27 +00:00
John Blackbourn 5af7160563 Docs: Correct and improve various inline documentation.
See #42505


git-svn-id: https://develop.svn.wordpress.org/trunk@43582 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-27 14:27:22 +00:00
Gary Pendergast a75d153eee Coding Standards: Upgrade WPCS to 1.0.0
WPCS 1.0.0 includes a bunch of new auto-fixers, which drops the number of coding standards issues across WordPress significantly. Prior to running the auto-fixers, there were 15,312 issues detected. With this commit, we now drop to 4,769 issues.

This change includes three notable additions:
- Multiline function calls must now put each parameter on a new line.
- Auto-formatting files is now part of the `grunt precommit` script. 
- Auto-fixable coding standards issues will now cause Travis failures.

Fixes #44600.



git-svn-id: https://develop.svn.wordpress.org/trunk@43571 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-17 01:50:26 +00:00
Gary Pendergast cb3d1777b1 Coding Standards: Prepare for upgrading WPCS to 1.0.0.
In order to get the best result when running `phpcbf` across the codebase, there are some manual tweaks we need to make.

These fall into three categories:
- Fixing incorrectly indented code which has flow-on effects when auto-fixing.
- Tweaking the layout of inline PHP inside HTML tags.
- Moving more complex inline PHP inside HTML tags, to execute earlier.

See #44600.



git-svn-id: https://develop.svn.wordpress.org/trunk@43569 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-15 06:22:00 +00:00
Sergey Biryukov c5d013bf95 Privacy: Ensure the user request email is sent in the requested user's locale (or the site's default locale if they are not a registered user) when the administrator creating the request uses a different locale.
Props desrosj, Chouby, iandunn, lbenicio, birgire, earnjam, swissspidy, garrett-eclipse.
Fixes #43985.

git-svn-id: https://develop.svn.wordpress.org/trunk@43568 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-13 16:31:31 +00:00
Felix Arntz c29d019762 Multisite: Complete the new CRUD API for managing sites.
New functions `wp_insert_site( $data )`, `wp_update_site( $id, $data )` and `wp_delete_site( $id )` are introduced to manage site rows in the `wp_blogs` table, forming the new CRUD API together with the existing `get_site()` / `get_sites()`. The new API provides various benefits over the previously existing API, fixing several cache invalidation issues and being hook-driven so that normalization and validation of the passed data can be fully customized.

New hooks introduced as part of this are the actions `wp_insert_site`, `wp_update_site`, `wp_delete_site`, `wp_validate_site_data` and the filter `wp_normalize_site_data`.

At this point, `wp_insert_site()` does not handle setting up the site's database tables, and `wp_delete_site()` does not handle dropping the site's database tables, so the two can not yet be used directly as full replacements of `wpmu_create_blog()` and `wpmu_delete_blog()`. Managing the site's database tables will be added via hooks as part of the follow-up ticket #41333.

The existing functions `wpmu_create_blog()`, `update_blog_details()`, and `wpmu_delete_blog()` make use of the respective new counterpart and will be obsolete once #41333 has been completed.

Props flixos90, jeremyfelt, spacedmonkey.
Fixes #40364.


git-svn-id: https://develop.svn.wordpress.org/trunk@43548 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-01 13:05:44 +00:00
Aaron Jorbin df9dd119a5 Gutenbeg: you can't remove call outs that don't exist
This commit should have just gone into the 4.9 branch. It did in [43544].

See: #44680
Unprops jorbin
props ocean90


git-svn-id: https://develop.svn.wordpress.org/trunk@43545 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-31 15:15:31 +00:00
Aaron Jorbin 8ed24bbbda 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.

Props pento.
Fixes #44680.


git-svn-id: https://develop.svn.wordpress.org/trunk@43543 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-31 14:41:46 +00:00
Sergey Biryukov ddc8f803c6 Privacy: Revert [43525].
The commenter cookies checkbox is not legally required, so should be disabled by default.

Fixes #44373.

git-svn-id: https://develop.svn.wordpress.org/trunk@43531 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-24 17:05:56 +00:00
Sergey Biryukov 6c32fcd011 I18N: Separate two "About" strings with different context.
Props desrosj, XpertOne, Nao.
Fixes #44139.

git-svn-id: https://develop.svn.wordpress.org/trunk@43527 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-24 15:03:19 +00:00
Sergey Biryukov 335b69cedc Privacy: Remove the setting to enable comment cookies consent added in [43469].
This needs some more work to ensure expected behaviour.

See #44373.

git-svn-id: https://develop.svn.wordpress.org/trunk@43525 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-24 12:50:55 +00:00
Sergey Biryukov 7e4f59b28e I18N: Update list of continents and cities for the timezone selection.
Props soulseekah, dyrer.
Fixes #44574.

git-svn-id: https://develop.svn.wordpress.org/trunk@43504 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-18 11:20:28 +00:00
Sergey Biryukov df7b163a31 Privacy: Mark Privacy Policy page as such in the Pages list table.
Props desrosj, subrataemfluence, ianbelanger, danieltj.
Fixes #44006.

git-svn-id: https://develop.svn.wordpress.org/trunk@43495 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 16:45:04 +00:00
Sergey Biryukov f75b58113d Privacy: Enable pagination screen options for privacy requests list tables.
Props birgire, pbiron.
Fixes #44025.

git-svn-id: https://develop.svn.wordpress.org/trunk@43486 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 16:03:59 +00:00
Sergey Biryukov d25cf1c907 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.
Fixes #44181.

git-svn-id: https://develop.svn.wordpress.org/trunk@43478 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 14:14:47 +00:00
Andrew Ozz d8869384be Privacy: Add a setting to disable comment cookie consent.
Fixes #44373.

git-svn-id: https://develop.svn.wordpress.org/trunk@43469 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 09:07:29 +00:00
Gary Pendergast 8c55028c90 Privacy: Remove some unnecessary code comments.
[42967] introduced some WPCS-related comments, probably accidentally saved by an IDE.

Props burhandodhy.
Fixes #44590.



git-svn-id: https://develop.svn.wordpress.org/trunk@43465 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 07:42:23 +00:00
Sergey Biryukov 018779aca1 Docs: Change `@since` entry for `add_inline_data` action added in [42676] to 4.9.8.
See #36085.

git-svn-id: https://develop.svn.wordpress.org/trunk@43460 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-16 15:26:57 +00:00
Sergey Biryukov dec7594a9b Privacy: Change `@since` entry for `_wp_privacy_settings_filter_draft_page_titles()` added in [43376] to 4.9.8.
See #44100.

git-svn-id: https://develop.svn.wordpress.org/trunk@43454 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-16 13:47:36 +00:00
Aaron Jorbin f673d1851c 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.

Fixes #44195.
Props audrasjb, rafsuntaskin, Ov3rfly, johnbillion, pento



git-svn-id: https://develop.svn.wordpress.org/trunk@43446 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-15 23:38:14 +00:00
Sergey Biryukov 7569772234 Plugins: Disable "Install Now" button for plugins that require a higher version of PHP or WordPress.
Display a notice with an explanation and the steps required to resolve the issue.

Props afragen, schlessera, flixos90, nerrad, melchoyce, boemedia, hedgefield, joyously, johnalarcon, lakenh, afercia, acirujano, ibantxillo, SergeyBiryukov.
Fixes #43986.

git-svn-id: https://develop.svn.wordpress.org/trunk@43436 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-09 13:44:53 +00:00
Felix Arntz 3d85e311ef Privacy: Fix a further inconsistency of site name and URL usage in notification emails.
This is a follow-up to [43388].

Props desrosj.
Fixes #44396.


git-svn-id: https://develop.svn.wordpress.org/trunk@43435 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-08 13:54:02 +00:00
Felix Arntz d3a198df34 Taxonomy: Introduce `is_taxonomy_viewable()`.
This utility function allows for easy detection whether terms for a taxonomy are considered publicly viewable.

Props andizer.
Fixes #44466.


git-svn-id: https://develop.svn.wordpress.org/trunk@43386 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-03 10:28:39 +00:00
Felix Arntz 0a9c044283 Multisite: Count users in a more performant way when listing sites in the network admin.
Props spacedmonkey.
Fixes #44368.


git-svn-id: https://develop.svn.wordpress.org/trunk@43382 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-26 16:29:33 +00:00
Felix Arntz d399bcce30 Role/Capability: Rename `upgrade_php` capability to more suitable `update_php`.
This brings the name in line with user-facing language and similar names of existing related capabilities. Since the capability has not been part of any WordPress release, it can be renamed without any backward-compatibility implications.

Also missing props benhuberman for [43006].

Fixes #44457.


git-svn-id: https://develop.svn.wordpress.org/trunk@43381 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-26 15:04:26 +00:00
Andrew Ozz 1ebcb33c3c Privacy: append `(Draft)` to draft page titles in the page drop-down on the Privacy Settings screen.
Props allendav, desrosj.
Fixes #44100.

git-svn-id: https://develop.svn.wordpress.org/trunk@43376 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-19 12:11:46 +00:00
John Blackbourn 102422679d Security: Harden the random aspect of the hash used for user profile and admin email address changes.
Props BjornW

Fixes #43771


git-svn-id: https://develop.svn.wordpress.org/trunk@43367 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-16 14:09:58 +00:00