Commit Graph

42655 Commits

Author SHA1 Message Date
Ian Dunn
797b7e1fe2 Dashboard: Show 2 w.org news items to preserve clustered posts.
These days there are often 2 posts published close to each other, like a release announcement and a Month In WordPress post. When that happens, the earlier post is often pushed out of the widget before many people have had a chance to see it.

Ideally, the number of total items would remain at `4`, to reduce visual clutter. Implementing a conditional item would require a significant refactor, though. Increasing the total number of items to `5` is a practical compromise.

Props hlashbrooke, tellyworth.
Fixes #43441.


git-svn-id: https://develop.svn.wordpress.org/trunk@49114 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-09 16:05:37 +00:00
Sergey Biryukov
c35126e1b9 Accessibility: Widgets: Add a "Cancel" link when editing a widget in accessibility mode.
This allows the user to go back without saving any changes to the widget.

Props garrett-eclipse, audrasjb, afercia.
Fixes #49354.

git-svn-id: https://develop.svn.wordpress.org/trunk@49113 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-09 15:51:34 +00:00
Sergey Biryukov
4917ae2ccf Tests: Use consistent wording for the $position parameter in add_submenu_page() tests.
This replaces the instances of `$priority` with `$position`, to match the actual parameter name and avoid confusion.

Follow-up to [46197].

See #51344, #39776.

git-svn-id: https://develop.svn.wordpress.org/trunk@49112 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-09 13:27:50 +00:00
Sergey Biryukov
98866f5032 Docs: Correct description for wp_set_comment_status hook.
The action fires immediately after transitioning a comment's status from one to another in the database and removing the comment from the object cache, but prior to all status transition hooks.

Props davidbaumwald, henry.wright.
Fixes #51481.

git-svn-id: https://develop.svn.wordpress.org/trunk@49111 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-09 01:26:27 +00:00
Sergey Biryukov
b455d336e3 I18N: Add missing placeholders in some translator comments.
Follow-up to [49109].

See #42790.

git-svn-id: https://develop.svn.wordpress.org/trunk@49110 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-09 01:04:53 +00:00
TimothyBlynJacobs
1856d0fe2a REST API: Introduce Application Passwords for API authentication.
In WordPress 4.4 the REST API was first introduced. A few releases later in WordPress 4.7, the Content API endpoints were added, paving the way for Gutenberg and countless in-site experiences. In the intervening years, numerous plugins have built on top of the REST API. Many developers shared a common frustration, the lack of external authentication to the REST API.

This commit introduces Application Passwords to allow users to connect to external applications to their WordPress website. Users can generate individual passwords for each application, allowing for easy revocation and activity monitoring. An authorization flow is introduced to make the connection flow simple for users and application developers.

Application Passwords uses Basic Authentication, and by default is only available over an SSL connection.

Props georgestephanis, kasparsd, timothyblynjacobs, afercia, akkspro, andraganescu, arippberger, aristath, austyfrosty, ayesh, batmoo, bradyvercher, brianhenryie, helen, ipstenu, jeffmatson, jeffpaul, joostdevalk, joshlevinson, kadamwhite, kjbenk, koke, michael-arestad, Otto42, pekz0r, salzano, spacedmonkey, valendesigns.
Fixes #42790.


git-svn-id: https://develop.svn.wordpress.org/trunk@49109 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-08 22:12:02 +00:00
Sergey Biryukov
79703088c4 General: Replace older-style PHP type conversion functions with type casts.
This improves performance, readability, and consistency throughout core.

* `intval()` → `(int)`
* `strval()` → `(string)`
* `floatval()` → `(float)`

Props ayeshrajans.
Fixes #42918.

git-svn-id: https://develop.svn.wordpress.org/trunk@49108 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-08 21:13:57 +00:00
Sergey Biryukov
eeae797340 Build/Test Tools: Add missing <ul> tag in tests/qunit/index.html.
Props ravipatel, JeffPaul.
Fixes #51473.

