Commit Graph

18146 Commits

Author SHA1 Message Date
Timothy Jacobs
2bba223430 App Passwords: Correct authorize app action names and signatures.
When App Passwords was introduced, the `wp_authorize_application_password_form` and `wp_application_passwords_approve_app_request_success` hook were mistakenly duplicated and incorrectly documented. This commit corrects the hook names and ensures the correct parameters are passed.

Props johnbillion, engahmeds3ed.
Fixes #52013.


git-svn-id: https://develop.svn.wordpress.org/trunk@49920 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-02 22:19:21 +00:00
Timothy Jacobs
902e3f6b85 App Passwords: Only attempt auth if the username and password are set.
Previously, only the username was checked which caused a PHP warning in some server setups, for instance Shibboleth SSO, where the server only populates the `PHP_AUTH_USER` field.

Props MadtownLems, johnbillion, richard.tape, engahmeds3ed.
Fixes #52003.


git-svn-id: https://develop.svn.wordpress.org/trunk@49919 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-02 21:34:01 +00:00
Timothy Jacobs
2206495007 REST API: Properly display JSON encoding errors.
Previously `null` was returned because the server was accessing the incorrect variable.

Props atimmer, technosailor.
Fixes #52106.


git-svn-id: https://develop.svn.wordpress.org/trunk@49918 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-02 20:35:01 +00:00
Timothy Jacobs
85c8cca7d1 Site Health: Use a front-end URL for loopback tests.
In [49154] the async Site Health tests were changed to use the REST API instead of admin-ajax. An unintended side effect of this change was that the loopback tests which tried to ping the site's `admin_url()` were no longer authenticated because admin-cookies aren't provided to the REST API.

This commit adjusts the loopback test to use the front-end `site_url` which checks that cron will function properly. A follow-up ticket will focus on tests that will cover the file editor checks.

Props Clorith.
Fixes #52097.
See #48105.


git-svn-id: https://develop.svn.wordpress.org/trunk@49917 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-02 20:07:24 +00:00
Sergey Biryukov
ae989102e1 Happy New Year!
Update copyright year to 2021 in `license.txt` and bundled themes.

git-svn-id: https://develop.svn.wordpress.org/trunk@49915 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-01 00:17:09 +00:00
Sergey Biryukov
8a26f7d2d9 Twenty Twenty-One: Remove extra brackets from :last-child CSS pseudo-class.
Props munyagu, mukesh27, activecoder.
Fixes #52176.

git-svn-id: https://develop.svn.wordpress.org/trunk@49914 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-31 07:36:24 +00:00
Sergey Biryukov
c32b13d2e7 Docs: Second pass at replacing Codex URLs with a corresponding HelpHub or DevHub article.
Follow-up to [45674-45677].

Props marcio-zebedeu, zodiac1978, netweb.
See #48987.

git-svn-id: https://develop.svn.wordpress.org/trunk@49912 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-29 20:12:42 +00:00
Andrew Ozz
ce9d7aa464 Editor: Trigger the tinymce-editor-init custom jQuery event on DOM ready. Otherwise TinyMCE may initialize earlier and handlers attached on DOM ready may not get triggered. Fixes making the editor menu "sticky" and setting/resetting some screen options on the old Edit Post screen.
Fixes 52046, 51995.

git-svn-id: https://develop.svn.wordpress.org/trunk@49911 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-29 13:19:14 +00:00
Sergey Biryukov
505e08e2c4 Export: Add post_modified and post_modified_gmt fields to the generated WXR export file.
This allows for more flexibility when determining which version of a post is the latest one, and makes it possible to implement import logic involving updating and adding revisions to existing posts or pages.

Props jmdodd.
Fixes #52180.

git-svn-id: https://develop.svn.wordpress.org/trunk@49910 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-28 15:24:37 +00:00
Gary Pendergast
f6042ffc5b Site Health: Check that WordPress is installed before scheduling the HTTPS cron.
Trying to schedule cron jobs before WordPress is installed results in DB errors, which is suboptimal.

See #47577.



