Commit Graph

41023 Commits

Author SHA1 Message Date
Sergey Biryukov
6f15251aa4 Posts, Post Types: Fail gracefully when checking mapped cap against unregistered post status.
With `map_meta_cap` enabled for a post type, the `read_post` capability for posts with a public status is supposed to be mapped to the post type's `read` capability.

When a post is left in the database after the post status is no longer present, and WP does a `read_post` check against it, a PHP notice was thrown, and the cap check always failed.

As a more graceful fallback, the cap is now mapped onto `edit_others_posts`, which allows highly privileged users to be able to access orphaned content.

A `_doing_it_wrong()` notice is also added, so that developers and site administrators are aware that the cap mapping is failing in the absence of the registered post status.

Follow-up to [34091], which introduced a similar approach to checking mapped caps against an unregistered post type.

Props roytanck, SergeyBiryukov.
Fixes #48653.

git-svn-id: https://develop.svn.wordpress.org/trunk@47178 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-04 22:13:15 +00:00
Sergey Biryukov
0bfacbe3b2 Coding Standards: Fix WPCS issues in [47175].
See #49361.

git-svn-id: https://develop.svn.wordpress.org/trunk@47177 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-04 21:40:27 +00:00
Jorge Costa
4bcf9be615 Block Editor: Include navigation block server logic.
Core did not include the navigation block PHP files.
This commit fixes the issue referred, and now the navigation block is executed on the frontend. The block still does not work as expected and throws an error during frontend execution. That problem is going to be fixed on the next WordPress package update.
This commit adds the file as it is on the npm package used.

Props gziolo.
Fixes #49348.

git-svn-id: https://develop.svn.wordpress.org/trunk@47176 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-04 20:14:50 +00:00
Sergey Biryukov
664e5a7568 Users: Pass the $reassign parameter to the remove_user_from_blog action.
Props Tivus.
Fixes #49361.

git-svn-id: https://develop.svn.wordpress.org/trunk@47175 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-04 19:41:41 +00:00
Sergey Biryukov
8f3f181c4e Docs: Improve description for add_user_to_blog() and remove_user_from_blog() parameters.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47174 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-04 19:38:12 +00:00
Sergey Biryukov
2c8da49588 Users: In remove_user_from_blog():
* Change default value of the `$blog_id` parameter to match the documented type.
* Change the type of the `$reassign` parameter for consistency with `$user_id` and `$blog_id`.
* Add documentation for the return value.

See #49361.

git-svn-id: https://develop.svn.wordpress.org/trunk@47173 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-04 19:34:27 +00:00
Sergey Biryukov
e876090344 TinyMCE: Remove duplicate keys and strings from langs/wp-langs-en.js.
Props david.binda.
Fixes #49359.

git-svn-id: https://develop.svn.wordpress.org/trunk@47172 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-04 16:41:46 +00:00
Sergey Biryukov
b26b0ccf8c Database: Add ANSI to the list of incompatible SQL modes.
Starting with MySQL 5.7.5, the `ANSI` mode implies `ONLY_FULL_GROUP_BY`, which is already listed in `wpdb` as incompatible per [27072].

When `ANSI` is enabled on MySQL 5.7.5+, `ONLY_FULL_GROUP_BY` remains enabled even after being "unset" by `wpdb::set_sql_mode()`.

To prevent this, the `ANSI` mode should also be listed as incompatible. It is not enabled on default MySQL installations.

Props jnylen0.
Fixes #48377.

git-svn-id: https://develop.svn.wordpress.org/trunk@47171 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-04 01:12:53 +00:00
Sergey Biryukov
ec83cd08eb Docs: Improve documentation for WP_Dependencies, WP_Scripts, and WP_Styles methods.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47170 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-03 00:17:38 +00:00
Sergey Biryukov
dd48b7f757 Canonical: When removing trailing punctuation from query string arguments, match the whole query var name.
Props daveslaughter.
Fixes #49347.

git-svn-id: https://develop.svn.wordpress.org/trunk@47169 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-03 00:12:22 +00:00
Grzegorz (Greg) Ziółkowski
84f4d42cbb Build: Copy block metadata files for dynamic blocks.
For dynamic blocks, there are several blocks whose metadata needs to be loaded in PHP. The attributes that are loaded via PHP are not exposed to the ReactNative components when Gutenberg loads the index.js files in the Mobile Apps. To support one master set of metadata that can be used to register in the PHP files and the Javascript files; with this patch, the block.json files are copied over with their corresponding PHP files.