git-svn-id: https://develop.svn.wordpress.org/trunk@49107 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-08 18:27:07 +00:00
Sergey Biryukov
07b37cdb6b Twenty Ten: Docs: Fix typo in twentyten_custom_excerpt_more() DocBlock.
Update `@return` tag for `twentyten_auto_excerpt_more()` for consistency with Twenty Eleven.

See #51477, #50768.

git-svn-id: https://develop.svn.wordpress.org/trunk@49106 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-08 09:25:01 +00:00
Sergey Biryukov
31a063b866 Twenty Eleven: Docs: Add missing @return type for twentyeleven_auto_excerpt_more().
Props ravipatel.
Fixes #51477.

git-svn-id: https://develop.svn.wordpress.org/trunk@49105 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-08 09:21:57 +00:00
Robert Anderson
cf8c11c2f3 Tests: Fix dependency tests
Fixes test_block_styles_for_editing_with_theme_support and
test_block_styles_for_viewing_with_theme_support by partially reverting [49102]
and only calling wp_should_load_block_editor_scripts_and_styles() when on an
admin screen.

Props TimothyBlynJacobs.
See #51330.


git-svn-id: https://develop.svn.wordpress.org/trunk@49104 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-08 03:34:31 +00:00
Timothy Jacobs
5b6f5f9f6d REST API: Introduce search term handler.
This allows for clients to search the available terms via the `/wp/v2/search` endpoint by using a `type=term` query parameter.

Fixes #51458.
Props andraganescu, zieladam, noisysocks, TimothyBlynJacobs.


git-svn-id: https://develop.svn.wordpress.org/trunk@49103 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-08 01:30:25 +00:00
Robert Anderson
b7b1584139 Editor: Only call should_load_block_editor_scripts_and_styles on admin screens
Do not call the should_load_block_editor_scripts_and_styles filter on non-admin
screens. This makes it less likely that one will accidentally call
get_current_screen() when it doesn't exist.

Follow-up to [49080].
Props noahtallen.
See #51330.


git-svn-id: https://develop.svn.wordpress.org/trunk@49102 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-08 01:19:10 +00:00
Andrew Ozz
9c50d3dda5 Update jQuery step two:
- Add jquery-migrate.js v.3.3.1 to core and load it in debug mode when `SCRIPT_DEBUG` is true.
- Add jquery.min.js, update jquery.js to 3.5.1 non-minified. This should help when debugging.
- Rebuild jQuery UI 1.12.1 and add it to core.
- Fix/adjust tests to match the above changes.

See #50564.

git-svn-id: https://develop.svn.wordpress.org/trunk@49101 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-07 16:31:53 +00:00
Jonathan Desrosiers
0d313839e6 Build/Test Tools: Ensure arguments are passed correctly for test:php-composer commands.
Follow-up to [49099].

Props swissspidy.
See #51456.

git-svn-id: https://develop.svn.wordpress.org/trunk@49100 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-07 13:19:33 +00:00
Jonathan Desrosiers
683ecf8c6a Build/Test Tools: Add NPM script for using the Composer installed version of PHPUnit.
The `test:php` NPM script runs the PHP test suite using the system installed version of PHPUnit. In some cases, the version of PHPUnit installed through Composer may be preferred.

Currently, this is true when running the test suite using PHP 8. In order to add support for PHP 8 while maintaining compatibility for PHP 5.6.20, PHPUnit 7.x must be used. But, some modifications are required to be compatible with PHP 8 (see [49037], [48957]).

This change introduces the `test:php-composer` NPM script, which will run the test suite using the composer installed version.

Props desrosj, SergeyBiryukov.
Fixes #51456.

git-svn-id: https://develop.svn.wordpress.org/trunk@49099 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-07 13:08:20 +00:00
Sergey Biryukov
26a18bc72c Docs: Add missing @return tag for wp_xmlrpc_server::_is_greater_than_one().
Props ankitmaru.
Fixes #51465.