git-svn-id: https://develop.svn.wordpress.org/trunk@49909 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-28 01:43:18 +00:00
Sergey Biryukov
5321a2f082 Site Health: Add WP_MEMORY_LIMIT constant to debug info.
This complements the `WP_MAX_MEMORY_LIMIT` constant previously displayed there.

Props sanketchodavadiya, nre, talldanwp, noisysocks.
Fixes #51680.

git-svn-id: https://develop.svn.wordpress.org/trunk@49908 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-27 19:25:48 +00:00
Sergey Biryukov
b16def4d1d Accessibility: Upgrade/Install: Add more contrast to input borders during installation.
This brings the accessibility improvements previously made for other areas of the admin in WordPress 5.3 to the installation screens too.

Follow-up to [46241-46244], [46247], [46248], [46293], [46425].

Props Maigret, audrasjb.
Fixes #51854.

git-svn-id: https://develop.svn.wordpress.org/trunk@49907 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-26 19:52:48 +00:00
Sergey Biryukov
0f33f289e8 Docs: Correct the type of the $user parameter in WP_REST_Users_Controller::prepare_links().
Props iviweb, mukesh27.
Fixes #52175.

git-svn-id: https://develop.svn.wordpress.org/trunk@49906 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-25 14:52:25 +00:00
Sergey Biryukov
54b6981355 Posts, Post Types: Correct the check for term IDs to be queued for lazy-loading term meta.
This ensures that the `$term_ids` array in `wp_queue_posts_for_term_meta_lazyload()` (an indexed array not keyed by ID) does not contain duplicate values.

Props denishua, akabarikalpesh.
Fixes #52144.

git-svn-id: https://develop.svn.wordpress.org/trunk@49905 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-24 11:19:29 +00:00
Felix Arntz
e78d988aa2 Security, Site Health: Detect HTTPS support and encourage switching.
This changeset modifies the Site Health panel for HTTPS to provide more accurate recommendations based on whether the environment is already set up for HTTPS.

* Introduces `wp_is_using_https()` to check whether the site is configured to use HTTPS (via its Site Address and WordPress Address).
* Introduces `wp_is_https_supported()` to check whether the environment supports HTTPS. This relies on a cron job which periodically checks support using a loopback request.

Props Clorith, flixos90, miinasikk, westonruter.
Fixes #47577.


git-svn-id: https://develop.svn.wordpress.org/trunk@49904 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-23 19:11:20 +00:00
Sergey Biryukov
34d29e3c69 Twenty Nineteen: Correct @since version for twentynineteen_excerpt_more().
Follow-up to [49831].

See #46177.

git-svn-id: https://develop.svn.wordpress.org/trunk@49901 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-23 15:03:33 +00:00
Peter Wilson
254131d009 Query: Revert post-type specific capability changes.
The modified checks of the `read_private_posts` capability could result in unexpected SQL queries when calling `WP_Query` with invalid parameters.

Reverts [49830], [49832] and [49833].
See #48556.


git-svn-id: https://develop.svn.wordpress.org/trunk@49899 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-23 03:01:00 +00:00
Jonathan Desrosiers
7b1e52b973 Bundled Themes: Bump the versions of Twenty Twenty-One and Twenty Nineteen.
New versions:

- Twenty Twenty-One: 1.1.
- Twenty Nineteen: 1.9.

Props poena.
Fixes #52160.

git-svn-id: https://develop.svn.wordpress.org/trunk@49873 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-22 18:17:55 +00:00
Jonathan Desrosiers
4ccfb0a084 Twenty Nineteen: Add the block-patterns tag to the appropriate SASS file.
This prevents the tag from being removed from `styles.css` when rebuilding the CSS.

Props danfarrow
Fixes #52159.

git-svn-id: https://develop.svn.wordpress.org/trunk@49872 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-22 18:13:21 +00:00
Kelly Choyce-Dwan
516c843734 Twenty Twenty-One: Set a maximum width on inputs.
Text inputs with a size attribute can end up longer than the screen width on small screens. A max-width of 100% keeps the inputs from breaking out of the container.

Props basscan, kjellr, poena, sabernhardt
Fixes #52083.