Props chipsnyder and azaozz.

Fixes #49196.



git-svn-id: https://develop.svn.wordpress.org/trunk@47168 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-02 19:17:07 +00:00
Sergey Biryukov
3f050fcf63 Plugins: Remove obsolete plugin_slugs transient from WP_Plugins_List_Table::prepare_items().
The transient is only used in the `wp_dashboard_plugins_output()` function, which is deprecated and unused since [40607].

The function itself also sets the same transient, so it can be removed from `WP_Plugins_List_Table`.

Props aftabmuni.
Fixes #49340.

git-svn-id: https://develop.svn.wordpress.org/trunk@47167 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-02 15:48:37 +00:00
Sergey Biryukov
78029013d8 REST API: Merge "not allowed to create new terms" permission error message with an existing string.
Follow-up to [39309], [39313].

See #38857.

git-svn-id: https://develop.svn.wordpress.org/trunk@47166 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-02 05:39:29 +00:00
Sergey Biryukov
4e6674c48c Docs: Fix typo in a comment with WP_DEBUG_DISPLAY description.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47165 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-02 05:32:35 +00:00
Sergey Biryukov
706daca6a3 Editor: Remove back-compat stub for Classic Editor's old distraction-free writing mode.
The original script was deprecated in [30338] and removed in [32677].

Props Presskopp, ketuchetan.
Fixes #39448.

git-svn-id: https://develop.svn.wordpress.org/trunk@47164 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-02 04:13:25 +00:00
Sergey Biryukov
63a53c730f Tests: Adjust XML-RPC unit tests for [47160].
Follow-up to [47162].

See #40096.

git-svn-id: https://develop.svn.wordpress.org/trunk@47163 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-02 04:07:50 +00:00
Sergey Biryukov
d5572e9f11 Tests: Adjust XML-RPC unit tests for [47160].
See #40096.

git-svn-id: https://develop.svn.wordpress.org/trunk@47162 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-02 03:30:37 +00:00
Sergey Biryukov
73e75195eb Docs: Add more specific description for WP_Http::processResponse() return value.
Props marekdedic, takeshifurusato.
Fixes #48351.

git-svn-id: https://develop.svn.wordpress.org/trunk@47161 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-02 03:25:57 +00:00
Sergey Biryukov
fd3083e3f5 Post Thumbnails: Make sure get_post_thumbnail_id() returns an integer, to match the documented return value.
This makes the function more consistent with `get_the_ID()` or `wp_get_post_parent_id()`, both returning an integer.

Props 0v3rth3d4wn.
Fixes #40096.

git-svn-id: https://develop.svn.wordpress.org/trunk@47160 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-02 03:06:31 +00:00
Sergey Biryukov
139fe26f1f Docs: Improve inline comments in wp-admin/options.php per the documentation standards.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47159 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-02 02:40:50 +00:00
Sergey Biryukov
84f0321f42 Administration: Include options page name in the "Options page not found" error message to provide better context for plugin developers.
Props tdlewis77, williampatton.
Fixes #42941.

git-svn-id: https://develop.svn.wordpress.org/trunk@47158 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-01 22:40:06 +00:00
Sergey Biryukov
5e11891a05 Docs: Correct DocBlock formatting for register_setting().
Document the full list of whitelisted option key names.

See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47157 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-01 21:59:14 +00:00
Sergey Biryukov
54c6311c96 Accessibility: Text Changes: Use sentence case for the word Error in various error messages, instead of all caps.
Using all caps should be avoided for better readability and because screen readers may pronounce all-caps words as abbreviations.

Props afercia, ryokuhi, sabernhardt, garrett-eclipse.
See #47656, #43037, #42945.

git-svn-id: https://develop.svn.wordpress.org/trunk@47156 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-01 21:36:44 +00:00
Sergey Biryukov
097f272455 Tests: Update the expected message in test_with_draft_post().
Follow-up to [47154].

See #42945.

git-svn-id: https://develop.svn.wordpress.org/trunk@47155 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-01 21:11:08 +00:00
Sergey Biryukov
b3da2c99a1 Text Changes: Capitalize error messages consistently.
Props Presskopp.
Fixes #42945.

