Commit Graph

42014 Commits

Author SHA1 Message Date
Sergey Biryukov 8672d08404 Docs: Miscellaneous DocBlock corrections.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48198 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-28 11:51:29 +00:00
Sergey Biryukov 6361798918 Docs: Improve documentation for optional parameters per the documentation standards.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48197 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-28 11:47:45 +00:00
Sergey Biryukov b72fcb6a47 Tests: Adjust the test for invalid username in `WP_Test_REST_Users_Controller` to match the new string.
Follow-up to [48195].

See #47003.

git-svn-id: https://develop.svn.wordpress.org/trunk@48196 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-28 07:49:29 +00:00
Sergey Biryukov cececce972 Users: Merge two similar error messages about usernames with invalid characters.
Props ramiy, garrett-eclipse, chetan200891.
Fixes #47003.

git-svn-id: https://develop.svn.wordpress.org/trunk@48195 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-27 23:43:01 +00:00
Sergey Biryukov 43236dea96 I18N: Remove `<kbd>` tag from a translatable string on Edit Post screen.
Props ramiy, tobifjellner.
Fixes #48874.

git-svn-id: https://develop.svn.wordpress.org/trunk@48194 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-27 23:00:49 +00:00
Sergey Biryukov 7fe9600547 Docs: Synchronize some documentation for functions in `wp-includes/option.php`.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48193 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-27 16:54:29 +00:00
John Blackbourn 83b0d3709e Docs: Improvements to the inline docs for metadata related functions.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48192 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-27 16:32:57 +00:00
Sergey Biryukov 899d8ff5ec Administration: Correct the URL for "Learn more about getting started" link in "Welcome to WordPress" panel.
Props hareesh-pillai, johnbillion.
Fixes #50484.

git-svn-id: https://develop.svn.wordpress.org/trunk@48191 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-27 12:43:07 +00:00
Sergey Biryukov 506fab2814 Docs: Remove extra spaces from `@ticket` tag in unit tests.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48190 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-27 12:01:30 +00:00
Sergey Biryukov b970deb94a Docs: Improve DocBlocks in `wp-includes/theme.php` per the documentation standards.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48189 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-27 12:00:48 +00:00
SergeyBiryukov 20e96fa38a Bootstrap/Load: Make some adjustments to `wp_get_environment_type()`:
* Rename the `wp_approved_environment_types` filter to `wp_environment_types`.
* Introduce `WP_ENVIRONMENT_TYPES` system variable and constant to complement the filter.
* Correct the argument type for the `wp_environment_types` filter.
* Cache the result in a static variable to ensure consistent return value.
* Rename the `stage` type to `staging`.

Follow-up to [47919].

Props dlh, dd32, TimothyBlynJacobs, johnbillion, pbiron.
See #33161.

git-svn-id: https://develop.svn.wordpress.org/trunk@48188 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-27 10:34:02 +00:00
Sergey Biryukov 2daeac989d Taxonomy: Make sure `update_object_term_cache()` caches all terms that were not already cached.
Due to an unintended `break` instruction from a previous iteration, the function cached only one term in each taxonomy.

Follow-up to [48055].

Props Chouby.
Fixes #50352.

git-svn-id: https://develop.svn.wordpress.org/trunk@48187 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-26 22:29:27 +00:00
Sergey Biryukov 8603b3da3a Administration: Add missing comma to the message in "Post via email" section.
Props kinjaldalwadi, sabernhardt.
Fixes #49238.

git-svn-id: https://develop.svn.wordpress.org/trunk@48186 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-26 19:36:26 +00:00
Sergey Biryukov 8b67473da6 Docs: Standardize on "Returning a value from the filter" vs. "Passing a value to the filter".
The filter is the callback function added with `add_filter()`, therefore the hook passes a value to the filter, and the filter returns a value to change its behaviour.

The documentation is referring to the latter.

Props johnbillion.
See #49572, #16557.

git-svn-id: https://develop.svn.wordpress.org/trunk@48185 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-26 18:47:28 +00:00
John Blackbourn 9af5e46627 Docs: Miscellaneous docblock improvements.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48184 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-26 18:38:51 +00:00
John Blackbourn c31fd4988a Docs: Clarify the description of functions that check for and perform updates.
See #49572, #50052.