git-svn-id: https://develop.svn.wordpress.org/trunk@49870 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-22 16:51:55 +00:00
Jonathan Desrosiers
2c3c216752 Twenty Twenty-One: Improve strings found in post navigations for easier translating.
This change adjusts strings found within post navigations to ensure translators are provided the full context needed to properly translate.

Props poena, SergeyBiryukov, aristath.
Fixes #52047.

git-svn-id: https://develop.svn.wordpress.org/trunk@49866 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-22 16:13:51 +00:00
Jonathan Desrosiers
c7be6359b4 Twenty Twenty-One: Only load IE specific polyfills when actually using Internet Exploreer.
The `twenty-twenty-one-ie11-polyfills` script now has a `null` source, and the new `twenty-twenty-one-ie11-polyfills-asset` (which points to the actual `polyfills.js` source) will be loaded only if IE is detected by through the use of `wp_get_script_polyfill()`.

Because the original script name remains the same, this change is backwards compatible with any code registering `twenty-twenty-one-id11-polyfills` as a script dependency.

Props poena, ismail.elkorchi, peterwilsoncc
Fixes #52098.

git-svn-id: https://develop.svn.wordpress.org/trunk@49865 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-22 15:42:14 +00:00
Jonathan Desrosiers
acbbbd18b3 Twenty Twenty-One: Improve striped table styling in Dark Mode.
This change improves the display of table blocks with the “Stripes” style selected.

Previously, the text was not visible in striped rows when using Dark Mode.

Props ryelle, poena, melchoyce, celendesign, audrasjb.
Fixes #52129.

git-svn-id: https://develop.svn.wordpress.org/trunk@49864 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-22 15:00:49 +00:00
John Blackbourn
7ef5a65f44 XML-RPC: Emit an appropriate HTTP status code when an error is returned in response to an XML-RPC request.
This most notably affects the response when XML-RPC is disabled or when the supplied username and password is incorrect.

Props ericmann

Fixes #48213


git-svn-id: https://develop.svn.wordpress.org/trunk@49862 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-21 20:21:12 +00:00
Jonathan Desrosiers
6c7bb97313 Twenty Twenty-One: Do not specify loading=“eager” for single post thumbnails.
While `loading=“eager”` is a supported alternative to omitting the attribute entirely, browsers follow the value of this attribute explicitly when specified.

Specifying `eager` would prevent the user from receiving any additional potential benefits implemented at the browser level, such as further mechanisms to automatically decide which elements to lazy-load.

Props flixos90, ryelle, poena.
Fixes #52139.

git-svn-id: https://develop.svn.wordpress.org/trunk@49860 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-21 18:37:47 +00:00
Sergey Biryukov
9027e7c489 Docs: Move locale filter documentation to the canonical place.
See #51800.

git-svn-id: https://develop.svn.wordpress.org/trunk@49859 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-21 18:24:53 +00:00
Sergey Biryukov
af5bab23ab Docs: Move sanitize_file_name filter documentation to the canonical place.
See #51800.

git-svn-id: https://develop.svn.wordpress.org/trunk@49858 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-21 18:23:21 +00:00
John Blackbourn
51f9a54c9d XML-RPC: Fix a type error when requesting the menu field of a taxonomy.
Fixes #51493


git-svn-id: https://develop.svn.wordpress.org/trunk@49856 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-21 17:09:50 +00:00
Jonathan Desrosiers
b43ebc51e8 Twenty Twenty-One: Allow local anchor links to be used in primary navigation.
This adds some JavaScript to detect when an anchor link is clicked within the primary navigation on mobile devices and closes the menu before scrolling to the location on the page.

Props poena, macmanx, t-p.
Fixes #52006.

git-svn-id: https://develop.svn.wordpress.org/trunk@49854 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-21 15:03:40 +00:00
Greg Ziółkowski
3d43e57237 Blocks: Align with Gutenberg the name of generated asset handle for core blocks
Related Gutenberg PR: https://github.com/WordPress/gutenberg/pull/25220.

It aligns with the latest changes added by aristath to the Gutenberg project. As part of styles splitting for core blocks, there was a special pattern introduced for how style handles are named. Ideally, we would apply it to all blocks but there might be some backward compatibility considerations so I left the handling for non-core blocks unchanged.