git-svn-id: https://develop.svn.wordpress.org/trunk@49098 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-07 11:00:33 +00:00
Sergey Biryukov
39a2ad729a Coding Standards: Add missing space in js/_enqueues/lib/comment-reply.js.
Props saqibameen, hareesh-pillai, imath, davidbaumwald.
Fixes #43907.

git-svn-id: https://develop.svn.wordpress.org/trunk@49097 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-07 10:36:11 +00:00
Sergey Biryukov
af9db19b45 Docs: Correct @since version for add_allowed_options().
Follow-up to [48121].

Props coffee2code.
Fixes #51450.

git-svn-id: https://develop.svn.wordpress.org/trunk@49096 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-06 15:53:25 +00:00
Sergey Biryukov
3ebeaffe80 Docs: Synchronize descriptions of some query functions and their counterpart methods in WP and WP_Query classes:
* `set_query_var()`
* `get_query_var()`
* `get_queried_object()`
* `get_queried_object_id()`

Switch to third-person singular verbs, per the documentation standards.

See #50768, #42783.

git-svn-id: https://develop.svn.wordpress.org/trunk@49095 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-06 08:57:38 +00:00
Robert Anderson
34a9527acf Docs: Improve set_query_var() inline docs.
Makes the inline docs for set_query_var() consistent with the inline docs for
get_query_var().

See #42783.
Props stevenlinx, markparnell.


git-svn-id: https://develop.svn.wordpress.org/trunk@49094 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-06 05:38:46 +00:00
Robert Anderson
03fe4eb692 Editor: Rename _should_load_block_editor_scripts_and_styles to wp_should_load_block_editor_scripts_and_styles
Follow-up to [49080].
Props zieladam, frank-klein.
See #51330.


git-svn-id: https://develop.svn.wordpress.org/trunk@49093 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-06 04:16:43 +00:00
Sergey Biryukov
7d14c81be1 Docs: Add brackets to function names in some @see tags, for consistency.
Props ravipatel, davidbaumwald.
Fixes #51441.

git-svn-id: https://develop.svn.wordpress.org/trunk@49092 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-05 14:01:10 +00:00
Sergey Biryukov
b31b69ab49 Docs: Add missing @return tag to Language_Pack_Upgrader::check_package().
Synchronize documentation of the `::check_package()` method between `Plugin_Upgrader`, `Theme_Upgrader`, and `Language_Pack_Upgrader`.

Props ankitmaru, mukesh27, desrosj.
Fixes #51448.

git-svn-id: https://develop.svn.wordpress.org/trunk@49091 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-05 13:42:04 +00:00
Sergey Biryukov
c8ed3ebb30 Privacy: Improve clarity of privacy error strings.
Primarily this adds "user privacy" to the strings for privacy requests, so they are more easily distinguished from other system actions within logs.

Props garrett-eclipse, carike, birgire.
Fixes #51351.

git-svn-id: https://develop.svn.wordpress.org/trunk@49090 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-04 03:21:38 +00:00
Sergey Biryukov
64e937d66c Docs: Add @since notes for the $id parameter of REST API search controller accepting a string.
Follow-up to [49088].

See #51131.

git-svn-id: https://develop.svn.wordpress.org/trunk@49089 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-03 01:20:49 +00:00
Timothy Jacobs
a3eb0d803e REST API: Allow for string ids in the search controller.
Previously, the search controller infrastructure required that the id property was an integer. This prevents data models that use a string id from utilizing the search infrastructure.

This commit lifts the restraint that search handlers return integer ids. This will allow for the Post Formats search handler coming in 5.6 to use slugs instead of creating fake ids.

Props stoyangeorgiev.
Fixes #51131.


git-svn-id: https://develop.svn.wordpress.org/trunk@49088 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-02 17:45:49 +00:00
Adam Silverstein
540b331096 Media: clear inputs after cropping on attachment details screen.
Clear the crop selection input fields after the crop action is complete. 
Fixes unexpected re-cropping behavior if the crop button was clicked more than once.

Props davidbinda.
Fixes #30155.