git-svn-id: https://develop.svn.wordpress.org/trunk@48183 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-26 18:32:44 +00:00
Jonathan Desrosiers 1aa329d060 Docs: Reword inline docs for better readability and clarity.
This improves the wording of the inline documentation for `redirect_guess_404_permalink()` and the related filters introduced in [47878].

Previously [47878,47885]
See #16557.

git-svn-id: https://develop.svn.wordpress.org/trunk@48182 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-26 16:14:30 +00:00
Sergey Biryukov 4c29c4eb11 Twenty Twenty: Correct parameter types and `@since` version for `twentytwenty_svg_icon_color` filter.
Follow-up to [48180].

See #48713.

git-svn-id: https://develop.svn.wordpress.org/trunk@48181 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-26 14:49:29 +00:00
Ian Belanger 6412e28463 Bundled Themes: Twenty Twenty Social Icons Filter.
Adds a Social Icons Filter to Twenty Twenty that allows for new icons to be added to the theme by filter.

Props JarretC, nielslange, acosmin, desrosj.
Fixes #48713.

git-svn-id: https://develop.svn.wordpress.org/trunk@48180 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-26 14:40:27 +00:00
Ella van Durpe b1cedbaed7 Update package-lock.json after [48177]
Fixes #50481.


git-svn-id: https://develop.svn.wordpress.org/trunk@48179 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-26 14:01:25 +00:00
Jonathan Desrosiers 7456bcb3cc PHP: Bump the recommended version of PHP to 7.4.
This brings the recommendations in `readme.html` inline with those on https://wordpress.org/about/requirements/.

Props hareesh-pillai.
Fixes #50480.

git-svn-id: https://develop.svn.wordpress.org/trunk@48178 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-26 13:56:29 +00:00
Ella van Durpe 24465974cd Editor: update JavaScript packages
Also update default block categories

Props youknowriad, gziolo, aduth.
Fixes #50420, #50278.



git-svn-id: https://develop.svn.wordpress.org/trunk@48177 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-26 13:31:11 +00:00
Sergey Biryukov 7ce1ba7f98 Tests: Reformat `test_wp_list_pages_discarded_whitespace()` for better readability.
See #50466, #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@48176 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-26 12:07:52 +00:00
Sergey Biryukov 97bb45fe22 Docs: Spell "line breaks" in a consistent way.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48175 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-26 09:28:21 +00:00
Sergey Biryukov 37214834c3 Docs: Add a note that the `$br` parameter of `wpautop()` does not affect line breaks within `<script>`, `<style>`, and `<svg>` tags.
Props stevenlinx.
Fixes #50477.

git-svn-id: https://develop.svn.wordpress.org/trunk@48174 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-26 09:18:57 +00:00
Timothy Jacobs 5b90ea41b5 REST API: Introduce Block Types endpoint.
This endpoint allows a user to retrieve the block type definition for all server-side registered block types.

Props spacedmonkey, aduth, gziolo, ocean90, TimothyBlynJacobs.
Fixes #47620.


git-svn-id: https://develop.svn.wordpress.org/trunk@48173 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-26 00:44:44 +00:00
Sergey Biryukov be8b93c269 Site Health: Improve the error message displayed when activating a plugin that requires a higher version of PHP or WordPress.
This adds some extra details to the message:

* The current PHP or WordPress version.
* The plugin's minimum required PHP or WordPress version.
* A link to the support documentation on how to update PHP.

Props stuffradio, johnbillion, garrett-eclipse, sabernhardt, williampatton, SergeyBiryukov.
Fixes #48245.

git-svn-id: https://develop.svn.wordpress.org/trunk@48172 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-26 00:25:15 +00:00
Timothy Jacobs 9a604011ee Themes: Introduce register_theme_feature API.
Currently themes can declare support for a given feature by using add_theme_support(). This commit adds a register_theme_feature() API that allows plugins and WordPress Core to declare a list of available features that themes can support.

The REST API uses this to expose a theme's supported features if the feature has been registered with "show_in_rest" set to true.

Props kadamwhite, spacedmonkey, williampatton, desrosj, TimothyBlynJacobs.
Fixes #49406.


git-svn-id: https://develop.svn.wordpress.org/trunk@48171 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-25 22:11:09 +00:00
Felix Arntz 9568134d7b Media: Ensure images have dimensions to reduce layout shift and facilitate lazy-loading.
This changeset ensures that attachment images which are inserted without `width` and `height` attributes still receive them in the frontend, to reduce cumulative layout shift. Adding the dimensions happens as part of the logic for adding `srcset` and `sizes` attributes, which already assume the specific width and height of the respective image.