Props aristath.
See #50328.



git-svn-id: https://develop.svn.wordpress.org/trunk@49850 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-21 11:37:30 +00:00
John Blackbourn
00dd0ba3b0 Upload: Introduce the {$action}_overrides filter that allows the overrides parameter for file uploads and file sideloads to be filtered.
The dynamic portion of the hook name, `$action`, refers to the post action.

Props iandunn, jakub.tyrcha, nacin, wonderboymusic, Mte90, johnbillion

Fixes #16849


git-svn-id: https://develop.svn.wordpress.org/trunk@49845 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-20 16:13:23 +00:00
John Blackbourn
99cfb00d13 Mail: Introduce a pre_wp_mail filter to allow short-circuiting the wp_mail() function without having to override the pluggable function.
Props DvanKooten, swissspidy, SergeyBiryukov, jtsternberg, ericlewis, Mte90, birgire, ayeshrajans

Fixes #35069


git-svn-id: https://develop.svn.wordpress.org/trunk@49844 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-20 15:07:23 +00:00
John Blackbourn
b04671e52f Query: Ensure the author archive title always shows the name of the queried author, regardless of whether there are results.
This brings the behaviour inline with the `<title>` element of the page which always shows the author name.

Props Tkama, subrataemfluence

Fixes #44183


git-svn-id: https://develop.svn.wordpress.org/trunk@49843 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-20 14:35:58 +00:00
Sergey Biryukov
a706d9e189 Docs: Use a canonical form of "knowledgeable" in readme.html.
Props shahinsid07, audrasjb.
Fixes #52125.

git-svn-id: https://develop.svn.wordpress.org/trunk@49842 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-20 12:56:42 +00:00
SergeyBiryukov
457b20ebce Docs: Fix typo in getCursorMarkerSpan() DocBlock in js/_enqueues/wp/editor/base.js.
Props voboghure, mukesh27, audrasjb.
Fixes #52128.

git-svn-id: https://develop.svn.wordpress.org/trunk@49841 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-20 12:30:02 +00:00
Sergey Biryukov
93c504a57a Twenty Ten: Correct $post_title variable name in loop-attachment.php.
Follow-up to [45609] / #47632.

Props sabernhardt.
Fixes #52121.

git-svn-id: https://develop.svn.wordpress.org/trunk@49840 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-19 20:43:49 +00:00
Sergey Biryukov
6bd2959638 Twenty Twenty-One: Clarify a sentence in readme.txt.
Props gkibria69.
Fixes #52120.

git-svn-id: https://develop.svn.wordpress.org/trunk@49838 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-19 20:34:44 +00:00
Sergey Biryukov
eddd3ae02d Docs: Update the reference to Appearance → Theme Editor admin menu item in the inline documentation.
Follow-up to [42685].

See #51800.

git-svn-id: https://develop.svn.wordpress.org/trunk@49837 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-18 15:44:26 +00:00
Peter Wilson
1930427d30 Coding Standards: Minor fixes following [49830].
See #13509, #48968, #48556.


git-svn-id: https://develop.svn.wordpress.org/trunk@49832 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-18 00:17:32 +00:00
Sergey Biryukov
5fa4c984fd Twenty Nineteen: Add "Continue reading" link for post excerpts.
This ensures that archive pages have a meaningful link text after the excerpts.

Props metalandcoffee, alex27, sabernhardt, mdrockwell, laurelfulford.
Fixes #46177.

git-svn-id: https://develop.svn.wordpress.org/trunk@49831 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-17 18:19:48 +00:00
Boone Gorges
f7ced48ad8 Query: Respect post-type specific capabilities when querying for multiple post types.
After this change, the relevant `read_private_posts` capability is checked for
each queried post type. This ensures that private posts appear in search and
archive queries for users who have the ability to view those posts.

Props leogermani.

Fixes #13509, #48968, #48556.

git-svn-id: https://develop.svn.wordpress.org/trunk@49830 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-17 16:15:38 +00:00
Jonathan Desrosiers
a100f27473 Twenty Twenty-One: Correct @since inline documentation tags.
Previously, `1.0.0` was used for the version. This is inconsistent with the versioning used in the other default themes, which use use X.X and not X.X.X.