git-svn-id: https://develop.svn.wordpress.org/trunk@49087 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-02 15:09:46 +00:00
Sergey Biryukov
5d4a0c0411 Coding Standards: Make checks for an empty post in wp-includes/post.php more consistent.
See #50767.

git-svn-id: https://develop.svn.wordpress.org/trunk@49086 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-02 12:35:34 +00:00
Helen Hou-Sandi
0488373778 Tests: Fix a linting error in a test.
See #50679.


git-svn-id: https://develop.svn.wordpress.org/trunk@49085 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-01 21:42:40 +00:00
Helen Hou-Sandi
150d9bd17e Media: Don't unnecessarily check for a valid attachment before getting meta.
This makes `wp_get_attachment_metadata()` run significantly faster. See ticket for benchmarking.

Props Tkama, donmhico.
Fixes #50679.


git-svn-id: https://develop.svn.wordpress.org/trunk@49084 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-01 17:53:38 +00:00
Helen Hou-Sandi
7cca745052 WP Date: Add timezone abbreviation to wp-date settings.
Props mkaz.
Fixes #50624.


git-svn-id: https://develop.svn.wordpress.org/trunk@49083 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-01 17:41:18 +00:00
Timothy Jacobs
f60aa51988 REST API: Support the patternProperties JSON Schema keyword.
Props yakimun.
Fixes #51024.


git-svn-id: https://develop.svn.wordpress.org/trunk@49082 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-01 02:47:08 +00:00
Sergey Biryukov
062db8120d Docs: Add missing @since entry for _should_load_block_editor_scripts_and_styles().
Follow-up to [49080].

See #51330.

git-svn-id: https://develop.svn.wordpress.org/trunk@49081 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-01 01:12:16 +00:00
Robert Anderson
443ed5bf18 Editor: Add should_load_block_editor_scripts_and_styles
Adds a new should_load_block_editor_scripts_and_styles filter which can be used
by plugins including Gutenberg to more precisely customise when block editor
scripts and styles should be loaded by script-loader.php. Previously, plugins
had to fiddle with $current_screen->is_block_editor(). 

Props zieladam.
See #51330.


git-svn-id: https://develop.svn.wordpress.org/trunk@49080 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-01 00:37:54 +00:00
Sergey Biryukov
550bcd4f31 Script Loader: Update versions for MediaElement.js and related files.
Follow-up to [49070].

See #51315.

git-svn-id: https://develop.svn.wordpress.org/trunk@49079 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-01 00:02:48 +00:00
John Blackbourn
02c419aca1 Docs: Various docblock improvements related to user and site signup functionality.
See #50768


git-svn-id: https://develop.svn.wordpress.org/trunk@49078 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-30 21:52:27 +00:00
Sergey Biryukov
19513ff6a0 Build/Test Tools: Remove PHP 8 from allowed failures.
With all known unit test issues now addressed, WordPress 5.6 aims to support PHP 8 as much as possible.

See #50913, #50902.

git-svn-id: https://develop.svn.wordpress.org/trunk@49077 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-30 16:03:03 +00:00
Sergey Biryukov
76516b0830 Code Modernization: Ignore the _multiwidget property when collecting widget numbers in WP_Customize_Manager::import_theme_starter_content().
PHP 8 changes the way string to number comparisons are performed: https://wiki.php.net/rfc/string_to_number_comparison

In particular, when calling `max()` on an array with numeric values and a non-numeric string, in PHP 8 the string is returned instead of a number.

For `::import_theme_starter_content()`, this resulted in retrieving the `_multiwidget` property instead of the maximum widget number for a particular type.

By explicitly ignoring the `_multiwidget` property, we make sure to retrieve the correct widget number value.

Follow-up to [48960], [49043].

See #50913.

git-svn-id: https://develop.svn.wordpress.org/trunk@49076 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-30 15:44:09 +00:00
Sergey Biryukov
8e3636b0d6 Docs: Fix typos in some DocBlocks in js/_enqueues/wp/api.js.
Additionally, rename a variable for clarity.