git-svn-id: https://develop.svn.wordpress.org/trunk@47154 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-01 20:53:14 +00:00
Sergey Biryukov
db8a038541 Text Changes: Add missing periods to some error messages, for consistency.
Props Presskopp.
Fixes #42735.

git-svn-id: https://develop.svn.wordpress.org/trunk@47153 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-01 20:30:20 +00:00
Sergey Biryukov
9e8a7292c1 Text Changes: Add missing periods to comment status update notices, for consistency.
Props Presskopp.
See #42735.

git-svn-id: https://develop.svn.wordpress.org/trunk@47152 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-01 20:27:28 +00:00
Sergey Biryukov
3b2ba4c2b4 Networks and Sites: Reduce max-width for user and site search inputs on Dashboard screen in Network Admin.
This ensures that the inputs don't push the buttons to the next line.

Props williampatton, bordoni.
Fixes #49043.

git-svn-id: https://develop.svn.wordpress.org/trunk@47151 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-01 17:36:35 +00:00
Sergey Biryukov
d4b892f022 Docs: Document the addition of $json_report_pathname parameter to the wp_privacy_personal_data_export_file_created action.
Follow-up to [47146].

Props xkon.
Fixes #49029.

git-svn-id: https://develop.svn.wordpress.org/trunk@47150 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-01 04:15:15 +00:00
Sergey Biryukov
637b6f5456 Site Health: Rename WP_Site_Health::initialize() introduced in [47063] to ::get_instance(), for clarity and consistency with other core classes.
Use `WP_Site_Health::get_instance()` where it's needed, instead of creating multiple instances of the class.

Props afercia, xkon, Clorith, SergeyBiryukov.
See #47606.

git-svn-id: https://develop.svn.wordpress.org/trunk@47149 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-01 00:37:14 +00:00
Sergey Biryukov
f0b830e62c Privacy: Clarify bulk action labels for personal data export and removal requests.
Props garrett-eclipse, xkon, shariqkhan2012, websupporter, desrosj, JoshuaWold.
Fixes #44674.

git-svn-id: https://develop.svn.wordpress.org/trunk@47148 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-31 03:41:06 +00:00
Sergey Biryukov
df755ff8ac Accessibility: Privacy: Improve the readability of the suggested text in Privacy Policy Guide.
Per WCAG 2.0 guidelines, big chunks of italic text should be avoided for better accessibility.

Props birgire, sabernhardt, xkon, garrett-eclipse, melchoyce, karmatosed, afercia, jepperask, SergeyBiryukov.
Fixes #44621. See #47327.

git-svn-id: https://develop.svn.wordpress.org/trunk@47147 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-31 03:24:00 +00:00
Sergey Biryukov
b894d8665a Privacy: Introduce a JSON file into the personal data export.
The produced ZIP archive will now include an `export.json` file along with the current `index.html`.

Props xkon.
Fixes #49029. See #46424.

git-svn-id: https://develop.svn.wordpress.org/trunk@47146 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-31 01:34:17 +00:00
Sergey Biryukov
13a9ab716e Site Health: Add support for required WordPress and PHP versions to themes.
Follow-up to [45546] for plugins.

Props flixos90, afragen.
Fixes #44592. See #40934, #meta3718.

git-svn-id: https://develop.svn.wordpress.org/trunk@47145 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-31 01:15:32 +00:00
Sergey Biryukov
7192a8f562 Privacy: Remove user's email address from personal data export filename.
Use `wp_unique_filename()` to avoid potential collisions instead.

Props xkon, garrett-eclipse, donmhico, Ov3rfly, Clorith, allendav.
Fixes #44197.

git-svn-id: https://develop.svn.wordpress.org/trunk@47144 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-31 00:56:29 +00:00
Sergey Biryukov
8b5b3bb38c Administration: Add punctuation to "If you change this, we will send you an email" message on General Settings, Network Settings, and Profile screens.
Props kinjaldalwadi, donmhico.
Fixes #49235.

git-svn-id: https://develop.svn.wordpress.org/trunk@47143 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-31 00:26:37 +00:00
Sergey Biryukov
ac6409a479 HTTP API: Add some basic tests for wp_remote_fopen().
Props pbearne, donmhico.
Fixes #48845.

git-svn-id: https://develop.svn.wordpress.org/trunk@47142 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-31 00:20:47 +00:00
Sergey Biryukov
8ba94ecf5d Tests: Rename wpValidateBoolean.php for consistency with other files.
See #30238.