Images are now only lazy-loaded if they have `width` and `height` attributes present. While missing these attributes itself is what causes layout shifts, lazy-loading such images can make this problem more apparent to the user.

Props adamsilverstein, westonruter.
Fixes #50367. See #44427.


git-svn-id: https://develop.svn.wordpress.org/trunk@48170 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-25 18:43:25 +00:00
Jonathan Desrosiers 886b254ec5 Docs: Remove the `custom-header-uploads` feature from docs.
This was deprecated in [20212] in favor of passing `”uploads” => true` to the `custom-header` feature, so it should not be specified as an available feature in the parameter documentation.

See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48169 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-25 17:39:44 +00:00
Sergey Biryukov 9de597ea9f Docs: Replace "AJAX" with "Ajax" in DocBlocks and comments, per the spelling glossary.
Props mukesh27, sabernhardt, SergeyBiryukov.
Fixes #50064.

git-svn-id: https://develop.svn.wordpress.org/trunk@48168 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-25 12:41:36 +00:00
Sergey Biryukov e65d19b9ed Coding Standards: Reformat some long `apply_filters_deprecated()` and `do_action_deprecated()` calls for better readability.
See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@48167 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-25 12:04:05 +00:00
Sergey Biryukov de36eb3326 Canonical: Move trailing slash handling for `robots.txt` and sitemaps to a single condition.
Give the unit test a more descriptive name.

Follow-up to [48153], [48155].

See #48025.

git-svn-id: https://develop.svn.wordpress.org/trunk@48166 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-25 11:39:23 +00:00
Sergey Biryukov 72c7f2c41c Administration: Correct and simplify the logic for `asc` and `desc` arguments in `WP_List_Table::get_sortable_columns()`.
Setting the initial order didn't work as expected due to reversed logic.

Follow-up to [48151].

See #45089.

git-svn-id: https://develop.svn.wordpress.org/trunk@48165 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-25 11:33:23 +00:00
Sergey Biryukov b318e97530 Docs: Improve DocBlocks in `wp-admin/includes/file.php` per the documentation standards.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48164 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-25 09:37:25 +00:00
Sergey Biryukov 527c188079 Docs: Synchronize documentation and variable names in `wp_get_(plugin|theme)_file_editable_extensions()` for consistency.
Add missing `@since` tag to `wp_get_theme_file_editable_extensions()`.

See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48163 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-25 09:29:19 +00:00
Sergey Biryukov 336f7cef1f Docs: Improve DocBlocks in `wp-admin/includes/class-wp-list-table.php` per the documentation standards.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48162 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-25 08:54:40 +00:00
Mike Schroder c90088b1f6 Upgrade/Install: Fix Yoda condition in `wp_opcache_invalidate()`.
Fixes linting failure due to Yoda condition in `wp_opcache_invalidate()` following [48160].

See #36455.

git-svn-id: https://develop.svn.wordpress.org/trunk@48161 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-25 07:53:11 +00:00
Mike Schroder 50a0efdda8 Upgrade/Install: Invalidate OPcache for PHP files during updates.
When files are copied into place, check whether opcode invalidation is available and attempt to invalidate to avoid unintended behavior or fatal errors from themes, plugins, or core.

Introduces `wp_opcache_invalidate()` to allow safe invalidation of PHP files from opcode cache, and a filter, `wp_opcache_invalidate_file` to override the behavior.

Replaces the existing calls to `opcache_invalidate()` in the plugin and theme editors to use the new function.

Thanks to jnylen0 for porting over a patch from ClassicPress that provided much of the approach for what is being committed.

Props nigro.simone, dd32, JasWSInc, szepe.viktor, swissspidy, JanR, asalce, Garavani, pavelevap, pputzer, GregLone, benoitchantre, jadonn, doc987, kraftbj, Krstarica, jnylen0, nextendweb, williampatton, ayeshrajans, joostdevalk, stevenkussmaul, boogah, jorbin, mikeschroder.
Fixes #36455, #50354.