Props mukesh27.
Fixes #51420.

git-svn-id: https://develop.svn.wordpress.org/trunk@49075 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-30 13:52:24 +00:00
Sergey Biryukov
8ae4a7614c Build/Test Tools: Comment out the xdebug group test run for PHP 8 for now.
Xdebug supports PHP 8 only from version 3.0, which is not released yet.

Once Xdebug 3.0 is released and included in the Docker image, this should be uncommented again.

Follow-up to [48957], [49037].

See #50913, #50902.

git-svn-id: https://develop.svn.wordpress.org/trunk@49074 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-30 13:12:03 +00:00
Sergey Biryukov
498fae638d Code Modernization: Check if the file to retrieve metadata from in get_file_data() was successfully opened.
This avoids a fatal error on PHP 8 caused by passing a `false` value to `fread()`, instead of a file resource.

See #50913.

git-svn-id: https://develop.svn.wordpress.org/trunk@49073 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-30 12:18:36 +00:00
Sergey Biryukov
63e0d969b6 Code Modernization: Return false from wpdb::query() if the query was filtered to an empty string using the query filter.
This avoids a fatal error on PHP 8 caused by passing an empty string to `mysqli_query()`, and maintains the current behaviour.

Follow-up to [48980], [48981].

See #50913, #50639.

git-svn-id: https://develop.svn.wordpress.org/trunk@49072 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-30 12:07:13 +00:00
Sergey Biryukov
f2bd8d0481 Docs: Correct description for wp_ajax_update_widget().
Follow-up to [28355].

Props burhandodhy, sabernhardt.
Fixes #44583.

git-svn-id: https://develop.svn.wordpress.org/trunk@49071 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-30 09:42:16 +00:00
Jonathan Desrosiers
6d786bb311 External Libraries: Update MediaElementJS to version 4.2.16.
This change brings a handful of bug fixes made since the previous update in [46436]. For a full list of changes included, see https://github.com/mediaelement/mediaelement/compare/4.2.13...4.2.16.

Props mukesh27, hareesh-pillai, SergeyBiryukov.
Fixes #51315.

git-svn-id: https://develop.svn.wordpress.org/trunk@49070 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-29 15:51:48 +00:00
Sergey Biryukov
3b75e7d0f0 Tests: Require imagejpeg() function in Ajax media editing tests.
This outputs a proper message if the requirement is not met, instead of an obscure failure further in the test.

These tests rely on multiple resized copies of a test JPEG image being generated and available.

Follow-up to [49010], [49024], [49025], [49045], [49050], [49052].

See #50639, #50640.

git-svn-id: https://develop.svn.wordpress.org/trunk@49069 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-29 14:14:28 +00:00
Sergey Biryukov
bf945a81ec Code Modernization: Remove a single trailing percent sign before calling sprintf() on the $default parameter in get_theme_mod().
This avoids a "Missing format specifier at end of string" fatal error on PHP 8, and maintains the current behaviour.

See #50913.

git-svn-id: https://develop.svn.wordpress.org/trunk@49068 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-29 10:01:05 +00:00
Sergey Biryukov
f070145fa9 Posts, Post Types: Avoid a PHP notice in wp_get_shortlink() if the post type is no longer registered.
Props apedog.
Fixes #51376.

git-svn-id: https://develop.svn.wordpress.org/trunk@49067 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-28 11:52:00 +00:00
SergeyBiryukov
b6f5a94631 Docs: Clarify the false return value of get_post_type_archive_link() and get_post_type_archive_feed_link().
See #50768.

git-svn-id: https://develop.svn.wordpress.org/trunk@49066 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-28 11:10:01 +00:00
Sergey Biryukov
0432229195 Docs: Correct formatting for the autosave() function return value in js/_enqueues/wp/autosave.js.
Props dilipbheda, mukesh27.
Fixes #51401.

git-svn-id: https://develop.svn.wordpress.org/trunk@49065 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-28 10:45:01 +00:00