git-svn-id: https://develop.svn.wordpress.org/trunk@47141 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-31 00:14:07 +00:00
Sergey Biryukov
7d90de1772 Twenty Nineteen: Remove duplicate font-size property.
The theme does not use a `px` fallback for `rem` units anywhere else.

Follow-up to [47053] for Twenty Twenty.

See #49015.

git-svn-id: https://develop.svn.wordpress.org/trunk@47140 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-31 00:07:50 +00:00
Ian Belanger
df1c7771da Fixes PHPCS Introduced in [47135].
There was extra whitespace in the previous commit, this removes it.

See #48552

git-svn-id: https://develop.svn.wordpress.org/trunk@47139 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-30 21:53:48 +00:00
K. Adam White
547a08ee03 REST API: Reuse previously-generated embedded objects when building collection response.
Store each generated embedded object in a temporary cache when querying for linked resources so that repeated links to the same resource do not trigger repeated queries or processing.

Props TimothyBlynJacobs.
Fixes #48838.



git-svn-id: https://develop.svn.wordpress.org/trunk@47138 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-30 20:20:30 +00:00
Sergey Biryukov
10a5077524 Twenty Nineteen: Standardize the Required PHP and Tested Up To headers.
* Remove `WordPress` from `Requires at least` headers.
* Ensure the `Requires at least` and `Requires PHP` headers are present in the `style.css` file.

Follow-up to [46676], which updated `style-rtl.css`, but not `style.scss` or `style.css`.

See #48517.

git-svn-id: https://develop.svn.wordpress.org/trunk@47136 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-30 20:02:46 +00:00
Ian Belanger
b651a3cb9e Bundled Themes: Twenty Twenty add theme support for responsive embeds.
Adds the call to `responsive-embed` theme support in order to fix issues with facebook embeds not being responsive at certain screen widths.

Props williampatton, nielslange.
Fixes #48552.

git-svn-id: https://develop.svn.wordpress.org/trunk@47135 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-30 19:19:37 +00:00
Sergey Biryukov
a271f98952 Themes: Replace — with – as a separator between Monday and Friday in theme starter content.
The `ndash` standardly is the "through" indicator for showing inclusive dates and numbers, while the `mdash` is an interruptor and used as an aside.

Props mikejdent, garrett-eclipse.
Fixes #48286.

git-svn-id: https://develop.svn.wordpress.org/trunk@47134 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-30 19:15:19 +00:00
Ian Belanger
363c862b66 Bundled Themes: Twenty Twenty content font CSS selector is too important.
This makes the font family selector for `entry-content` less specific and thus easier to override.

Props alexandreb3, larrach, audrasjb.
Fixes #49318.

git-svn-id: https://develop.svn.wordpress.org/trunk@47133 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-30 18:26:22 +00:00
Sergey Biryukov
b30baca3ca Dashboard: Improve the appearance of "WordPress Events and News" dashboard widget for multi-day events.
If an upcoming event spans over several days, this information is now properly reflected in the widget.

Props imath, casiepa, iandunn, hareesh-pillai, melchoyce, mapk, desrosj, audrasjb, SergeyBiryukov.
Fixes #47798.

git-svn-id: https://develop.svn.wordpress.org/trunk@47124 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-29 02:17:41 +00:00
Sergey Biryukov
7e521e68dc Docs: Fix typos in wp-admin/includes/class-pclzip.php.
With the upstream library not updated in 10 years since the last time it was merged, it should be safe to treat it as "adopted" rather than external, and make these fixes.

Props passoniate, ottok.
Fixes #49163. See #38464.

git-svn-id: https://develop.svn.wordpress.org/trunk@47123 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-29 00:54:21 +00:00
Sergey Biryukov
cfc3b57488 Docs: Improve inline comments per the documentation standards.
Includes minor code layout fixes for better readability.

See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47122 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-29 00:43:23 +00:00
Sergey Biryukov
bd2cd572aa Docs: Improve DocBlocks in phpunit/includes/object-cache.php per the documentation standards.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47121 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-29 00:36:17 +00:00
Sergey Biryukov
c9663d78cf Docs: Improve comments in js/_enqueues/wp/revisions.js per the documentation standards.
Props passoniate.
Fixes #49177.

git-svn-id: https://develop.svn.wordpress.org/trunk@47120 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-29 00:35:39 +00:00