git-svn-id: https://develop.svn.wordpress.org/trunk@48160 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-25 07:13:22 +00:00
Greg Ziółkowski 92585e8df1 Editor: Introduce WP_Block and WP_Block_List classes
Backports functionality added in Gutenberg in the following PRs:
- https://github.com/WordPress/gutenberg/pull/21467
- https://github.com/WordPress/gutenberg/pull/21925
It's a few ideas related to block rendering and the provided block value, which is particularly impactful for work around block context.

Props aduth, TimothyBJacobs, noisysocks, epiqueras, youknowriad, talldanwp, zebulan.
Fixes #49926.



git-svn-id: https://develop.svn.wordpress.org/trunk@48159 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-25 05:14:43 +00:00
Andrew Ozz 67839d5a62 TinyMCE: Update to 4.9.10. Changelog: https://www.tiny.cloud/docs-4x/changelog/#version4910april232020.
Props hareesh-pillai, azaozz.
Fixes #50431.

git-svn-id: https://develop.svn.wordpress.org/trunk@48158 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-24 22:04:36 +00:00
Sergey Biryukov 07e3dda9ba Tests: Add a post author to "Parent 1" page fixture in `tests/post/listPages.php`.
This avoids indeterminate ordering in `test_wp_list_pages_sort_column()`.

Fixes #50466.

git-svn-id: https://develop.svn.wordpress.org/trunk@48157 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-24 15:00:43 +00:00
Riad Benguella b56db034d3 Block Editor: Add the Block Patterns API.
Backport WP_Block_Pattern_Categories_Registry, WP_Block_Patterns_Registry
and block patterns registration functions from the Gutenberg repository.

Props ocean90, ellatrix
Fixes #50445.


git-svn-id: https://develop.svn.wordpress.org/trunk@48156 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-24 12:57:12 +00:00
Jake Spurlock 6dba36e4ef Canonical: Add tests for trailing slashes for robots.txt.
See #48025.

Props Toro_Unit, joostdevalk, SergeyBiryukov.


git-svn-id: https://develop.svn.wordpress.org/trunk@48155 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-24 00:05:21 +00:00
Jake Spurlock ec062c08fe Comments: Allow `wp_update_comment()` to return `WP_Error()`.
The `wp_update_comment_data` filter introduced in 4.7 allows comment data to be filtered before it is updated in the database.

The patch aims to handle `WP_Error` as the filter above return value in a similar manner as is done for `wp_new_comment()`.


Fixes #39732.

Props: enricosorcinelli, swissspidy, gkloveweb, jnylen0, jbpaul17, afercia, SergeyBiryukov, audrasjb, imath, davidbaumwald.


git-svn-id: https://develop.svn.wordpress.org/trunk@48154 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-24 00:03:33 +00:00
Jake Spurlock 7a8d8a3e8a Canonical: Ensure that when permalinks are set to a trailing slash, that robots.txt doesn't.
Fixes #48025.

Props Toro_Unit, joostdevalk, SergeyBiryukov.



git-svn-id: https://develop.svn.wordpress.org/trunk@48153 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-23 23:42:36 +00:00
Jake Spurlock 9eefc4b0d9 Cache API: Cache the results of `get_uploaded_header_images()`.
Fixes #49446.

Props pbiron, SergeyBiryukov, desrosj.



git-svn-id: https://develop.svn.wordpress.org/trunk@48152 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-23 23:32:14 +00:00
Jake Spurlock 95b9933e64 Administration: Update `WP_List_Table::get_sortable_columns()` to support `asc` and `desc` arguments.
This makes the API a little more clear, whereas setting `false` used to mean `asc` and `true` meant `desc`, you can now use those directly, while maintaining back-compat.

Fixes #45089.

Props Tkama, SergeyBiryukov, shital-patel, desrosj, birgire, davidbaumwald. 



git-svn-id: https://develop.svn.wordpress.org/trunk@48151 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-23 23:13:35 +00:00
Jake Spurlock 2245a4e390 REST API: Ensure depracation errors are called while preloading data with the REST API.
Fixes #50318.

Props dlh, TimothyBlynJacobs.



git-svn-id: https://develop.svn.wordpress.org/trunk@48150 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-23 23:02:09 +00:00
Jake Spurlock a1dc0cfa3f Security: Don't display the plugin auto-update options for mu-plugins or dropins.
They can't be updated, so we shouldn't be showing the buttons.

Fixes #50459.

Props Chouby, audrasjb, pbiron.



git-svn-id: https://develop.svn.wordpress.org/trunk@48149 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-23 22:56:10 +00:00