This change corrects all `1.0.0` occurrences to `1.0`, and adds the additional context of `Twenty Twenty-One` to avoid confusion with `WordPress 1.0`.

Props SergeyBiryukov, poena.
Fixes #51958.

git-svn-id: https://develop.svn.wordpress.org/trunk@49826 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-17 14:55:37 +00:00
Jonathan Desrosiers
3d9c9b9447 Twenty Twenty-One: Make text within code blocks readable in Dark Mode.
This change ensures that the primary text color specific to Dark Mode is used instead of the one specified for normal mode. The latter is not legible in Dark Mode.

Props slaFFik, poena, mukesh27, justinahinon.
Fixes #51985.

git-svn-id: https://develop.svn.wordpress.org/trunk@49825 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-17 14:20:22 +00:00
Jonathan Desrosiers
a35f9fda65 Twenty Twenty-One: Prevent <iframe> embeds from being too narrow.
This fixes an issue where `<iframe>` embeds were being pushed to the side of the screen and compressed to the point of being unusable.

Props helen, mukesh27, poena, thorlentz.
Fixes #52004.

git-svn-id: https://develop.svn.wordpress.org/trunk@49823 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-17 14:03:37 +00:00
Felix Arntz
8505c99a1b Media: Enable lazy-loading of iframes by adding the loading="lazy" attribute to iframe tags on the front-end.
* Expands the capabilities of `wp_filter_content_tags()` to add the attribute to iframe tags if enabled.
* Modifies the default behavior of `wp_lazy_loading_enabled()` so that it returns `true` for `iframe` tags.
* Introduces a `wp_iframe_tag_add_loading_attr()` function.
* Introduces a `wp_iframe_tag_add_loading_attr` filter.

Like for images, the attribute is only added to iframes which have both `width` and `height` specified (see related #50367).

Props azaozz, flixos90, westonruter.
Fixes #50756.


git-svn-id: https://develop.svn.wordpress.org/trunk@49808 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-16 21:17:24 +00:00
Andrew Ozz
3f12f0e77c Editor: Fix improper triggering of the "Are you sure" prompt when navigating away from the old, "classic" Edit Post screen and there are no changes. Was triggered when there is an instance of TinyMCE in the Excerpt postbox.
Props rodrigosprimo, jonathanstegall, kevin940726, azaozz.
Fixes #52038.

git-svn-id: https://develop.svn.wordpress.org/trunk@49807 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-16 15:23:35 +00:00
Ian Dunn
2ea3033c0d Feed: Replace join() with implode() for safety.
Canonical functions should be used instead of aliases, because aliases can be deprecated or removed withough much notice. See r49193.

Props SergeyBiryukov.
See #51056.


git-svn-id: https://develop.svn.wordpress.org/trunk@49805 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-16 14:03:56 +00:00
Andrew Ozz
55c1f81e49 Media: Fix the template for the "Align" and "Link To" fields in the media modal when inserting an image from URL.
Props noisysocks, mukesh27.
Fixes #52065.

git-svn-id: https://develop.svn.wordpress.org/trunk@49804 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-16 12:43:44 +00:00
Ian Dunn
4595dcf7f9 Feed: Merge multiple header values to avoid fatal error.
When SimplePie parses HTTP headers, it combines multiple values for the same header into a comma-separated string. `WP_SimplePie_File` overrides the parsing, but was leaving them as an array instead.

That lead to a fatal error in PHP 8, because other parts of the codebase ended up passing an array to a function that expected a string.

Props david.binda, litemotiv, inc2734, NicolasKulka, hellofromTonya, mbabker, skithund, SergeyBiryukov, desrosj, timothyblynjacobs.
Fixes #51056. See #51956.



git-svn-id: https://develop.svn.wordpress.org/trunk@49803 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-16 00:49:32 +00:00
John Blackbourn
378c2058a0 Docs: Correct the documentation for the map_meta_cap() function and its filter.
See #51800


git-svn-id: https://develop.svn.wordpress.org/trunk@49802 602fd350-edb4-49c9-b593-d223f7449a82
2020-12-15 22:16:03 +00:00