Compare commits

...

252 Commits
6.5 ... master

Author SHA1 Message Date
isabel_brison ff2929bf19 Editor: pass fluid typography theme.json settings to `wp_get_typography_font_size_value`.
Updates `wp_get_typography_font_size_value` to accept an array of theme.json settings instead of a boolean derived from global state.

Props ramonopoly, audrasjb.
Fixes #61118.

Built from https://develop.svn.wordpress.org/trunk@58171


git-svn-id: http://core.svn.wordpress.org/trunk@57634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-18 23:18:15 +00:00
isabel_brison ab8cc6dce3 Editor: add column and row spans to grid children.
Adds support for setting spans using `grid-column` and `grid-row` properties on children of blocks with grid layout.

Props isabel_brison, andrewserong, peterwilsoncc, mukesh27.
Fixes #61111.

Built from https://develop.svn.wordpress.org/trunk@58170


git-svn-id: http://core.svn.wordpress.org/trunk@57633 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-18 20:32:17 +00:00
dmsnell c4ff251f13 Move is_utf8_charset() into functions.php
This caused issues in maintenance mode, and it's not warranted to have
its own module. This will live alongside `_canonical_charset()`, it's
partner function.

Fixes: #61182.
Props: dmsnell, sergeybiryukov, swisspiddy.
Follow-up to: [58148].

Built from https://develop.svn.wordpress.org/trunk@58169


git-svn-id: http://core.svn.wordpress.org/trunk@57632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-18 18:22:14 +00:00
Sergey Biryukov c649fd77bd Shortcodes: Remove redundant variable type check in `get_post_galleries()`.
`shortcode_parse_atts()` always returns an array as of [57597], so the check is no longer needed.

Follow-up to [40070], [57597].

Props david.binda, swissspidy, oglekler.
Fixes #60581.
Built from https://develop.svn.wordpress.org/trunk@58168


git-svn-id: http://core.svn.wordpress.org/trunk@57631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-18 15:21:15 +00:00
joedolson 4b51c9f5d5 Administration: A11y: Hide thickbox close icon from screen readers.
Add `aria-hidden="true"` to the dashicon symbol used as the `close` icon in Thickbox modals. Prevent the icon from being read as a replacement character by screen readers.

Props stevejonesdev, sabernhardt, joedolson.
See #61028.
Built from https://develop.svn.wordpress.org/trunk@58167


git-svn-id: http://core.svn.wordpress.org/trunk@57630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-17 20:30:15 +00:00
desrosj 3ac0cb9fce Build/Test Tools: Convert GitHub action workflows into reusable ones.
With a few exceptions, GitHub Actions workflows run using the version of the workflow file present in the commit SHA or Git ref for the triggering event. This is useful for maintaining different versions of a workflow file.

In the case of WordPress where there are currently 25+ branches that could potentially receive a security fix, it creates a huge maintenance burden. When 3rd party actions are updated or features are deprecated on GitHub Actions, the required changes need to be backported to all of those branches. This takes considerable time and effort.

This change converts Core’s workflow files to reusable ones. This allows the same workflow to be used for all (or most) branches, allowing the described maintenance updates to be made once in `trunk`.

To keep track of which files are reusable vs. those that are responsible for holding the strategy matrix for that branch, reusable workflows are now prefixed with `reusable-`.

Props johnbillion, swissspidy, jorbin, desrosj.
Fixes #61213.
Built from https://develop.svn.wordpress.org/trunk@58165


git-svn-id: http://core.svn.wordpress.org/trunk@57628 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-17 17:43:13 +00:00
Sergey Biryukov 8c878056d5 Tests: Remove trailing characters from `@ticket` annotations.
Follow-up to [44693], [46209], [54230], [54733], [55151].

Props jonsurrell.
See #61238.
Built from https://develop.svn.wordpress.org/trunk@58164


git-svn-id: http://core.svn.wordpress.org/trunk@57627 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-17 13:13:16 +00:00
Pascal Birchler 802fa72d10 Script Loader: Update failing test after [58162].
See #60962.
Built from https://develop.svn.wordpress.org/trunk@58163


git-svn-id: http://core.svn.wordpress.org/trunk@57626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-16 17:26:11 +00:00
Pascal Birchler 4a4b9a6493 Script Loader: Disable `injectPolyfill` flag in webpack config.
This is a follow-up to [57981] to ensure that `wp-polyfill` is no longer automatically added as a dependency to package scripts. This avoids unnecessarily loading the polyfill script in places such as the block editor.

See #60962.
Built from https://develop.svn.wordpress.org/trunk@58162


git-svn-id: http://core.svn.wordpress.org/trunk@57625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-16 16:44:11 +00:00
Aaron Jorbin a91012a34b Plugins: Assign role of button to links that act as buttons.
Clicking on these links initiates an action, so they are more semantically a button rather than a link. Keeping them as an anchor in html allows any existing JS that is targeted to these items to continue to function. The addition of the role helps assistive technology to know that they should treat this as a button.

Props stevejonesdev, sabernhardt, vipulgupta003, rcreators, joedolson.
Fixes #61011.

Built from https://develop.svn.wordpress.org/trunk@58161


git-svn-id: http://core.svn.wordpress.org/trunk@57624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-16 15:31:12 +00:00
Sergey Biryukov fdbe1f11a5 Tests: Use `assertSame()` in `block_has_support()` tests.
This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.

Follow-up to [56382].

See #60706.
Built from https://develop.svn.wordpress.org/trunk@58160


git-svn-id: http://core.svn.wordpress.org/trunk@57623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-16 15:15:13 +00:00
dmsnell a3b5efe883 Improve legibility of JSON-encoded Interactivity API store data.
The Interactivity API has been rendering client data in a SCRIPT element with the
type `application/json` so that it's not executed as a script, but is available
to one. The data runs through `wp_json_encode()` and is encoded with some flags
to ensure that potentially-dangerous characters are escaped.

However, this can lead to some challenges. Eagerly escaping when not necessary
can make the data difficult to comprehend when reading the output HTML. For example,
all non-ASCII Unicode characters are escaped with their code point equivalent.
This results in `\ud83c\udd70` instead of `🅰`.

In this patch, the flags for JSON encoding are refined to ensure what's necessary
while relaxing other rules (leaving in those Unicode characters if the blog charset
is UTF-8). This makes for Interactivity API data that's quicker as a human reader
to decipher and diagnose.

In summary:

 - This data is JSON encoded and printed in a `<script type="application/json">` tag.

 - If we ensure that `<` is never printed inside the data, it should be impossible to
   break out of the script tag and the browser treats everything as the element's `textContent`.

 - All other escaping becomes unnecessary at that point, including unicode escaping 
   if the page uses the UTF-8 charset (the same encoding as JSON).

See https://github.com/WordPress/wordpress-develop/pull/6433#pullrequestreview-2043218338

Developed in https://github.com/WordPress/wordpress-develop/pull/6520
Discussed in https://core.trac.wordpress.org/ticket/61170

Fixes: #61170
Follow-up to: [57563].
Props: bjorsch, dmsnell, jonsurrell, sabernhardt, westonruter.

Built from https://develop.svn.wordpress.org/trunk@58159


git-svn-id: http://core.svn.wordpress.org/trunk@57622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-15 17:42:10 +00:00
desrosj ad15b88403 Build/Test Tools: Remove `version` from `docker-compose.yml`.
The `version` property throws a warning when working with the local Docker environment. According to the Docker Compose spec, the property only remains for backward compatibility and should be removed.

Props narenin, mukesh27, swissspidy.
Fixes #61101.
Built from https://develop.svn.wordpress.org/trunk@58157


git-svn-id: http://core.svn.wordpress.org/trunk@57620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-15 15:35:10 +00:00
Pascal Birchler 3c38870487 Docs: Improve docblock for `WP_REST_Template_Revisions_Controller::get_parent()`.
Props rockfire.
See #60699, #61113.
Built from https://develop.svn.wordpress.org/trunk@58156


git-svn-id: http://core.svn.wordpress.org/trunk@57619 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-15 11:18:12 +00:00
Pascal Birchler c4dc645821 Docs: Fix incorrect docblock for `WP_Translation_Controller::translate_plural`.
Props szepeviktor.
See #60699.
Built from https://develop.svn.wordpress.org/trunk@58155


git-svn-id: http://core.svn.wordpress.org/trunk@57618 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-15 09:07:11 +00:00
Sergey Biryukov f695d7f8b9 Tests: Use `assertSame()` in `absint()` tests.
This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.

Includes correcting a few erroneously duplicated test cases to match their intended purpose.

Follow-up to [57724].

See #60706.
Built from https://develop.svn.wordpress.org/trunk@58150


git-svn-id: http://core.svn.wordpress.org/trunk@57615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-15 01:09:10 +00:00
audrasjb d4ef1a6cd5 Administration: Add `primary` class to the FTP credentials modal submit button.
This helps differentiate the two buttons available in the FTP credentials modal by setting a `primary` class to the submit button.

Props mapk, curdin, audrasjb, shailu25.
Fixes #37647.



Built from https://develop.svn.wordpress.org/trunk@58149


git-svn-id: http://core.svn.wordpress.org/trunk@57614 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-14 22:17:13 +00:00
dmsnell 06a25caf23 Quick-fix: Normalize UTF-8 charset slug detection.
In the merge of [58417] the new file was missed. This commit adds the missing required file.

Developed in https://github.com/WordPress/wordpress-develop/pull/6535
Discussed in https://core.trac.wordpress.org/ticket/61182

Fixes #61182.
Follow-up to [58147].
Props dmsnell, jonsurrell.

Built from https://develop.svn.wordpress.org/trunk@58148


git-svn-id: http://core.svn.wordpress.org/trunk@57613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-14 18:07:07 +00:00
dmsnell d30cd41ed4 Normalize UTF-8 charset slug detection.
There are several exist places in Core that attempt to detect if a blog charset
is UTF-8. Each place attempts to perform the same check, except the logic is
spread throughout and there's no single method provided to make this
determination in a consistent way. The `_canonical_charset()` method exists,
but is marked private for use.

In this patch the new `unicode` module provides `is_utf8_charset()` as a method
taking an optional charset slug and indicating if it represents UTF-8,
examining all of the allowable variants of that slug. Associated code is
updated to use this new function, including `_canonical_charset()`. If no slug
is provided, it will look up the current `get_option( 'blog_charset' )`.

Finally, the test functions governing `_canonical_charset()` have been
rewritten as a single test with a data provider instead of as separate test
functions.

Developed in https://github.com/WordPress/wordpress-develop/pull/6535
Discussed in https://core.trac.wordpress.org/ticket/61182

Fixes #61182.
Props dmsnell, jonsurrell.

Built from https://develop.svn.wordpress.org/trunk@58147


git-svn-id: http://core.svn.wordpress.org/trunk@57612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-14 18:05:11 +00:00
joedolson 79045fa10e Administration: A11y: Replace placeholders with visible labels.
Add visible labels to inputs that are using placeholder attributes as a substitute for visible labeling.

Labels added or made visible on the customizer theme search, customizer widget search, customizer menu item search, customizer new page UI, the search plugins screens, the media search screens, and the classic editor link inserter.

Props afercia, joedolson, rcreators, sabernhardt.
See #40331.
Built from https://develop.svn.wordpress.org/trunk@58146


git-svn-id: http://core.svn.wordpress.org/trunk@57611 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-14 16:49:09 +00:00
Sergey Biryukov f57368d7ed Users: Reuse an existing string in the confirmation for unsaved changes in user profile.
Follow-up to [58137].

Fixes #40493.
Built from https://develop.svn.wordpress.org/trunk@58145


git-svn-id: http://core.svn.wordpress.org/trunk@57610 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-14 16:14:11 +00:00
desrosj c2628e70d8 Build/Test Tools: Don’t upload HTML reports to Codecov.
When generating a human readable code coverage report in HTML format, the Codecov action used to fail silently. An error is now being returned, resulting in a workflow failure.

This adds a skip condition to the appropriate steps so the coverage report is only uploaded when a `clover` format is generated.

See #60733.
Built from https://develop.svn.wordpress.org/trunk@58144


git-svn-id: http://core.svn.wordpress.org/trunk@57609 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-14 15:20:13 +00:00
Weston Ruter 9702c2e265 Embeds: Enable lazy-loading of post embeds and fix keyboard a11y for hidden iframes.
Chrome unreliably loads a lazy-loaded iframe when it is hidden using `clip: rect(1px, 1px, 1px, 1px)`. Instead of using `clip`, a lazy-loaded iframe can also be hidden with `visibility:hidden` which results in it loading not only in Chrome but all other browsers. With this change applied, the hard-coded check to prevent lazy-loading post embeds is now removed. An added benefit to using `visibility:hidden` is that the entire iframe in this case is not interactable, meaning that users navigating the document with the keyboard will not unexpectedly encounter tab stops inside of the hidden iframe, as can happen now with `clip` when the JS fails to reveal the loaded iframe. Note also that the `clip` property is deprecated.

Lastly, when such a post embed iframe is rendered in an RSS feed, the `style` attribute is now removed using the HTML Tag Processor as opposed to using string replacement.

Fixes #58773.
Props westonruter, joemcgill, swissspidy, joedolson, adamsilverstein.

Built from https://develop.svn.wordpress.org/trunk@58143


git-svn-id: http://core.svn.wordpress.org/trunk@57608 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-13 22:39:16 +00:00
Tammie Lister 922c74ac70 Twenty Twenty-One: Fixes primary menu disappearing.
The primary menu was disappearing at 481px. This adjusts to resolve this. It was shown when adjust the browser window not in responsive design mode.

Props stephenbrook, audrasjb, mukesh27, sabernhardt, poena, kristenfisher427, siliconforks, jwgoedert, joedolson.
Fixes #52354.

Built from https://develop.svn.wordpress.org/trunk@58142


git-svn-id: http://core.svn.wordpress.org/trunk@57607 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-13 16:43:08 +00:00
Aaron Jorbin e224be969e Tests: Add comment to explain when e2e test for gutenberg is skipped
Follow-up to [58046].

See #60971.

Built from https://develop.svn.wordpress.org/trunk@58141


git-svn-id: http://core.svn.wordpress.org/trunk@57606 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-13 16:40:11 +00:00
Sergey Biryukov f29b58aa91 Docs: Make Settings API documentation link clickable in `wp-admin/options.php`.
The link is a part of the deprecation notice displayed when saving an unregistered setting.

Follow-up to [13646], [13785], [14070], [32116], [34315], [45674].

Props timse201, sabernhardt, amitraj2203, khokansardar, SergeyBiryukov.
Fixes #61199.
Built from https://develop.svn.wordpress.org/trunk@58140


git-svn-id: http://core.svn.wordpress.org/trunk@57605 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-13 16:26:10 +00:00
John Blackbourn 87ba206026 Bootstrap/Load: Place the debugging output for automatic plugin and theme updates behind a debugging flag.
This change means this debugging output will only be shown when both the `WP_DEBUG` and `WP_DEBUG_LOG` constants are defined as true.

Props costdev, afragen, swissspidy

Fixes #58281

Built from https://develop.svn.wordpress.org/trunk@58139


git-svn-id: http://core.svn.wordpress.org/trunk@57604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-13 15:24:11 +00:00
John Blackbourn a59eb9d39c Bootstrap/Load: Update the domain parsing when initialising the cookie domain on Multisite.
This ensures the cookie domain is set to the bare domain without a port number, if one is present.

Props spacedmonkey

Fixes #21077

Built from https://develop.svn.wordpress.org/trunk@58138


git-svn-id: http://core.svn.wordpress.org/trunk@57603 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-13 13:34:11 +00:00
joedolson 39c3bec9f3 Users: Add JS confirmation if user profile has unsaved changes.
Add a confirmation dialog when users navigate away from the user profile screen if they have unsaved changes to prevent data loss.

Props ashokrane, karlijnbk, diedeexterkate, jwgoedert, joedolson, swissspidy, afercia.
Fixes #40493.
Built from https://develop.svn.wordpress.org/trunk@58137


git-svn-id: http://core.svn.wordpress.org/trunk@57602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-12 18:45:14 +00:00
Sergey Biryukov fd4159ed87 Tests: Move `add_settings_section()` tests to a more appropriate place.
Follow-up to [54247].

See #60705.
Built from https://develop.svn.wordpress.org/trunk@58136


git-svn-id: http://core.svn.wordpress.org/trunk@57601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-12 15:56:09 +00:00
Tammie Lister f38ec10f21 Twenty Seventeen: Resolves Header Image Quality Issue
The heading image had quality issues on iOS Safari in portrait and landscape modes. This resolves it through adding 200cv for smaller screens so less than full size.

Props poena, richardevs, laurelfulford, davidakennedy, joemcgill, SergeyBiryukov, ianbelanger, sabernhardt, shailu25, robertghetau.
Fixes #39253.

Built from https://develop.svn.wordpress.org/trunk@58135


git-svn-id: http://core.svn.wordpress.org/trunk@57600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-12 09:29:09 +00:00
Peter Wilson 048c5ba580 Options, Meta APIs: Prime transient options prior to use.
Reduce the number of queries getting and setting transients on sites without a persistent cache. 

Transients are stored in two options: one each for the transient value and timeout. Priming the cache reduces the database queries for getting a transient from two to one.

Props peterwilsoncc, swissspidy.
Fixes #61193.


Built from https://develop.svn.wordpress.org/trunk@58134


git-svn-id: http://core.svn.wordpress.org/trunk@57599 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-11 23:53:15 +00:00
joedolson 77073cce6b Toolbar: Accessibility: Remove adminbar skiplink focus fix.
Based on the current browser support policies and expectations, this is no longer needed. There are almost no browsers in use where this is still in use. The same fix was removed from core themes in #54421.

Props joedolson, sabernhardt, shailu25.
Fixes #60479.
Built from https://develop.svn.wordpress.org/trunk@58133


git-svn-id: http://core.svn.wordpress.org/trunk@57598 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-11 18:28:08 +00:00
Sergey Biryukov 13f85f2cd2 Docs: Update a HelpHub link on Edit Site screen to avoid unnecessary redirection.
Follow-up to [17045], [20713], [41065], [45674], [55412], [57854], [58131].

Props shailu25.
See #60732, #60699.
Built from https://develop.svn.wordpress.org/trunk@58132


git-svn-id: http://core.svn.wordpress.org/trunk@57597 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-11 14:47:06 +00:00
Sergey Biryukov 447840fc0d Docs: Use more specific URLs for a few Network Admin HelpHub links.
This better reflects the originally intended destination of these links.

Follow-up to [57854].

See #60732, #60699.
Built from https://develop.svn.wordpress.org/trunk@58131


git-svn-id: http://core.svn.wordpress.org/trunk@57596 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-11 14:38:13 +00:00
Pascal Birchler 960c3631e4 REST API: Ensure attachments are uploaded to the post's year/month folder.
If organizing uploads into month- and year-based folders, uploading an attachment to an existing post should store the file in `wp-content/uploads/<year>/<month>` based on the post's publish date. This is in line with the behavior in classic editor / the media modal.

Props swissspidy, adamsilverstein, timothyblynjacobs, skithund, sergeybiryukov, patricia70.
Fixes #61189.
Built from https://develop.svn.wordpress.org/trunk@58130


git-svn-id: http://core.svn.wordpress.org/trunk@57595 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-10 18:59:11 +00:00
Sergey Biryukov 8839c33306 Posts, Post Types: Use a consistent plural form of “status” in variable names.
Follow-up to [5575], [6796], [6993], [7638], [12162], [12719], [15578], [16652], [31046], [34515], [49472].

Props Presskopp, sabernhardt, manfcarlo, SergeyBiryukov.
Fixes #58134.
Built from https://develop.svn.wordpress.org/trunk@58129


git-svn-id: http://core.svn.wordpress.org/trunk@57594 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-10 18:09:15 +00:00
John Blackbourn 1e8d651f23 Upgrade/Install: Automatically roll back to the previous version when an automatic plugin update results in a fatal error on the front end of the site.
This builds on the temporary backup system introduced in 6.3 to allow automatic updates to benefit from fatal error protection. A loopback request is performed to the home page of the site and the plugin is rolled back to its backed up version if a fatal error is observed.

For debugging and observability during beta, this change includes several calls to `error_log()` during the upgrade and rollback stages. These calls can be removed or placed behind a flag once we're ready for RC1.

Props costdev, johnbillion, mukesh27, afragen, audrasjb, justlevine, kirasong, peterwilsoncc

Fixes #58281

Built from https://develop.svn.wordpress.org/trunk@58128


git-svn-id: http://core.svn.wordpress.org/trunk@57593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-10 11:48:15 +00:00
gziolo 6edbf28fec Interactivity API: Cannot be used from wp-admin
Interactivity API has hooks that run on the frontend, but not in wp-admin. This means that interactivity data was not printed to the HTML and the interactivity Script Modules were not registered.

Fixes #61087.
Props jonsurrell, cbravobernal, gziolo.


Built from https://develop.svn.wordpress.org/trunk@58127


git-svn-id: http://core.svn.wordpress.org/trunk@57592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-10 09:13:05 +00:00
gziolo 1953f53b01 Script Modules: Hooks are not registered in wp-admin
Script Modules cannot be used in wp-admin. The necessary hooks are registered on wp_head or wp_footer, but should also be registered for the admin variants so that modules can be used from wp-admin.

Fixes #61086.
Props jonsurrell, cbravobernal, gziolo.


Built from https://develop.svn.wordpress.org/trunk@58126


git-svn-id: http://core.svn.wordpress.org/trunk@57591 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-10 09:09:17 +00:00
John Blackbourn 9817081728 Bootstrap/Load: Take the port number into consideration when determining whether a subdomain installation of Multisite is allowed.
This results in the prevention of an installation running on a port on localhost (for example `localhost:8889`) being converted to a subdomain Multisite installation, whereas previously it was incorrectly allowed.

Props spacedmonkey 

See #21077

Built from https://develop.svn.wordpress.org/trunk@58125


git-svn-id: http://core.svn.wordpress.org/trunk@57590 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-09 23:09:13 +00:00
Sergey Biryukov 1a20e9cc6a Coding Standards: Use strict comparison in `wp-includes/nav-menu-template.php`.
Includes correcting a conditional in `_wp_menu_item_classes_by_context()` where `$parent_item->object`, which contains a string like `page`, was erroneously compared to the queried object's ID. The correct property to compare is `$parent_item->object_id`.

Follow-up to [14876], [14923], [14942], [15302], [16731], [16742], [22302], [47550], [47557], [47808].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@58124


git-svn-id: http://core.svn.wordpress.org/trunk@57589 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-09 15:16:14 +00:00
isabel_brison 00b440c27d Editor: move global CSS custom properties to `:root` selector.
Changes the rules outputting global styles CSS custom properties to use `:root` instead of `body`, and cleans up some unused variables.

Props ramonopoly, isabel_brison.
Fixes #61135.

Built from https://develop.svn.wordpress.org/trunk@58123


git-svn-id: http://core.svn.wordpress.org/trunk@57588 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-09 04:09:13 +00:00
spacedmonkey 5208140670 Query: Improve cache key generation.
Query caching in `WP_Query` was added in [53941]. When this functionality was added to the `WP_Query` class, a number of edge cases were missed that would result in redundant duplicate queries. It was possible to pass parameters to `WP_Query` that would be different but would result in the same database query being generated. As the cache key is generated from a mixture of query arguments and the SQL query, this resulted in different cache keys for the same database query, resulting in unnecessary duplicate queries. In this change, the logic in the `generate_cache_key` method has been improved to ensure reuse of existing caches. The following edge cases have been considered:

- Passing `post_type` as an empty string.
- Passing `post_type` as the string `any`.
- Passing `post_type` as array vs. string.
- Passing `post_type` as an array in a different order.
- Not passing `orderby`.
- Passing `post_status` as an array vs. string.
- Passing `post_status` as an array in a different order.

This change also fixes an issue where the old SQL query would not match, as the queries had different whitespaces. 

Props spacedmonkey, joemcgill, pbearne, peterwilsoncc, rajinsharwar, mukesh27, thekt12, huzaifaalmesbah, rodionov201.
Fixes #59442.
Built from https://develop.svn.wordpress.org/trunk@58122


git-svn-id: http://core.svn.wordpress.org/trunk@57587 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-08 22:51:18 +00:00
Aaron Jorbin a5d1d98ce0 Readme: Avoid a redirect by using www.php.net
Props josevarghese.
Fixes #61174.

Built from https://develop.svn.wordpress.org/trunk@58121


git-svn-id: http://core.svn.wordpress.org/trunk@57586 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-08 22:06:14 +00:00
desrosj a7a6032b46 Build/Test Tools: Remove `check-latest` input for `setup-node`.
The `check-latest` setting is used to ensure the latest version of Node.js is always installed in GitHub Action workflows.

This input was added and turned on in [57212] when the minimum required version of Node.js was bumped to `20.10.0`. Because GitHub Action runner image updates are deployed on a rolling basis over the course of several days, a version of Node.js that met this new requirement was not always present (especially on Windows runners). Using this input was a temporary fix to ensure stability for Core’s test workflows. 

The `check-latest` input does have some side effects. Two examples are:
- An additional request is performed to check the latest version every time `setup-node` is used with this option enabled. More requests are made to download and install a newer version of Node.js when one is available.
- When new versions of Node.js are released, the Core workflows immediately switch to the new version, which could potentially have undiscovered bugs or regressions.

The latter has surfaced today due to a regression in Node.js 20.13.0 on Windows (see https://github.com/nodejs/node/issues/52884).

A bit of time has passed and a version >=20.10.0 is now reliably available on all GitHub Action runners. Running the very latest release Node.js is also not important for Core’s testing setup, so `check-version` can safely be removed to address both side effects detailed above. 

Props johnbillion.
Fixes #60129.
Built from https://develop.svn.wordpress.org/trunk@58120


git-svn-id: http://core.svn.wordpress.org/trunk@57585 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-08 19:18:13 +00:00
Sergey Biryukov c6313e4bcf Coding Standards: Use strict comparison in `wp-includes/nav-menu.php`.
Follow-up to [14248], [14285], [14878], [15008], [22235], [23897], [23941], [27150].

Props dhruvang21, aristath, poena, afercia, SergeyBiryukov.
Fixes #61160. See #60700.
Built from https://develop.svn.wordpress.org/trunk@58119


git-svn-id: http://core.svn.wordpress.org/trunk@57584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-08 18:37:14 +00:00
johnjamesjacoby c894dca658 Multisite: Add missing "contribute.php" file to User Dashboard.
This changeset adds a `wp-admin/user/contribute.php` file to allow the "Get Involved" link to work on User Admin.

This changeset prevents an unintended 404 that occurs when a logged-in user clicks the "Get Involved" link (located in the menu-bar) from inside of the multisite-specific User Dashboard.

Related: r56220, r56309, #23348.

Props ignatiusjeroe, audrasjb, tobiasbg.

Fixes #61122.
Built from https://develop.svn.wordpress.org/trunk@58118


git-svn-id: http://core.svn.wordpress.org/trunk@57583 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-08 17:04:13 +00:00
Sergey Biryukov bcff9a2fe4 Site Health: Correct the anchor for “Learn more about page cache” link.
Follow-up to [54043], [55412], [57793].

Props comecaramelos.
Fixes #61159.
Built from https://develop.svn.wordpress.org/trunk@58113


git-svn-id: http://core.svn.wordpress.org/trunk@57578 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-07 10:17:14 +00:00
Sergey Biryukov 97c3f24034 Editor: Check that `attrs` is an array in `WP_Block_Supports::apply_block_supports()`.
This prevents a fatal error in `wp_apply_custom_classname_support()`, which expects an array data type for block attributes, and makes sure the block editor can still load if there is a mistake in the attributes of a block.

Follow-up to [54498].

Props caercam.
Fixes #61151.
Built from https://develop.svn.wordpress.org/trunk@58112


git-svn-id: http://core.svn.wordpress.org/trunk@57577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-06 21:25:15 +00:00
Tammie Lister 558b8897e6 Bundled Themes: Add descriptions to patterns.
This adds descriptions to multiple bundled themes. All patterns without the "Inserter" parameter set to "false" or "no", should use the description parameter (These patterns are hidden in the block inserter and do not use the descriptions).

Props poena, StringPiggy, oglekler, audrasjb, huzaifaalmesbah, swisspidy.
Fixes #59688.

Built from https://develop.svn.wordpress.org/trunk@58111


git-svn-id: http://core.svn.wordpress.org/trunk@57576 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-06 20:32:15 +00:00
Joe McGill 4f98bf32cf Docs: Update docblock for `wp_get_attachment_image()` attributes.
This updates the docblock attributes for `wp_get_attachment_image()` to account for attribute values that are being determined by `wp_get_loading_optimization_attributes()`. Updates docs for `$attr['loading']` and adds docs for `$attr['fetchpriority']`.

Props joemcgill, dmsnell.
Fixes #59550.

Built from https://develop.svn.wordpress.org/trunk@58110


git-svn-id: http://core.svn.wordpress.org/trunk@57575 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-06 20:23:14 +00:00
John Blackbourn e04a32b62f Cron API: Add tests for associative and indexed array arguments when rescheduling a cron event.
Props johnbillion, peterwilsoncc

See #57271

Built from https://develop.svn.wordpress.org/trunk@58109


git-svn-id: http://core.svn.wordpress.org/trunk@57574 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-06 18:49:11 +00:00
John Blackbourn 4d811aac68 Build/Test Tools: Standardise the assertions for remote HTTP request tests.
This ensures that as much information as possible is shown when an HTTP request fails during an external HTTP test.

Fixes #61148

Built from https://develop.svn.wordpress.org/trunk@58108


git-svn-id: http://core.svn.wordpress.org/trunk@57573 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-06 18:41:12 +00:00
John Blackbourn eef77dce83 Build/Test Tools: Exclude PHP translation files from phpcs linting.
Translation files in this directory are automatically generated and are not subject to any linting considerations.

See #59647

Built from https://develop.svn.wordpress.org/trunk@58107


git-svn-id: http://core.svn.wordpress.org/trunk@57572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-06 18:37:16 +00:00
Tammie Lister 78362d0193 Twenty Twenty-Four: Resolve accessibility issues in FAQ pattern.
The FAQ pattern uses multiple details blocks in a row. This ends up with it behaving as an accordion and opens to issues.  In ticket discussion this was decided to be removed to set a good example of how to build.

Props poena, alh0319, abditsori, richtabor, joedolson, huzaifaalmesbah, krupajnanda, luminuu, shailu25, swisspidy.
Fixes #60335.

Built from https://develop.svn.wordpress.org/trunk@58106


git-svn-id: http://core.svn.wordpress.org/trunk@57571 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-06 16:40:11 +00:00
Joe McGill ae2ce86cf4 Options: Update default autoload values used in core.
This updates the values used for the `$autoload` parameter in various functions to replace 'yes' and 'no' with 'on' and 'off', respectively.

Follow-up to [57920].

Props pbearne, mukesh27, joemcgill.
Fixes #61045. See #42441.

Built from https://develop.svn.wordpress.org/trunk@58105


git-svn-id: http://core.svn.wordpress.org/trunk@57570 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-06 16:35:19 +00:00
Tammie Lister 70ba8a1e2c Twenty Twelve: Pullquote block alignment correction for margins.
The pullquote wasn't aligning correctly centrally. This fixes that issue by adding that in.

Props umesh84, poena, nithins53, adeltahri, bgoewert, sabernhardt.
Fixes #57472.

Built from https://develop.svn.wordpress.org/trunk@58104


git-svn-id: http://core.svn.wordpress.org/trunk@57569 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-06 15:41:15 +00:00
Tammie Lister ee10ddb605 Twenty Thirteen: Updates table font size in editor and front.
The table font size wasn't reflecting in editor and front. What this does is keep the default and adds in an inherit.

Props umesh84, desrosj, shailu25, harshgajipara, darshitrajyaguru97, itpathsolutions.
Fixes #56204.

Built from https://develop.svn.wordpress.org/trunk@58103


git-svn-id: http://core.svn.wordpress.org/trunk@57568 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-06 14:02:12 +00:00
Tammie Lister 28e8f39f15 Twenty Nineteen: Test failure fix for theme [58101].
Patching print file to get to pass tests after diff file fix. Newline patch.

Props swisspidy.
See #45944

Built from https://develop.svn.wordpress.org/trunk@58102


git-svn-id: http://core.svn.wordpress.org/trunk@57567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-06 12:57:13 +00:00
Tammie Lister 5bfdb7e938 Twenty Nineteen: Attempt to fix resolve failures cause by [58100].
This aligns print css to be the same as the scss file. This was suggested by failing tests.

Props swisspidy.
See #45944

Built from https://develop.svn.wordpress.org/trunk@58101


git-svn-id: http://core.svn.wordpress.org/trunk@57566 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-06 12:50:15 +00:00
Tammie Lister faae6b565b Twenty Nineteen: Adds URL in for print css.
The print styles is meant to append the URL to links. These rules weren't working correctly and this refreshed patch resolves that.

Props kjellr, laurelfulford, sabernhardt, poena, shailu25.
Fixes #45944.

Built from https://develop.svn.wordpress.org/trunk@58100


git-svn-id: http://core.svn.wordpress.org/trunk@57565 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-06 11:11:14 +00:00
Sergey Biryukov 0b17c7e5f4 Coding Standards: Remove extra conditional in `is_super_admin()`.
Follow-up to [12612].

Props dhruvang21, ankit-k-gupta, audrasjb.
Fixes #61098.
Built from https://develop.svn.wordpress.org/trunk@58099


git-svn-id: http://core.svn.wordpress.org/trunk@57564 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-05 14:35:19 +00:00
John Blackbourn d2434ccaa9 Networks and Sites: Add a clearer warning message before deleting a site from a network.
Props johnjamesjacoby, kebbet, cafenoirdesign, Mista-Flo, johnbillion

Fixes #51358

Built from https://develop.svn.wordpress.org/trunk@58098


git-svn-id: http://core.svn.wordpress.org/trunk@57563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-04 22:12:15 +00:00
John Blackbourn 9feb8a6925 Bootstrap/Load: Add support for custom ports in multisite site addresses.
This allows a Multisite network to use an address that includes a port name, such as `example.com:1234`, and adds support for this to the local development environment too. You can now run a Multisite installation on the local development environment, for example at `localhost:8889`.

This also fixes some bugs with running a single site installation on a port, and updates the testing infrastructure so that the whole test suite runs both with and without a port number.

Props djzone, scribu, nacin, ipstenu, F J Kaiser, jeremyfelt, johnjamesjacoby, spacedmonkey, PerS, Clorith, Blackbam, enrico.sorcinelli, Jules Colle, obliviousharmony, desrosj, johnbillion

Fixes #21077, #52088
Built from https://develop.svn.wordpress.org/trunk@58097


git-svn-id: http://core.svn.wordpress.org/trunk@57562 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-04 19:25:10 +00:00
Sergey Biryukov 2637a3d194 Feeds: Add an optional `$post` parameter to `get_the_title_rss()`.
This allows the function to be used outside of the loop and brings parity with `get_the_title()`.

Follow-up to [1976], [3314], [21735].

Props khokansardar, oglekler.
Fixes #61139.
Built from https://develop.svn.wordpress.org/trunk@58096


git-svn-id: http://core.svn.wordpress.org/trunk@57561 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-04 19:11:11 +00:00
John Blackbourn 900b4b22fa I18N: Pass the `$locale` variable to the `load_translation_file` filter.
This avoids the need for the locale to be recalculated by code that hooks into this filter.

Props swissspidy, mukesh27, johnbillion

Fixes #61108

Built from https://develop.svn.wordpress.org/trunk@58095


git-svn-id: http://core.svn.wordpress.org/trunk@57560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-04 17:27:09 +00:00
John Blackbourn 6ad45a93a1 Site Health: Improve the internationalisation of strings used in disk space health checks.
This allows the disk space values to be changed in the future without requiring a string change.

Props afragen, audrasjb, johnbillion

Fixes #61115

Built from https://develop.svn.wordpress.org/trunk@58094


git-svn-id: http://core.svn.wordpress.org/trunk@57559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-04 17:23:16 +00:00
Sergey Biryukov 0888e755d7 Login and Registration: Check that `post_password` is a string in `wp-login.php`.
This prevents a fatal error if an array is passed instead.

Follow-up to [19925], [34909], [58023].

Props dd32, swissspidy.
Fixes #61136.
Built from https://develop.svn.wordpress.org/trunk@58093


git-svn-id: http://core.svn.wordpress.org/trunk@57558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-03 14:32:17 +00:00
desrosj f878bb85e5 Build/Test Tools: Remind contributors to include a Trac ticket link.
Contributing to WordPress using `wordpress-develop` on GitHub is a useful way collaborate, test, and review suggested changes to the code base. One of the required criteria, though, is including a link to a corresponding Trac ticket. This ensures the PR and associated activity is listed on the Trac ticket, which serves as the source of truth.

It’s easy to forget this and newer contributors aren’t always aware of this requirement. This adds a GitHub Actions job that will add a comment as a reminder when no Trac ticket is included.

Is the waiting really ended? Two thousand years.

Props anamarijapapic, peterwilsoncc.
Fixes #60129.
Built from https://develop.svn.wordpress.org/trunk@58092


git-svn-id: http://core.svn.wordpress.org/trunk@57557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-03 12:39:14 +00:00
Pascal Birchler 2f433c59f8 Embeds: Add Bluesky as a trusted oEmbed provider.
Props swissspidy, thelovekesh, peterwilsoncc, bnewboldbsky.
Fixes #61020.
Built from https://develop.svn.wordpress.org/trunk@58091


git-svn-id: http://core.svn.wordpress.org/trunk@57556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-03 07:58:15 +00:00
isabel_brison 1c20a0a820 Editor: Fix coding standards and move deprecated function to correct file.
Follow-up to [58074], formats docblocks correctly and moves `wp_render_elements_support` to the deprecated file.

Props aaronrobertshaw, isabel_brison, mukesh27, spacedmonkey.
See #60681.

Built from https://develop.svn.wordpress.org/trunk@58090


git-svn-id: http://core.svn.wordpress.org/trunk@57555 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-03 05:25:12 +00:00
isabel_brison 629273d54f Editor: add Style Engine support for nested CSS rules.
Adds support for passing a `$rules_group` string to wp_style_engine_get_stylesheet_from_css_rules(), so rules can be nested under a media query, layer or other rule.

Props isabel_brison, ramonopoly.
Fixes #61099.

Built from https://develop.svn.wordpress.org/trunk@58089


git-svn-id: http://core.svn.wordpress.org/trunk@57554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-03 04:47:12 +00:00
John Blackbourn b83d7e4589 Docs: Revert the documentation change to `WP_Block_Parser::parse()` made in [58084].
This file needs to be synced from the Gutenberg repository.

See #60699
Built from https://develop.svn.wordpress.org/trunk@58085


git-svn-id: http://core.svn.wordpress.org/trunk@57550 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-02 20:09:15 +00:00
John Blackbourn 17debfe624 Docs: Document the array shapes for parsed blocks, template part areas, and template types.
See #60699
Built from https://develop.svn.wordpress.org/trunk@58084


git-svn-id: http://core.svn.wordpress.org/trunk@57549 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-02 19:54:13 +00:00
Sergey Biryukov 137f90ef49 Docs: Add missing documentation for various upgrade/install class methods.
Follow-up to [13602], [13686], [14879], [25806], [28495], [32655], [48661], [53952].

Props yagniksangani, audrasjb, SergeyBiryukov.
Fixes #61124.
Built from https://develop.svn.wordpress.org/trunk@58082


git-svn-id: http://core.svn.wordpress.org/trunk@57547 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-02 17:20:10 +00:00
Aaron Jorbin 18d2736d35 Plugins: Show an admin notice on successful activation.
Plugin activation on the Plugins > Add New screen is performed using AJAX, no longer performing redirects. This means that users will not see a newly activated plugin's menu items, admin notices, or other UI elements until the user refreshes or navigates to another screen. Without adequate messaging and direction, users may be unsure of what to do next.

This shows an admin notice when a plugin is activated from its plugin card or modal, informing the user that the plugin was activated, and that some changes may not occur until they refresh the page.

Follow-up to [57545].

Props costdev, jorbin, jeherve, flixos90, joedolson, ironprogrammer, audrasjb, alanfuller, kevinwhoffman, devsahadat, afragen, adrianduffell, azaozz, jason_the_adams, JeffPaul, webdevmattcrom, DrewAPicture, justlevine, stevejonesdev, benlk, roytanck.
Fixes #60992. See #22316.

Built from https://develop.svn.wordpress.org/trunk@58081


git-svn-id: http://core.svn.wordpress.org/trunk@57546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-02 17:05:07 +00:00
Aaron Jorbin ee44500e17 REST API: Return empty object when no fallback templates are found (wp/v2/templates/lookup)
This prevents a number of php notices that are surfaced due to the endpoint being called on load of the post editor even when there are no templates.

Props grantmkin, CookiesForDevo, britner, wildworks, jorbin.
Fixes #60909.

Built from https://develop.svn.wordpress.org/trunk@58079


git-svn-id: http://core.svn.wordpress.org/trunk@57544 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-02 16:03:14 +00:00
Pascal Birchler 4551e209cd Build/Test Tools: Fix performance tests logging script after [58076].
Removes some unintended debug cruft, whoops!

See #59900.
Built from https://develop.svn.wordpress.org/trunk@58077


git-svn-id: http://core.svn.wordpress.org/trunk@57542 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-02 14:42:16 +00:00
Pascal Birchler 7024b400e9 Build/Test Tools: Overhaul performance tests to improve stability and cover more scenarios.
Simplifies the tests setup by leveraging a test matrix, improving maintenance and making it much easier to test more scenarios. With this change, tests are now also run with an external object cache (Memcached). Additional information such as memory usage and the number of database queries is now collected as well.

Improves test setup and cleanup by disabling external HTTP requests and cron for the tests, as well as deleting expired transients and flushing the cache in-between. This should aid the test stability.

When testing the previous commit / target branch, this now leverages the already built artifact from the build process workflow. Raw test results are now also uploaded as artifacts to aid debugging.

Props swissspidy, adamsilverstein, joemcgill, mukesh27, desrosj, youknowriad, flixos90.
Fixes #59900
Built from https://develop.svn.wordpress.org/trunk@58076


git-svn-id: http://core.svn.wordpress.org/trunk@57541 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-02 13:59:09 +00:00
John Blackbourn 3d9945486e Docs: Various docblock improvements.
See #60699

Built from https://develop.svn.wordpress.org/trunk@58075


git-svn-id: http://core.svn.wordpress.org/trunk@57540 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-02 13:19:14 +00:00
isabel_brison 6ed4bd3bbe Editor: Merge element style and classname generation to single filter.
Fixes element classnames not being output when block attributes are filtered with `render_block_data`.

Props aaronrobertshaw, isabel_brison, jorbin.
Fixes #60681.


Built from https://develop.svn.wordpress.org/trunk@58074


git-svn-id: http://core.svn.wordpress.org/trunk@57539 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-02 07:01:15 +00:00
John Blackbourn 9e7d08b60d Docs: Various docblock corrections.
See #60699

Built from https://develop.svn.wordpress.org/trunk@58073


git-svn-id: http://core.svn.wordpress.org/trunk@57538 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-02 00:01:09 +00:00
dmsnell f56cc47de9 HTML API: Fix context reset in html5lib test suite.
The html5lib-tests suite parses tests from a number of files with a specific
data format. It uses a dataProvider in a loop that yields test information.
This relies on some variables being reset on each iteration. The context
element has not properly reset on each iteration.

The test specification describes the context element as follows:
a9f44960a9/tree-construction/README.md

> Then there *may* be a line that says "#document-fragment", which must be
> followed by a newline (LF), followed by a string of characters that indicates
> the context element, followed by a newline (LF). If the string of characters
> starts with "svg ", the context element is in the SVG namespace and the
> substring after "svg " is the local name. If the string of characters starts
> with "math ", the context element is in the MathML namespace and the
> substring after "math " is the local name. Otherwise, the context element is
> in the HTML namespace and the string is the local name. If this line is
> present the "#data" must be parsed using the HTML fragment parsing algorithm
> with the context element as context.

Without the proper reset of this value, a single context element would change
subsequent tests, breaking the test suite.

This patch adds the reset to ensure that the test suite works properly.

Developed in https://github.com/WordPress/wordpress-develop/pull/6464
Discussed in https://core.trac.wordpress.org/ticket/61102

Fixes #61102.
Props costdev, dmsnell, jonsurrell.

Built from https://develop.svn.wordpress.org/trunk@58072


git-svn-id: http://core.svn.wordpress.org/trunk@57537 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-01 23:46:06 +00:00
John Blackbourn 1bbbb4bd75 Docs: Correct some docblock indentation.
See #60699

Built from https://develop.svn.wordpress.org/trunk@58071


git-svn-id: http://core.svn.wordpress.org/trunk@57536 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-01 23:44:12 +00:00
Sergey Biryukov fe416fd2f6 Tests: Use `assertSame()` in `wp_validate_redirect()` tests.
This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.

Follow-up to [36444].

Props costdev.
See #60706.
Built from https://develop.svn.wordpress.org/trunk@58070


git-svn-id: http://core.svn.wordpress.org/trunk@57535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-01 18:56:09 +00:00
Pascal Birchler d2fb0bd81e General: Remove any usage of `wp_reset_vars()`.
The way `wp_reset_vars()` sets global variables based on `$_POST` and `$_GET` values makes code hard to understand and maintain. It also makes it easy to forget to sanitize input.

This change removes the few places where `wp_reset_vars()` is used in the admin to explicitly use `$_REQUEST` and sanitize any input.

Props swissspidy, audrasjb, davideferre, killua99, weijland, voldemortensen.
Fixes #38073.
Built from https://develop.svn.wordpress.org/trunk@58069


git-svn-id: http://core.svn.wordpress.org/trunk@57534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-01 18:01:12 +00:00
Pascal Birchler 5d6024cefb Script Loader: Ensure `wp_localize_script()` works when called early.
Before, `wp_localize_script()` did not work when the `$wp_scripts` global was not already set (for example because of a script registration happening elsewhere) and even emitted a warning in that case. Due to side effects such as block registration early in the load process, this usually never happened. However, the absence of these side effects in 6.5 caused the `wp_localize_script()` to no longer work in places such as the `login_enqueue_scripts`.

By calling `wp_scripts()` in `wp_localize_script()`, the `$wp_scripts` global is automatically set if needed, restoring previous behavior. Adds both a PHP unit test and an e2e test to verify this use case. Hat tip: jorbin.

Happy birthday, Aaron!

Props salcode, aslamdoctor, jorbin, swissspidy.
Fixes #60862.
Built from https://develop.svn.wordpress.org/trunk@58068


git-svn-id: http://core.svn.wordpress.org/trunk@57533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-01 15:42:11 +00:00
Sergey Biryukov 8aa7eb7e16 Coding Standards: Remove extra conditional in `get_plugins()`.
Follow-up to [1894], [5152], [55990].

Props abhijitrakas, mukesh27.
Fixes #44853.
Built from https://develop.svn.wordpress.org/trunk@58067


git-svn-id: http://core.svn.wordpress.org/trunk@57532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-30 16:45:14 +00:00
Pascal Birchler c3961d849c REST API: allow overriding excerpt length.
This can be used by the excerpt block in the editor to change the excerpt length without filtering `excerpt_length` in a conflicting way. This enhancement still needs a corresponding change on the Gutenberg side.

Props swissspidy, antonvlasenko, mukesh27, azaozz, andraganescu, timothyblynjacobs.
Fixes #59043.
Built from https://develop.svn.wordpress.org/trunk@58065


git-svn-id: http://core.svn.wordpress.org/trunk@57530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-30 09:33:05 +00:00
Pascal Birchler b2da8bbcc9 I18N: Fix plural usage in `wp_print_admin_notice_templates()`.
Moves the translatable strings from the JS template defined in PHP to the `updates.js` script, where `_n()` can be used as recommended.

Props ideag, SergeyBiryukov, daledupreez, audrasjb, ocean90, swissspidy.
Fixes #37287.
Built from https://develop.svn.wordpress.org/trunk@58064


git-svn-id: http://core.svn.wordpress.org/trunk@57529 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-30 08:55:04 +00:00
Pascal Birchler 417862e504 Embeds: Remove empty CSS blocks from `wp-embed-template.css`.
Originally added in [34903], these empty CSS blocks serve no purpose.

Props ravipatel, sabernhardt.
Fixes #61085.
Built from https://develop.svn.wordpress.org/trunk@58063


git-svn-id: http://core.svn.wordpress.org/trunk@57528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-30 08:44:05 +00:00
Pascal Birchler 7c11d1ebf5 I18N: Actually add all the files for [58061], not just the test fixtures.
Improve support for using only PHP translation files.

This builds on top of the PHP translation file support added in WordPress 6.5, improving the behavior for projects using solely `.l10n.php` translation files and no `.mo.` and `.po` files.

Updates `wp_get_installed_translations()`, which is used when updating language packs and when uninstalling plugins/themes (to remove the translations again), to look for PHP translation files and read metadata from them. Additionally, the file lookup is now cached thanks to using `WP_Textdomain_Registry`.

Updates `Language_Pack_Upgrader::check_package()` to allow language packs that only contain PHP translation files. While WordPress.org continues to serve `.mo` and `.po` files, third-party services might want to only use the PHP file format.

See #60554.
Built from https://develop.svn.wordpress.org/trunk@58062


git-svn-id: http://core.svn.wordpress.org/trunk@57527 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-30 08:39:07 +00:00
Pascal Birchler d0b3d1d7ab I18N: Improve support for using only PHP translation files.
This builds on top of the PHP translation file support added in WordPress 6.5, improving the behavior for projects using solely `.l10n.php` translation files and no `.mo.` and `.po` files.

Updates `wp_get_installed_translations()`, which is used when updating language packs and when uninstalling plugins/themes (to remove the translations again), to look for PHP translation files and read metadata from them. Additionally, the file lookup is now cached thanks to using `WP_Textdomain_Registry`.

Updates `Language_Pack_Upgrader::check_package()` to allow language packs that only contain PHP translation files. While WordPress.org continues to serve `.mo` and `.po` files, third-party services might want to only use the PHP file format.

Props swissspidy.
Fixes #60554.
Built from https://develop.svn.wordpress.org/trunk@58061


git-svn-id: http://core.svn.wordpress.org/trunk@57526 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-30 08:36:09 +00:00
audrasjb 3294fc01ba Help/About: Reduce About screens heading sizes on smaller viewports.
[56950] reduced the heading size of About screen headings, but that did not edit the size for smaller viewports.
This changeset fixes this issue, and also updates the larger fluid font size (960px - 1200px).

Follow-up to [56950].

Props dhruvang21, sabernhardt, khokansardar.
Fixes #61030.



Built from https://develop.svn.wordpress.org/trunk@58060


git-svn-id: http://core.svn.wordpress.org/trunk@57525 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-30 06:59:09 +00:00
isabel_brison a3d497718e Editor: add ticket number to test after string update.
Follow-up to [58028]; adds ticket number to the updated test.

Props jorbin, isabel_brison.
See #60981.

Built from https://develop.svn.wordpress.org/trunk@58059


git-svn-id: http://core.svn.wordpress.org/trunk@57524 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-30 04:00:06 +00:00
audrasjb 1abb7e0563 Editor: Add `item_updated` label for `wp_template` and `wp_template_part` post types.
This adds the `item_updated` label to Template and Template Part post types registration. This prevents from displaying the default `post updated` label.
See https://github.com/WordPress/gutenberg/pull/61146 

Follow-up to [52062], [51003].

Props ntsekouras, ellatrix.
Fixes #61095.



Built from https://develop.svn.wordpress.org/trunk@58055


git-svn-id: http://core.svn.wordpress.org/trunk@57520 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-29 22:32:08 +00:00
Sergey Biryukov 9a2a3dc5b3 Tests: Use `assertSame()` in `WP_Comment::get_instance()` tests.
This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.

Follow-up to [38381].

Props costdev.
See #60706.
Built from https://develop.svn.wordpress.org/trunk@58054


git-svn-id: http://core.svn.wordpress.org/trunk@57519 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-29 15:40:09 +00:00
Tammie Lister 5638ddb0ae Twenty Fourteen: Adds base font size to pullquote block.
The pullquote block needed the base font size adding back in. This also adds in support for appearance settings for weight and style in addition to the original ticket. This fixes a previous commit which changed the default font size of pullquote blocks, quote blocks and blockquotes.

Props sabernhardt.
Fixes #61034.

Built from https://develop.svn.wordpress.org/trunk@58053


git-svn-id: http://core.svn.wordpress.org/trunk@57518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-29 12:17:10 +00:00
Sergey Biryukov a93698699b Tests: Use `assertSame()` in `wp_handle_comment_submission()` tests.
This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.

Follow-up to [38778], [46829].

Props costdev.
See #60706.
Built from https://develop.svn.wordpress.org/trunk@58052


git-svn-id: http://core.svn.wordpress.org/trunk@57517 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-28 18:57:14 +00:00
Sergey Biryukov 93116dbd5c Tests: Add more specific messages for a custom assertion in `WP_Test_REST_TestCase`.
All assertions in PHPUnit have a `$message` parameter. Setting this parameter allows to distinguish which assertion is failing when a test runs multiple assertions, making debugging of the tests easier.

Follow-up to [34928], [51478], [58039].

See #60426.
Built from https://develop.svn.wordpress.org/trunk@58051


git-svn-id: http://core.svn.wordpress.org/trunk@57516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-26 15:51:15 +00:00
Adam Silverstein 93978139f0 Media: fix potential error in class-avif-info.php::get_item_features().
Import upstream fix from libavifinfo, correcting a potential fatal error.

Props yguyon.
Fixes #60980.


Built from https://develop.svn.wordpress.org/trunk@58049


git-svn-id: http://core.svn.wordpress.org/trunk@57514 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-26 15:02:14 +00:00
dmsnell 4aa1d98bd1 HTML API: Tests should use expectedIncorrectUsage phpunit annotation
Some tests in the HTML API test suite use `setExpectedIncorrectUsage`.
The annotation `@expectedIncorrectUsage` can be used to simplify the tests.

Developed in https://github.com/WordPress/wordpress-develop/pull/6449
Discussed in https://core.trac.wordpress.org/ticket/61080

Fixes #61080.
Props dmsnell, jonsurrell.

Built from https://develop.svn.wordpress.org/trunk@58048


git-svn-id: http://core.svn.wordpress.org/trunk@57513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-26 13:53:15 +00:00
Bernhard Reiter 9c840416cc Tests: Skip Gutenberg plugin activation test on older WP versions.
The purpose of `tests/e2e/specs/gutenberg-plugin.test.js` is to ensure that running the Gutenberg plugin (stable version) on a WordPress `trunk` install doesn't produce any fatals.

The test was introduced in [54913], i.e. it has been around since WP 6.2. It makes sense to have it present on older branches, as the Gutenberg plugin not only supports `trunk`, but also the current stable version of WordPress (i.e. currently 6.5), and one version below (6.4). However, it is not expected to work on any earlier versions beyond that; in practice, it has produced errors on some of those.

This changeset checks the REST API response from the plugin activation request. If it returns an error with error code `plugin_wp_incompatible`, it skips the test.

Props jorbin, johnbillion, swissspidy.
Fixes #60971.
Built from https://develop.svn.wordpress.org/trunk@58046


git-svn-id: http://core.svn.wordpress.org/trunk@57512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-26 10:31:18 +00:00
Sergey Biryukov 2f44f23d92 Docs: Remove extra commas in `WP_User_Query::prepare_query()` DocBlock.
Follow-up to [52226], [58032].

Props nareshbheda, mukesh27.
Fixes #61076.
Built from https://develop.svn.wordpress.org/trunk@58045


git-svn-id: http://core.svn.wordpress.org/trunk@57511 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-25 10:49:16 +00:00
Sergey Biryukov dfc568cd20 Tests: Use `assertSame()` in `WP_oEmbed_Controller` tests.
This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.

Follow-up to [41047].

Props costdev.
See #60706.
Built from https://develop.svn.wordpress.org/trunk@58044


git-svn-id: http://core.svn.wordpress.org/trunk@57510 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-24 22:05:18 +00:00
Bernhard Reiter a3f1555919 Block Hooks: Fix `@since` and deprecated versions.
Two `@since` PHPDoc fields, and the version argument to one `_deprecated_argument()` incorrectly stated 6.5.1 as the relevant WordPress version where a change was introduced.

This changeset fixes them by setting them to 6.5.3 instead.

Follow-up to [57919].
See #60754.
Built from https://develop.svn.wordpress.org/trunk@58042


git-svn-id: http://core.svn.wordpress.org/trunk@57508 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-24 12:11:15 +00:00
dmsnell f9776f536f HTML API: Fix detection of single-length funky comments.
Since [60428] the Tag Processor has been misidentifying single-character
funky comments. It has been asserting that the full token-length for a
funky comment must be at least three characters after the opening (e.g.
`</1>`), but it has been starting to look for the closing `>` after
those same three characters. This means that it has been skipping the
actual close of these funky comments and swallowing up the next syntax
until it finds a `>`, often consuming the next tag in the process.

This patch fixes the detector and restores finding the following token.

Developed in https://github.com/WordPress/wordpress-develop/pull/6412
Discussed in https://core.trac.wordpress.org/ticket/60170

Follow-up to [60428].
Fixes #60170.
Props dmsnell, gziolo, jonsurrell.

Built from https://develop.svn.wordpress.org/trunk@58040


git-svn-id: http://core.svn.wordpress.org/trunk@57506 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-24 07:45:14 +00:00
Sergey Biryukov 9d5f8481df Tests: Add a `$message` parameter for a custom assertion in `WP_Test_REST_TestCase`.
All assertions in PHPUnit have a `$message` parameter. Setting this parameter allows to distinguish which assertion is failing when a test runs multiple assertions, making debugging of the tests easier.

This optional parameter is now added for `WP_Test_REST_TestCase::assertErrorResponse()`.

Follow-up to [34928], [51478].

Props mykolashlyakhtun, antonvlasenko, swissspidy, SergeyBiryukov.
Fixes #60426.
Built from https://develop.svn.wordpress.org/trunk@58039


git-svn-id: http://core.svn.wordpress.org/trunk@57505 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-23 18:57:12 +00:00
Pascal Birchler 4d09a87655 Docs: Improve incorrect indentation/alignment in a few docblocks.
See #60699.
Built from https://develop.svn.wordpress.org/trunk@58037


git-svn-id: http://core.svn.wordpress.org/trunk@57503 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-23 12:38:14 +00:00
audrasjb 258523f63e Toolbar: Replace "Edit Site" link with "Site Editor" in the Admin Toolbar.
This changesets replaces the "Edit Site" link with "Site Editor" to avoid duplicate link anchors on multisite admin toolbar. The remaining "Edit site" link takes the user to the site editing screen in the network admin area (`network/site-info.php`) while the new "Site Editor" link takes the user to the site editor (`site-editor.php`).

Follow-up to [52158]. See GB27135.

Props johnbillion, sabernhardt, audrasjb, johnjamesjacoby, pratiklondhe.
Fixes #60977.



Built from https://develop.svn.wordpress.org/trunk@58035


git-svn-id: http://core.svn.wordpress.org/trunk@57501 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-22 21:06:08 +00:00
Tammie Lister 0eb5aed212 Twenty Twenty-Three: Wraps navigation block in row within header template part.
This allows inserting of own blocks into header since the release of the Block Hooks API, specifically after the navigation block.

Props tomjcafferkey, poena, shailu25.
Fixes #60723.

Built from https://develop.svn.wordpress.org/trunk@58034


git-svn-id: http://core.svn.wordpress.org/trunk@57500 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-22 20:55:09 +00:00
audrasjb 6371434821 Media: Prevent division by zero in `wp_img_tag_add_width_and_height_attr()`.
This changesets adds a check for `$size_array` values to prevent a potential division by zero.
Follow-up to [57294].

Props jdekhtiar.
Fixes #61054.
See #59352.



Built from https://develop.svn.wordpress.org/trunk@58033


git-svn-id: http://core.svn.wordpress.org/trunk@57499 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-22 20:35:10 +00:00
audrasjb 2d2b97f115 Docs: Typo corrections in class `WP_Meta_Query`.
Props truptikanzariya.
Fixes #61051.
See #60699.



Built from https://develop.svn.wordpress.org/trunk@58032


git-svn-id: http://core.svn.wordpress.org/trunk@57498 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-22 20:25:08 +00:00
Tammie Lister 95533c6f68 Twenty Twelve: Fixes typing errors in block pattern.
There were several instances of typo corrections in block patterns. This removes the last sentence for a simpler resolution.

Props sabernhardt.
Fixes #61004.

Built from https://develop.svn.wordpress.org/trunk@58031


git-svn-id: http://core.svn.wordpress.org/trunk@57497 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-22 20:19:15 +00:00
isabel_brison 9fd435aa15 Editor: fix spacing in function doc.
Correctly formats spacing in `get_layout_styles` docblock.

Props mukesh27, sabernhardt.
See #60981.

Built from https://develop.svn.wordpress.org/trunk@58030


git-svn-id: http://core.svn.wordpress.org/trunk@57496 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-22 07:20:09 +00:00
Sergey Biryukov 4fb8608aa5 Docs: Use correct URL for the Embeds documentation article.
Follow-up to [57793].

Props shailu25, estelaris, audrasjb.
See #60732.
Built from https://develop.svn.wordpress.org/trunk@58029


git-svn-id: http://core.svn.wordpress.org/trunk@57495 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-22 06:25:11 +00:00
isabel_brison 9ecc777ded Editor: limit layout rules on themes without theme.json.
Removes output of base rules for flow and constrained layout types on themes without theme.json.

Props evanltd, poena, isabel_brison, andrewserong, oandregal.
See #60981.

Built from https://develop.svn.wordpress.org/trunk@58028


git-svn-id: http://core.svn.wordpress.org/trunk@57494 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-22 05:30:13 +00:00
Sergey Biryukov 46356f0215 Docs: Remove extra space before `@since` in `WP_Block_Bindings_Registry` DocBlock.
Follow-up to [57373].

Props shailu25.
Fixes #61046.
Built from https://develop.svn.wordpress.org/trunk@58027


git-svn-id: http://core.svn.wordpress.org/trunk@57493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-21 03:52:11 +00:00
Sergey Biryukov 453c78db60 Coding Standards: Use strict comparison in `wp_add_global_styles_for_blocks()`.
Follow-up to [57546].

Props immeet94.
Fixes #60964.
Built from https://develop.svn.wordpress.org/trunk@58026


git-svn-id: http://core.svn.wordpress.org/trunk@57492 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-20 04:01:18 +00:00
Joe McGill 244a8cf308 Themes: Cache block theme patterns in a transient.
This extends the benefits of persistent caching added in [56978] for block theme patterns to sites that are not using a persistent object cache. By default, these caches expire using the value of the `WP_Theme::cache_expiration` property. The transient cache TTL can be overridden using the newly introduced `wp_theme_files_cache_ttl` filter.

Props thekt12, joemcgill, flixos90, peterwilsoncc, spacedmonkey.
See #59600, #59719.

Built from https://develop.svn.wordpress.org/trunk@58025


git-svn-id: http://core.svn.wordpress.org/trunk@57491 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-19 17:59:16 +00:00
Sergey Biryukov 670692386b Docs: Fix typo in `WP_Block_Type::__construct()` DocBlock.
Follow-up to [54155].

Props ixkaito.
Fixes #61035.
Built from https://develop.svn.wordpress.org/trunk@58024


git-svn-id: http://core.svn.wordpress.org/trunk@57490 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-19 03:42:18 +00:00
Sergey Biryukov 3c5da9c743 Login and Registration: Check that `redirect_to` is a string in `wp-login.php`.
This prevents a fatal error if an array is passed instead.

Follow-up to [2876], [4969], [7524], [8701], [25701], [31417], [49109].

Props TimoTijhof.
Fixes #59373.
Built from https://develop.svn.wordpress.org/trunk@58023


git-svn-id: http://core.svn.wordpress.org/trunk@57489 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-18 06:24:22 +00:00
Peter Wilson f6fae87e73 Upgrade/Install: Validate source & destination values in `WP_Ugrader`.
Adds a missing string and some additional validation of paths in the upgrader class.

Follow up to [56992].

Props costdev, jipmoors, karlijnbok, swissspidy, afragen, mukesh27.
Fixes #59712.


Built from https://develop.svn.wordpress.org/trunk@58022


git-svn-id: http://core.svn.wordpress.org/trunk@57488 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-18 03:17:13 +00:00
joedolson cc7370b2af Help/About: Accessibility: Remove `target="_blank"` from data eraser links.
Remove `target="_blank"` from two links to developer resources on adding the personal data eraser to plugins in the Help info for the privacy screens. Also rectifies differences between the export and erase text for consistency and changes the order of paragraphs. 

Props sabernhardt, joedolson.
Fixes #60097.
Built from https://develop.svn.wordpress.org/trunk@58021


git-svn-id: http://core.svn.wordpress.org/trunk@57487 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-17 20:21:15 +00:00
Sergey Biryukov 1c0e271c2f Docs: Correct `@since` version for `COOKIE_DOMAIN` default value change.
Follow-up to [58011].

Props mukesh27.
See #46550.
Built from https://develop.svn.wordpress.org/trunk@58017


git-svn-id: http://core.svn.wordpress.org/trunk@57483 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-17 09:46:19 +00:00
Sergey Biryukov dc9dbf913f Users: Set the default value of `COOKIE_DOMAIN` to an empty string.
This matches the type expected by the `setcookie()` function for the `$domain` parameter, and resolves a fatal error if `strict_types` is enabled.

Reference: [https://www.php.net/setcookie PHP Manual: setcookie()].

Follow-up to [2725], [6434], [12732], [13062].

Props kmvan, rajinsharwar, jrf, desrosj, Cybr, nicolefurlan, oglekler, hellofromTonya, kirasong, chaion07, mukesh27.
Fixes #46550.
Built from https://develop.svn.wordpress.org/trunk@58011


git-svn-id: http://core.svn.wordpress.org/trunk@57482 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-16 16:52:14 +00:00
dmsnell d2ce038894 HTML API: Validate HTML Processor against external test suite from html5lib.
In this patch, the test suite from html5lib validates the tree-construction
steps in the HTML Processor to ensure that they are behaving according to the
HTML specification. This suite of tests is also used by the servo project to
test its html5ever package.

A new test module in the HTML API transforms HTML Processor output to match
the expected tree shape from the external tests. For cases where there are
tests validating behaviors of unsupported HTML tags and constructs, the tests
are marked as skipped. As the HTML API continues to expand its own support,
the number of skipped tests will automatically shrink down towards zero.

Additional tests are skipped through the `SKIP_TEST` array in the test runner.

Fixes #60227.
See #58517.
Props azaozz, costdev, dmsnell, hellofromtonya, jonsurrell, jorbin, swisspidy.


Built from https://develop.svn.wordpress.org/trunk@58010


git-svn-id: http://core.svn.wordpress.org/trunk@57481 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-16 12:08:17 +00:00
Sergey Biryukov dd6d4e74c1 Code Modernization: Fix implicit nullable parameter type deprecation on PHP 8.4.
In PHP 8.4, declaring function or method parameters with a default value of `null` is deprecated if the type is not nullable.

PHP applications are recommended to ''explicitly'' declare the type as nullable. All type declarations that have a default value of `null`, but without declaring `null` in the type declaration, will emit a deprecation notice:
{{{
function test( array $value = null ) {}
}}}
`Deprecated: Implicitly marking parameter $value as nullable is deprecated, the explicit nullable type must be used instead`

**Recommended Changes**

Change the implicit nullable type declaration to a nullable type declaration, available since PHP 7.1:
{{{#!diff
- function test( string $test = null ) {}
+ function test( ?string $test = null ) {}
}}}

This commit updates the affected instances in core to use a nullable type declaration.

References:
* [https://wiki.php.net/rfc/deprecate-implicitly-nullable-types PHP RFC: Deprecate implicitly nullable parameter types]
* [https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated PHP.Watch: PHP 8.4: Implicitly nullable parameter declarations deprecated]

Follow-up to [28731], [50552], [57337], [57985].

Props ayeshrajans, jrf, audrasjb, jorbin.
Fixes #60786.
Built from https://develop.svn.wordpress.org/trunk@58009


git-svn-id: http://core.svn.wordpress.org/trunk@57480 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-15 20:03:09 +00:00
Tammie Lister 593ccf4342 Twenty Eleven: Removes Negative values for padding.
This fixes the issue where negative values aren't allows in older versions of IE. There is more discussion in another ticket on a wider approach, but for now the decision to commit this was made as an interim solution.

Props mukesh27, SergeyBiryukov, sabernhardt, poena.
Fixes #46771.

Built from https://develop.svn.wordpress.org/trunk@58005


git-svn-id: http://core.svn.wordpress.org/trunk@57479 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-15 16:40:12 +00:00
Tammie Lister 44528d4fba Twenty Twenty Two: Wraps Navigation block in row.
Now that the Blocks Hooks API is released in 6.4, you might want to insert blocks into header of the theme after the Navigation block. This wraps to allow this.

Props tomjcafferkey, poena, shailu25.
Fixes #60724.

Built from https://develop.svn.wordpress.org/trunk@58004


git-svn-id: http://core.svn.wordpress.org/trunk@57478 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-15 16:26:15 +00:00
Sergey Biryukov 8689afae77 Twenty Twenty-One: Check for `WP_Error` before outputting `get_the_tag_list()`.
This prevents a fatal error on PHP 8 and brings consistency with the other bundled themes.

Follow-up to [47886].

Props josephscott, sabernhardt, poena, nirav7707, devsahadat.
Fixes #60800.
Built from https://develop.svn.wordpress.org/trunk@57991


git-svn-id: http://core.svn.wordpress.org/trunk@57477 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-14 21:57:13 +00:00
Sergey Biryukov 7bb686d18b Users: Account for returning `false` from the `authenticate` filter.
While technically only `null`, `WP_User`, or `WP_Error` should be returned from the `authenticate` filter, a plugin might return boolean `false` instead, which would trigger the `authentication_failed` error prior to [57882].

This commit aims to preserve that behavior in case `false` is returned.

Follow-up to [57882].

Props johnbillion.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57990


git-svn-id: http://core.svn.wordpress.org/trunk@57476 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-13 16:33:13 +00:00
Tammie Lister 8d0570f72c Twenty Fourteen: Fixes pullquote block issues with font sizing.
The pullquote block was not showing increase in sizes within the editor. This solves that and allows you to see the change both in the editor and front.

Props nidhidhandhukiya, huzaifaalmesbah.
Fixes #59800.

Built from https://develop.svn.wordpress.org/trunk@57989


git-svn-id: http://core.svn.wordpress.org/trunk@57475 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-12 19:55:12 +00:00
Pascal Birchler 09be520d72 Docs: Revert unintended `svn:ignore` change after [57987].
See #60699.
Built from https://develop.svn.wordpress.org/trunk@57988


git-svn-id: http://core.svn.wordpress.org/trunk@57474 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-12 17:50:12 +00:00
Pascal Birchler 00d06db33d Docs: Fix various typos and spelling mistakes.
Props swissspidy, jucaduca, sergeybiryukov.
See #60699.
Built from https://develop.svn.wordpress.org/trunk@57987


git-svn-id: http://core.svn.wordpress.org/trunk@57473 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-12 17:47:13 +00:00
Sergey Biryukov 98d90f8533 Coding Standards: Upgrade WPCS to version 3.1.0.
The impact on existing WordPress core code is expected to be minimal, but the release does provide more safeguards for the future.

References:
* [https://github.com/WordPress/WordPress-Coding-Standards/releases/tag/3.1.0 WPCS 3.1.0 release notes]
* [https://github.com/WordPress/WordPress-Coding-Standards/compare/3.0.1...3.1.0 Full list of changes in WPCS 3.1.0]

Follow-up to [56695], [56799], [57378].

Props jrf, garyj, dingo_d, rodrigosprimo, Chouby, westonruter, bjorsch.
Fixes #60840.
Built from https://develop.svn.wordpress.org/trunk@57986


git-svn-id: http://core.svn.wordpress.org/trunk@57472 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-12 12:17:10 +00:00
John Blackbourn dd224888c7 General: Increase the minimum supported version of PHP to 7.2.24.
Props justlevine, masteradhoc, samiamnot, hellofromTonya, azaozz, jrf, dd32, desrosj, jorbin

Fixes #58719

Built from https://develop.svn.wordpress.org/trunk@57985


git-svn-id: http://core.svn.wordpress.org/trunk@57471 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-11 21:11:16 +00:00
Sergey Biryukov 181e799593 Docs: Update `@since` version for `wp_zip_file_is_valid()`.
Follow-up to [57537], [57916], [57929].

Props TobiasBg.
See #60398.
Built from https://develop.svn.wordpress.org/trunk@57984


git-svn-id: http://core.svn.wordpress.org/trunk@57470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-11 14:28:14 +00:00
Pascal Birchler a6b9c3d542 Script Loader: stop enqueueing some now obsolete polyfills.
Stop enqueueing polyfills such as `wp-polyfill-inert` (for the `inert` attribute) and `regenerator-runtime` (for generator functions), as they are no longer needed, considering the WordPress project's [https://make.wordpress.org/core/handbook/best-practices/browser-support/ browser support policy].

In addition to that, `wp-polyfill` (essentially `core-js`) is no longer enqueued as a dependency of `react`. This was added in [43903] to ensure compatibility with IE 11, which is no longer supported by WordPress. Developers requiring `wp-polyfill` need to manually add it as a dependency for their scripts.

Props swissspidy, flixos90, adamsilverstein, youknowriad, gziolo.
Fixes #60962.
Built from https://develop.svn.wordpress.org/trunk@57981


git-svn-id: http://core.svn.wordpress.org/trunk@57467 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-10 14:42:17 +00:00
John Blackbourn a04dc48ea7 Editor: Update npm packages.
Updates the editor npm packages to the latest patch versions for 6.5.1.

See https://github.com/WordPress/gutenberg/pull/60577.

Built from https://develop.svn.wordpress.org/trunk@57949


git-svn-id: http://core.svn.wordpress.org/trunk@57446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-09 10:57:27 +00:00
isabel_brison 8fbd2fc6f4 Editor: skip outputting base layout rules if content and wide size values don’t exist.
Skip outputting layout rules that reference content and wide sizes CSS variables, if no layout sizes exist in the current `theme.json`.

Props andrewserong.
Fixes #60936.

Built from https://develop.svn.wordpress.org/trunk@57948


git-svn-id: http://core.svn.wordpress.org/trunk@57445 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-09 07:20:15 +00:00
jorgefilipecosta f3873d2f8a Coding Standards: Fix missing strict in_array on block-template-utils.php.
Props swissspidy.
Built from https://develop.svn.wordpress.org/trunk@57946


git-svn-id: http://core.svn.wordpress.org/trunk@57443 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-08 21:42:17 +00:00
Sergey Biryukov 440a5f21ca Twenty Twenty-Four: Remove pattern from home template to improve performance.
Creating the Home Business pattern was needed to show it on the template replacement flows, but there's no need to use it in the template, and the minor code repetition is better than having to do a an extra pattern replacement.

Follow-up to [https://github.com/WordPress/twentytwentyfour/pull/486 PR #486].

Props onemaggie, youknowriad, poena, afercia.
Fixes #60620.
Built from https://develop.svn.wordpress.org/trunk@57945


git-svn-id: http://core.svn.wordpress.org/trunk@57442 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-08 19:21:16 +00:00
jorgefilipecosta a0712d7758 Honor template_hierarchy filters when creating a template in the Site Editor.
Currently, in blocks themes it's possible to use the ${type}_template_hierarchy filter to alter the template hierarchy. However, those filters are not taken into consideration by the Choose a pattern popup screen that appears when creating a new template in the Site Editor, causing a mismatch between the editor and the frontend.

Props aljullu, mukesh27, ntsekouras, jorgefilipecosta, gziolo.
Fixes #60846.
Built from https://develop.svn.wordpress.org/trunk@57944


git-svn-id: http://core.svn.wordpress.org/trunk@57441 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-08 16:47:16 +00:00
Peter Wilson f4fb98f366 Script Loader: Improve asset concatenation Etags.
Include the asset version of JavaScript and CSS files when generating the ETag for concatenated assets in `load-scripts.php` and `load-styles.php`. This ensures the ETag is updated as script versions change (for example editor package updates) rather than only when the WordPress version changes.

The `W\` prefix is added to the generated ETag to allow for CDNs and proxy servers modifying the script to add or improve the compression algorithm.

Props azaozz, dav4, ironprogrammer, johnbillion, kkmuffme, monzuralam, peterwilsoncc, sergeybiryukov.
Fixes #58433.

Built from https://develop.svn.wordpress.org/trunk@57943


git-svn-id: http://core.svn.wordpress.org/trunk@57440 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-07 23:53:19 +00:00
Sergey Biryukov c518c3a924 Docs: Correct `@since` version for status code 425 in `get_status_header_desc()`.
Follow-up to [57936].

See #60942.
Built from https://develop.svn.wordpress.org/trunk@57937


git-svn-id: http://core.svn.wordpress.org/trunk@57438 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-07 11:22:08 +00:00
Sergey Biryukov 70e045910b HTTP API: Add support for a description for HTTP status code 425 (Too Early).
Reference: [https://datatracker.ietf.org/doc/rfc8470/ RFC 8470: Using Early Data in HTTP].

Follow-up to [5446], [6104], [10740], [27422], [36274], [36294], [42207].

Props kkmuffme, mukesh27, joemcgill.
Fixes #60942.
Built from https://develop.svn.wordpress.org/trunk@57936


git-svn-id: http://core.svn.wordpress.org/trunk@57437 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-07 11:18:17 +00:00
Sergey Biryukov 46676b4060 Coding Standards: Use strict comparison in `wp-includes/class-wp-image-editor-imagick.php`.
Follow-up to [22094].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57934


git-svn-id: http://core.svn.wordpress.org/trunk@57435 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-06 13:37:18 +00:00
Aaron Jorbin a7f59e981f Media: Use flex-start for full browser support.
The value of `start` is not fully supported by Opera Mini which has 1.01% usage. There is no material change in functionality with this change.

Follow-up to [55919].

Props davidbaumwald, sabernhardt, khokansardar, devsahadat.
Fixes #60876.

Built from https://develop.svn.wordpress.org/trunk@57933


git-svn-id: http://core.svn.wordpress.org/trunk@57434 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-05 21:47:15 +00:00
Tammie Lister 103d0deb89 Twenty Twenty-Four: Fixes typo in testimonial pattern.
There was a small typo which was in a string context only visible to translators for the testimonial pattern. This fixes that.

Props shailu25, SergeyBiryukov.
Fixes #60924.

Built from https://develop.svn.wordpress.org/trunk@57932


git-svn-id: http://core.svn.wordpress.org/trunk@57433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-05 20:46:15 +00:00
Sergey Biryukov 6bc444cc42 Tests: Use an image on WordPress.org CDN in external HTTP tests.
Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Props peterwilsoncc, jorbin.
See #60865.
Built from https://develop.svn.wordpress.org/trunk@57931


git-svn-id: http://core.svn.wordpress.org/trunk@57432 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-05 12:12:14 +00:00
Joe McGill 9bb63fd665 Themes: Avoid errors in some environments from `_get_block_templates_paths`.
This adds an `is_dir()` check in `_get_block_templates_paths` before trying to run a `RecursiveDirectoryIterator` to avoid errors being reported in New Relic even thought the errors should be handled by a try/catch block.

Follow-up to [57215].

Props iCaleb, sean212, mukesh27, joemcgill.
Fixes #60915.


Built from https://develop.svn.wordpress.org/trunk@57928


git-svn-id: http://core.svn.wordpress.org/trunk@57429 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-04 18:56:57 +00:00
John Blackbourn 78d729602e Database: Remove back-compat for database servers that don't support `utf8mb4`.
Since WordPress 6.5, the minimum supported version of MySQL and MariaDB is 5.5.5. This means all supported database servers now support the `utf8mb4` character set and therefore the conditional logic for this is no longer necessary.

Props l1nuxjedi, craigfrancis, OllieJones, johnbillion

Fixes #60096

Built from https://develop.svn.wordpress.org/trunk@57926


git-svn-id: http://core.svn.wordpress.org/trunk@57427 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-04 15:13:14 +00:00
Pascal Birchler 1c8b25a7a5 I18N: Bail early if an invalid text domain is passed to `load_textdomain()` et al.
Some plugins pass invalid values such as `null` instead of a string, which has never been supported by WordPress (no translations are loaded) and was technically undefined behavior. With the introduction of the new l10n library in #59656, which has stricter type hints, this could end up causing warnings or even fatal errors.

This change adds a deliberate short-circuit to `load_textdomain()` & co. to better handle such a case and document that it is not supported.

Props verygoode, swissspidy.
Fixes #60888.
Built from https://develop.svn.wordpress.org/trunk@57925


git-svn-id: http://core.svn.wordpress.org/trunk@57426 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-04 13:56:13 +00:00
Pascal Birchler f09686a12a Build/Test Tools: Update a few image URLs in HTTP and image cropping tests.
Follow-up to #60865 / [57903] where similar instances were recently updated due to an upstream change.

Particularly the `test_wp_crop_image_with_url()` test recently began to fail on some environments, likely because of the same change.

This updates the image URLs with the aim to bring more consistency and to get the test passing again more broadly.

Fixes #60907.
Built from https://develop.svn.wordpress.org/trunk@57924


git-svn-id: http://core.svn.wordpress.org/trunk@57425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-04 13:45:10 +00:00
Pascal Birchler 3ed6382329 Permalinks: Detect FrankenPHP web server support.
Support pretty permalinks when FrankenPHP server is detected, which is built on top of Caddy. Caddy detection was added in [57612].

Props swissspidy, stephenmiracle.
Fixes #60884.
Built from https://develop.svn.wordpress.org/trunk@57923


git-svn-id: http://core.svn.wordpress.org/trunk@57424 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-04 13:40:06 +00:00
Pascal Birchler 54a61e9c9b I18N: Always search for script translations in `wp-content/languages/plugins`.
Previously, when `WP_PLUGIN_DIR` was set to something other than `wp-content/plugins`, e.g. `wp-content/mods`, `load_script_textdomain` was searching for script translations in `wp-content/languages/mods`. However, that is incorrect, as `WP_PLUGIN_DIR` does not affect where translations are stored. The location is always `wp-content/languages/plugins`.

Props coreymckrill, swissspidy.
Fixes #60891.
Built from https://develop.svn.wordpress.org/trunk@57922


git-svn-id: http://core.svn.wordpress.org/trunk@57423 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-04 13:38:11 +00:00
Sergey Biryukov 9ac3e01c91 Docs: Fix typo in `wp_mediaelement_fallback` filter description.
Follow-up to [23729], [28128].

Props dilipbheda, mukesh27.
Fixes #60917.
Built from https://develop.svn.wordpress.org/trunk@57921


git-svn-id: http://core.svn.wordpress.org/trunk@57422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-04 11:19:14 +00:00
Felix Arntz 6fe9681e77 Options, Meta APIs: Use more sensible default for autoloading options which allows WordPress core to make a decision.
An excessive amount of autoloaded options is a common cause for slow database responses, sometimes caused by very large individual autoloaded options. As it is not mandatory to provide an autoload value when adding an option to the database, it tends to be ignored, which in combination with a default value of "yes" and lack of documentation can lead to the aforementioned problem.

This changeset enhances the option autoloading behavior in several ways:
* Update the function documentation to encourage the use of boolean `true` or `false` to explicitly provide an autoload value for an option.
* Use new string values `on` and `off` for explicitly provided values stored in the database, to distinguish them from `yes` and `no`, since `yes` does not allow determining whether it was set intentionally by the developer or only as a default.
* Effectively deprecate the values `yes` and `no`. They are still supported for backward compatibility, but now discouraged.
* Use `null` as new default autoload value for `add_option()`. If the developer does not provide an explicit value, this will now trigger WordPress logic to determine an autoload value to use:
    * If WordPress determines that the option should not be autoloaded, it is stored in the database as `auto-off`. As part of this changeset, the single heuristic introduced for that is to check whether the option size is larger than a threshold of 150k bytes. This threshold is filterable via a new `wp_max_autoloaded_option_size` filter.
    * If WordPress determines that the option should be autoloaded, it is stored in the database as `auto-on`. No logic to make such a decision is introduced as part of this changeset, but a new filter `wp_default_autoload_value` can be used to define such heuristics, e.g. by optimization plugins.
    * If WordPress cannot determine whether or not to autoload the option, it is stored in the database as `auto`.
    * This effectively means that any option without an explicit autoload value provided by the developer will be stored with an autoload value of `auto`, unless the option's size exceeds the aforementioned threshold. Options with a value of `auto` are still autoloaded as of today, most importantly for backward compatibility. A new function `wp_autoload_values_to_autoload()` returns the list of autolaod values that dictate for an option to be autoloaded, and a new filter `wp_autoload_values_to_autoload` can be used to alter that list.

These behavioral changes encourage developers to be more mindful of autoloading, while providing WordPress core and optimization plugins with additional control over heuristics for autoloading options where no explicit autoload value was provided.

At the same time, the changes are fully backward compatible from a functionality perspective, with the only exception being that very large options will now no longer be autoloaded if the developer did not explicitly request for them to be autoloaded. Neither WordPress core nor plugins are able to override an explicitly provided value, which is intentional to continue giving developers full control over their own options.

Props pbearne, flixos90, joemcgill, azaozz, spacedmonkey, swissspidy, mukesh27, markjaquith.
Fixes #42441.

Built from https://develop.svn.wordpress.org/trunk@57920


git-svn-id: http://core.svn.wordpress.org/trunk@57421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-03 21:31:15 +00:00
Bernhard Reiter 725f302121 Block Hooks: Pass correct context to filters.
The `$context` argument passed to filters such as `hooked_block_types`, `hooked_block`, and `hooked_block_{$hooked_block_type}` allows them to conditionally insert a hooked block. If the anchor block is contained in a template or template part, `$context` will be set to a `WP_Block_Template` object reflecting that template or part.

The aforementioned filters are applied when hooked block insertion is run upon reading a template (or part) from the DB (and before sending the template/part content with hooked blocks inserted over the REST API to the client), but also upon writing to the DB, as that's when the `ignoredHookedBlocks` metadata attribute is set.

Prior to this changeset, the `$context` passed to Block Hooks related filters in the latter case reflected the template/part that was already stored in the database (if any), which is a bug; instead, it needs to reflect the template/part that will result from the incoming `POST` network request that will trigger a database update.

Those incoming changes are encapsulated in the `$changes` argument passed to the `reset_pre_insert_template` and  `reset_pre_insert_template_part` filters, respectively, and thus to the `inject_ignored_hooked_blocks_metadata_attributes` function that is hooked to them. `$changes` is of type `stdClass` and only contains the fields that need to be updated. That means that in order to create a `WP_Block_Template` object, a two-step process is needed:

- Emulate what the updated `wp_template` or `wp_template_part` post object in the database will look like by merging `$changes` on top of the existing `$post` object fetched from the DB, or from the theme's block template (part) file, if any.
- Create a `WP_Block_Template` from the resulting object.

To achieve the latter, a new helper method (`_build_block_template_object_from_post_object`) is extracted from the existing `_build_block_template_result_from_post` function. (The latter cannot be used directly as it includes a few database calls that will fail if no post object for the template has existed yet in the database.)

While somewhat complicated to implement, the overall change allows for better separation of concerns and isolation of entities. This is visible e.g. in the fact that `inject_ignored_hooked_blocks_metadata_attributes` no longer requires a `$request` argument, which is reflected by unit tests no longer needing to create a `$request` object to pass to it, thus decoupling the function from the templates endpoint controller.

Unit tests for `inject_ignored_hooked_blocks_metadata_attributes` have been moved to a new, separate file. Test coverage has been added such that now, all three relevant scenarios are covered:

- The template doesn't exist in the DB, nor is there a block theme template file for it.
- The template doesn't exist in the DB, but there is a block theme template file for it.
- The template already exists in the DB.

Those scenarios also correspond to the logical branching inside `WP_REST_Templates_Controller::prepare_item_for_database`, which is where `inject_ignored_hooked_blocks_metadata_attributes` gets its data from.

Props tomjcafferkey, bernhard-reiter, gziolo, swissspidy.
Fixes #60754.
Built from https://develop.svn.wordpress.org/trunk@57919


git-svn-id: http://core.svn.wordpress.org/trunk@57420 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-03 15:11:14 +00:00
Pascal Birchler d6ce792045 Build/Test Tools: Migrate to Docker Compose V2.
Compose V2, which was first released in 2020, is included with all currently supported versions of Docker Desktop. Compose V1 stopped receiving updates in July 2023.

The biggest difference is that the command to interact with Compose changed from `docker-compose` to `docker compose`.

GitHub has now started removing V1 from Ubuntu & Windows images, which caused all Docker-based GitHub Actions workflows to fail.

This change migrates to the new `docker compose` command to address these failures.

Props swissspidy, thelovekesh.
Fixes #60901.
Built from https://develop.svn.wordpress.org/trunk@57918


git-svn-id: http://core.svn.wordpress.org/trunk@57419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-03 11:33:12 +00:00
Sergey Biryukov c98b4ce7f3 Coding Standards: Use strict comparison in `wp-includes/class-wp-image-editor-gd.php`.
Follow-up to [22094], [22817], [50810], [57524].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57917


git-svn-id: http://core.svn.wordpress.org/trunk@57418 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-03 10:33:24 +00:00
Sergey Biryukov db1e75b20a Docs: Update `@since` version for `wp_zip_file_is_valid()`.
Follow-up to [57537].

Props TobiasBg.
See #60398.
Built from https://develop.svn.wordpress.org/trunk@57916


git-svn-id: http://core.svn.wordpress.org/trunk@57417 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-02 19:24:16 +00:00
desrosj 657f36adfa Build/Test Tools: Include 6.4 and 6.5 in upgrade testing.
This ensures that upgrading from 6.4 and 6.5 to the desired version is actually tested.

See #60733.
Built from https://develop.svn.wordpress.org/trunk@57915


git-svn-id: http://core.svn.wordpress.org/trunk@57416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-02 19:19:17 +00:00
Sergey Biryukov bac700319a Help/About: Remove unused CSS previously intended for the Freedoms screen.
Follow-up to [44264], [45278], [49219], [49479], [51356], [51459].

Props sjnbham, niravsherasiya7707.
Fixes #60857.
Built from https://develop.svn.wordpress.org/trunk@57911


git-svn-id: http://core.svn.wordpress.org/trunk@57412 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-02 11:12:19 +00:00
audrasjb 4e52c28a2e Docs: Various typo corrections in `wp-includes/formatting.php`.
Props shailu25.
Fixes #60814.
See #60699.



Built from https://develop.svn.wordpress.org/trunk@57910


git-svn-id: http://core.svn.wordpress.org/trunk@57411 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-01 20:55:12 +00:00
audrasjb 8396c3fbd5 General: Fix various typo issues found in `deprecated.php` and Font Library unit tests.
Props shailu25, mukesh27, sabernhardt, audrasjb.
Fixes #60870.



Built from https://develop.svn.wordpress.org/trunk@57909


git-svn-id: http://core.svn.wordpress.org/trunk@57410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-01 20:45:13 +00:00
davidbaumwald 3fa06d8fbd Upgrade/Install: Update the `$_old_files` array for 6.5.
Props audrasjb, huzaifaalmesbah, swissspidy.
Fixes #60648.
Built from https://develop.svn.wordpress.org/trunk@57905


git-svn-id: http://core.svn.wordpress.org/trunk@57406 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-01 16:38:18 +00:00
Sergey Biryukov 041cf81e0d Tests: Revert the image size change in `wp_remote_head()` and `wp_remote_get()` tests.
The exact size in the response appears to differ between platforms, but this should make the tests pass for now.

Follow-up to [57903].

See #60865.
Built from https://develop.svn.wordpress.org/trunk@57904


git-svn-id: http://core.svn.wordpress.org/trunk@57405 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-01 14:32:21 +00:00
Sergey Biryukov 6257387ee7 Tests: Update expectations in `wp_remote_head()` and `wp_remote_get()` tests.
It appears that something has changed on the WP.com side to compress the requested images on the fly, which interfered with the previous expectations in these tests.

This commit uses a direct file URL and updates the expected image size to match the currently returned response.

Follow-up to [139/tests], [31258], [47142].

Props dextorlobo, swissspidy, davidbaumwald, SergeyBiryukov.
See #60865.
Built from https://develop.svn.wordpress.org/trunk@57903


git-svn-id: http://core.svn.wordpress.org/trunk@57404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-01 13:57:23 +00:00
Andrew Ozz e68090cdcf Docs: Improve the docblock for `_wp_filter_font_directory()`. Remove the recommended use section as this is a private use only function.
Props peterwilsoncc, swissspidy, azaozz.
Fixes #60652.
Built from https://develop.svn.wordpress.org/trunk@57902


git-svn-id: http://core.svn.wordpress.org/trunk@57403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-01 02:53:12 +00:00
Sergey Biryukov 6f636420db Docs: Fix a few typos in `wp-admin/includes/class-pclzip.php`.
Follow-up to  [6779], [47123], [55827].

Props nithins53, nithi22, mukesh27.
Fixes #60818.
Built from https://develop.svn.wordpress.org/trunk@57901


git-svn-id: http://core.svn.wordpress.org/trunk@57402 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-31 05:52:15 +00:00
Sergey Biryukov d1ea7a0723 Coding Standards: Revert [57899] pending test failure investigation.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57900


git-svn-id: http://core.svn.wordpress.org/trunk@57401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-30 00:46:11 +00:00
Sergey Biryukov 053fbef212 Coding Standards: Use strict comparison in `wp-includes/class-wp-image-editor-gd.php`.
Follow-up to [22094], [22817], [50810], [57524].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57899


git-svn-id: http://core.svn.wordpress.org/trunk@57400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-30 00:17:13 +00:00
Sergey Biryukov 1dc3f87870 Networks and Sites: Remove unused `$wpdb` global in `update_blog_details()`.
Follow-up to [43548].

Props viralsampat.
See #60021.
Built from https://develop.svn.wordpress.org/trunk@57898


git-svn-id: http://core.svn.wordpress.org/trunk@57399 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-29 11:42:13 +00:00
Tammie Lister 11dfccd894 Twenty Twelve: Fixes table block font size not changing.
Currently the table block font size does not change in the editor or front-end. This ensures this is reflected in the table block.

Props sabernhardt, tahmidulkarim, sheulyshila.
Fixes #58074.

Built from https://develop.svn.wordpress.org/trunk@57897


git-svn-id: http://core.svn.wordpress.org/trunk@57398 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-28 20:58:17 +00:00
Tammie Lister 6ec197bdf3 Twenty Eleven: Fixes adding citation text color issue in pullquote block.
The pullquote block wasn't reflecting text color added for quote and add citation text across the front and back of editor. This fixes that by adding ensuring whatever color is selected is shown in both

Props kajalgohel.
Fixes #56524.

Built from https://develop.svn.wordpress.org/trunk@57896


git-svn-id: http://core.svn.wordpress.org/trunk@57397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-28 18:16:11 +00:00
Tammie Lister fa34e40c7b Twenty Twenty: Fixes The design of the ordered and unordered lists within editor.
There wasn't enough padding and the spacing was deteriorating the more depth there was. This reflects the front now and respects background coloring. Impacts both types of lists although original reporting was just on one.

Props aezazshekh, krupalpanchal, multidots1896, kajalgohel, sabernhardt.
Fixes #56083.

Built from https://develop.svn.wordpress.org/trunk@57895


git-svn-id: http://core.svn.wordpress.org/trunk@57396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-28 16:59:14 +00:00
Sergey Biryukov 92daa4fe72 Tests: Use an existing user fixture in the test for logging in with an email address.
Creating a new user is redundant here, the fixture shared by other tests can be used instead.

Follow-up to [36617].

See #60705.
Built from https://develop.svn.wordpress.org/trunk@57892


git-svn-id: http://core.svn.wordpress.org/trunk@57393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-28 11:19:18 +00:00
desrosj 3bf6493510 Editor: Merge Editor bug fixes ahead of 6.5 RC4.
This merges several high priority bug fixes for the editor ahead of WordPress 6.5:
- https://github.com/WordPress/gutenberg/pull/60180
- https://github.com/WordPress/gutenberg/pull/60093
- https://github.com/WordPress/gutenberg/pull/60071
- https://github.com/WordPress/gutenberg/pull/60130
- https://github.com/WordPress/gutenberg/pull/59959
- https://github.com/WordPress/gutenberg/pull/60167

Props youknowriad, annezazu, mcsf, jsnajdr, mmaattiiaass, get_dave, scruffian, mikachan, grantmkin, andraganescu, scruffian, antosguillamot, fabiankaegy, huzaifaalmesbah, krupajnanda, colorful-tones, liviopv, mamaduka, kim88, poena, peterwilsoncc, wildworks, swissspidy, desrosj, jorbin.
Fixes #60315.
Built from https://develop.svn.wordpress.org/trunk@57888


git-svn-id: http://core.svn.wordpress.org/trunk@57389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-28 02:29:24 +00:00
audrasjb 3e244ae879 I18n: Add context to the "Patterns" translatable string for the related admin menu item.
This changeset put back the context parameter of the "Patterns" string which was previously removed to fix a translation issue without introducing a string change during WP 6.5 string freeze period.

Follow-up to [57864].

Props kebbet, narenin, nestea29950.
Fixes #60827.



Built from https://develop.svn.wordpress.org/trunk@57887


git-svn-id: http://core.svn.wordpress.org/trunk@57388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-27 22:44:16 +00:00
desrosj fba385feef Bundled Themes: Bump default theme versions for release with 6.5.
This updates the version of each default theme to the following versions:
- Twenty Ten: `4.1`
- Twenty Eleven: `4.6`
- Twenty Twelve: `4.2`
- Twenty Thirteen: `4.1`
- Twenty Fourteen: `3.9`
- Twenty Fifteen: `3.7`
- Twenty Sixteen: `3.2`
- Twenty Seventeen: `3.6`
- Twenty Nineteen: `2.8`
- Twenty Twenty: `2.6`
- Twenty Twenty-One: `2.2`
- Twenty Twenty-Two: `1.7`
- Twenty Twenty-Three: `1.4`
- Twenty Twenty-Four: `1.1`

These versions will released in coordination with WordPress 6.5.

Props sabernhardt, desrosj, kushang78, mukesh27, huzaifaalmesbah, shailu25, poena.
Fixes #59816.
Built from https://develop.svn.wordpress.org/trunk@57886


git-svn-id: http://core.svn.wordpress.org/trunk@57387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-27 19:06:14 +00:00
Pascal Birchler 0c4eec233d Editor: disable `shadow.defaultPresets` for classic themes.
With this change default shadow presets are never shown for classic themes, and classic themes have no options for adding custom ones.
This essentially reverts [57717] and [57827] / [57828], which had unintended consequences.

Props ajlende, oandregal, madhudollu, swissspidy, get_dave, andrewserong, desrosj.
Fixes #60815.
Built from https://develop.svn.wordpress.org/trunk@57885


git-svn-id: http://core.svn.wordpress.org/trunk@57386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-27 16:00:12 +00:00
Sergey Biryukov af0a8e253d Coding Standards: Use strict comparison in `wp-includes/pomo/plural-forms.php`.
Follow-up to [41722].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57883


git-svn-id: http://core.svn.wordpress.org/trunk@57384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-27 12:30:12 +00:00
Sergey Biryukov 95f1ba70eb Coding Standards: Use strict comparison in `wp-includes/pluggable.php`.
Follow-up to [3566], [6387], [10437], [11057], [11387], [16208], [16304], [18195], [20410], [26367], [34947].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57882


git-svn-id: http://core.svn.wordpress.org/trunk@57383 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-26 21:41:11 +00:00
Pascal Birchler d676def4a8 Media: Fix CSS issue preventing inserting images on smaller viewports.
Addresses a regression introduced in [57605] where the “Select” button in the media modal was not clickable anymore due to an overlaid element.

Props ramonopoly, swissspidy, freewebmentor.
Fixes #33049.
Built from https://develop.svn.wordpress.org/trunk@57881


git-svn-id: http://core.svn.wordpress.org/trunk@57382 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-26 09:39:11 +00:00
Peter Wilson 8e5e7a3a11 Editor: Relocate font files uploads to the uploads directory.
Relocate the upload of font files uploaded via the Font Library feature to the `wp-content/uploads/fonts` (or multisite equivalent) directory.

This accounts for immutable file systems in which directories are unable to be created within `wp-content` and deploy processes which require special consideration of the `uploads` directory to ensure it remains persistent between deploys.

Props azaozz, burnuser, cbirdsong, christopherplus, costdev, davidbaumwald, desrosj, elrae, euthelup, get_dave, grantmkin, hellofromtonya, janthiel, jazzs3quence, johnbillion, jorbin, justlevine, kraftner, matveb, mcsf, mmaattiiaass, nico23, peterwilsoncc, priethor, rmccue, samuelsidler, swissspidy, youknowriad.
Fixes #60845.


Built from https://develop.svn.wordpress.org/trunk@57878


git-svn-id: http://core.svn.wordpress.org/trunk@57379 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-26 01:25:11 +00:00
Sergey Biryukov 326bd23fd9 Coding Standards: Use strict comparison in `wp-includes/ms-load.php`.
Follow-up to [12602], [12688], [12896], [27359], [37475].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57877


git-svn-id: http://core.svn.wordpress.org/trunk@57378 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-25 17:19:17 +00:00
Pascal Birchler c7d9fc540e External Libraries: Update the Requests library to version 2.0.11.
This is a maintenance release with two minor fixes to improve PHP 8.4 compatibility.

References:
- [https://github.com/WordPress/Requests/releases/tag/v2.0.11 Requests 2.0.11 release notes]
- [https://github.com/WordPress/Requests/compare/v2.0.9...v2.0.11 Full list of changes in Requests 2.0.11]

Follow-up to [56554], [54997], [55007], [55046], [55225], [55296], [55629].

Props swissspidy, jrf.
Fixes #60838.
Built from https://develop.svn.wordpress.org/trunk@57876


git-svn-id: http://core.svn.wordpress.org/trunk@57377 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-25 12:23:08 +00:00
Sergey Biryukov 6d5d992cf1 Coding Standards: Use strict comparison in `wp-includes/ms-blogs.php`.
Follow-up to [12603], [12948], [13125], [13126], [21480], [21485], [38457], [41625], [43654], [43655], [45794].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57874


git-svn-id: http://core.svn.wordpress.org/trunk@57375 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-24 13:04:16 +00:00
Sergey Biryukov 22d95abc55 Coding Standards: Use strict comparison in `wp-includes/bookmark.php`.
Follow-up to [21], [3570], [3845], [8758].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57873


git-svn-id: http://core.svn.wordpress.org/trunk@57374 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-23 14:20:11 +00:00
Pascal Birchler 807916dd1e Editor: Update the Google Fonts font collection URL to the latest version for 6.5.
Props mmaattiiaass.
Fixes #60819.
Built from https://develop.svn.wordpress.org/trunk@57871


git-svn-id: http://core.svn.wordpress.org/trunk@57372 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-23 09:26:07 +00:00
Pascal Birchler 8b9dfff929 Help/About: Update the About page for 6.5.
Updates the font size for `<code>` tags and updates several translatable strings.

Props sabernhardt, laurlittle, SergeyBiryukov.
See #60303.
Built from https://develop.svn.wordpress.org/trunk@57870


git-svn-id: http://core.svn.wordpress.org/trunk@57371 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-23 09:22:10 +00:00
Peter Wilson 895ea566f6 Editor: Prevent font folder naive filtering causing infinite loops.
This modifies the font directory API to more closely reflect the upload directory API to help account for naive filtering when uploading fonts.

This moves the protection of infinite loops to the new function `_wp_filter_font_directory()` to allow developers extending and maintaining the font library to apply the filter without the need for a closure.

These changes also ensure both the `upload_dir` and `font_dir` filter are applied consistently when both creating and deleting fonts faces. Prior to this commit the `upload_dir` filter was only fired when creating fonts faces via the REST API.

Applying the font directory filter to the `upload_dir` filter is now done by adding the `_wp_filter_font_directory` function rather than `wp_get_font_dir()`. Developers who have previously modified the font upload directory using the `font_dir` filter will NOT need to upload their code.

Extenders wishing to upload files to the font directory can do so via the code:

{{{#!php
<?php
add_filter( 'upload_dir', '_wp_filter_font_directory' );
// Your code to upload or sideload a font file.
remove_filter( 'upload_dir', '_wp_filter_font_directory' );
}}}

Introduces:

* `wp_font_dir()`: Attempt to create and retrieve the font upload directory. The equivalent to `wp_upload_dir()`.
* `_wp_filter_font_directory()`: To run on the `upload_dir` filter, this sets the default destination of the fonts directory and fires the `font_dir` filter. 

`wp_get_font_dir()` has been modified to be a lightweight getter for the font directory. It returns the location without attempting to create it. The equivalent to `wp_get_upload_dir()`.

Follow up to [57740].

Props peterwilsoncc, mukesh27, mikachan, costdev, mmaattiiaass, swissspidy, youknowriad, dd32, grantmkin.
Fixes #60652.

Built from https://develop.svn.wordpress.org/trunk@57868


git-svn-id: http://core.svn.wordpress.org/trunk@57369 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-22 23:01:10 +00:00
Sergey Biryukov d28dd189b8 Coding Standards: Use strict comparison in `wp-includes/link-template.php`.
Follow-up to [4475], [6365], [8706], [9296], [9318], [14141], [15819], [21364], [27802].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57867


git-svn-id: http://core.svn.wordpress.org/trunk@57368 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-22 22:07:11 +00:00
Pascal Birchler 24ad060351 Editor: Check if `mb_strtolower` exists before using it in the font library.
Prevents an error when uploading fonts on certain systems, because the `mbstring` extension can be missing and thus the function may not be available.

Props mujuonly, swissspidy, peterwilsoncc.
Fixes #60823.
See #55603.
Built from https://develop.svn.wordpress.org/trunk@57865


git-svn-id: http://core.svn.wordpress.org/trunk@57366 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-22 14:17:09 +00:00
audrasjb fae0e892b7 I18n: Ensure "Patterns" menu item is translatable.
This changeset updates a translation string to ensure the "Patterns" menu item introduced in [57543] is translatable.
This quickfix simply removes the erroneous `context` parameter so no new string is introduced during WP 6.5 string freeze period. A follow-up changeset will be needed to replace the current `__()` function with `_x()` and put back the `context` parameter.

Follow-up to [57543].

Props jdy68, audrasjb, kebbet, swissspidy.
Fixes #60825.



Built from https://develop.svn.wordpress.org/trunk@57864


git-svn-id: http://core.svn.wordpress.org/trunk@57365 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-22 13:58:14 +00:00
Sergey Biryukov 073bfd5060 Tests: Remove unnecessary use of `utf8_encode()` in KSES tests.
One of the tests for the `wp_kses_xml_named_entities()` function used `utf8_encode( chr( 160 ) )` to set an expectation of a Unicode character for a non-breaking space.

It is understandable that this expectation was previously set this way, as it is not possible for a developer to distinguish between a ''breaking'' space and a ''non-breaking'' space visually, so the chances of the test accidentally breaking on an incorrect save when the plain Unicode character would be used, was high.

However, the `utf8_encode()` function is deprecated as of PHP 8.2, and its use needs to be removed from the WP codebase.

PHP 7.0 has introduced [https://wiki.php.net/rfc/unicode_escape Unicode escape sequences], which allows to create a text string using Unicode characters referenced by their codepoint. By switching the test case to provide the test expectation using a Unicode escape sequence, we remove the use of the deprecated PHP function and still preserve the safeguard against the test accidentally breaking.

Follow-up to [52229].

Props jrf, afercia, poena, SergeyBiryukov.
See #55603, #60705.
Built from https://develop.svn.wordpress.org/trunk@57861


git-svn-id: http://core.svn.wordpress.org/trunk@57362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-21 15:47:16 +00:00
Pascal Birchler d5f0448e78 Coding Standards: Rename the `$postid` parameter to `$post_id` in `has_meta().
Props mujuonly.
Fixes #60810.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57860


git-svn-id: http://core.svn.wordpress.org/trunk@57361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-20 19:07:12 +00:00
Sergey Biryukov 37ce09349a Coding Standards: Use strict comparison in `wp-includes/bookmark-template.php`.
Follow-up to [3880].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57859


git-svn-id: http://core.svn.wordpress.org/trunk@57360 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-20 12:49:10 +00:00
Sergey Biryukov 31039a896f Coding Standards: Rename the remaining `$postid` instances in `wp_delete_post()`.
Follow-up to [57853], [57857].

See #60700.
Built from https://develop.svn.wordpress.org/trunk@57858


git-svn-id: http://core.svn.wordpress.org/trunk@57359 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-19 18:04:15 +00:00
Sergey Biryukov f09287b6e1 Coding Standards: Rename the `$postid` parameter to `$post_id` in `wp_delete_post()`.
This matches the parameter name in `wp_trash_post()` and all the other functions receiving post ID as a parameter.

See #60700.
Built from https://develop.svn.wordpress.org/trunk@57857


git-svn-id: http://core.svn.wordpress.org/trunk@57358 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-19 17:47:10 +00:00
audrasjb 1a0add316f Docs: Update various HelpHub links to avoid unnecessary redirections.
Follow-up to [57793], [57798], [57800], [57801].

Props shailu25.
See #60732, #60699.




Built from https://develop.svn.wordpress.org/trunk@57854


git-svn-id: http://core.svn.wordpress.org/trunk@57355 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-19 14:46:15 +00:00
Pascal Birchler 5cb687dbce Posts, Post Types: Introduce `delete_post_{$post->post_type}` and `deleted_post_{$post->post_type}` hooks.
The hooks fire before the general `delete_post` / `deleted_post` hooks and have the same parameters.

They complement the `save_post_{$post->post_type}` hook added in [25050] and the `edit_post_{$post->post_type}` hook added in [43617].

Props benniledl, swissspidy, dargus.
Fixes #60433.
Built from https://develop.svn.wordpress.org/trunk@57853


git-svn-id: http://core.svn.wordpress.org/trunk@57354 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-19 09:33:11 +00:00
youknowriad 9ed35adffa Editor: Update Packages with the latest bug fixes for 6.5 RC 3
It includes all the backports from this Gutenberg PR https://github.com/WordPress/gutenberg/pull/59949/

Props get_dave, youknowriad.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57851


git-svn-id: http://core.svn.wordpress.org/trunk@57352 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-19 08:07:17 +00:00
Sergey Biryukov cc416fc17b Coding Standards: Use strict comparison in `wp-includes/class-walker-comment.php`.
Follow-up to [8869], [9207], [23694], [47887].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57850


git-svn-id: http://core.svn.wordpress.org/trunk@57351 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-18 15:46:13 +00:00
Pascal Birchler b5ef90af01 Build/Test Tools: Make `WP_Filesystem_Direct` tests more robust.
Follow-up to [57753] to make tests more robust, as there were multiple permission-related errors in the hosting test results.
With this change, the tests now don’t try setting an owner that doesn’t exist.

Props peterwilsoncc, costdev, javiercasares.
See #57774.
Built from https://develop.svn.wordpress.org/trunk@57849


git-svn-id: http://core.svn.wordpress.org/trunk@57350 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-18 09:27:15 +00:00
Sergey Biryukov 4c0984a459 Coding Standards: Use strict comparison in `wp-includes/class-wp-walker.php`.
Follow-up to [6384], [6456], [6858], [8494], [8961].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57848


git-svn-id: http://core.svn.wordpress.org/trunk@57349 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-17 09:56:16 +00:00
Sergey Biryukov a0f10b0742 Coding Standards: Use strict comparison in `wp-includes/class-wp-theme.php`.
Follow-up to [20029], [20119], [20144].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57847


git-svn-id: http://core.svn.wordpress.org/trunk@57348 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-16 13:18:15 +00:00
joedolson c6c7d5080a Media: Fall back to available icons if SVG media icons not found.
Follow up to [57687]. If no icons of the preferred type are available, then the icon array should return the collection of valid icons found, rather than an empty array.

Props sabernhardt, swissspidy, sabernhardt, antpb, joedolson.
Fixes #60740.
Built from https://develop.svn.wordpress.org/trunk@57845


git-svn-id: http://core.svn.wordpress.org/trunk@57346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-15 16:37:11 +00:00
Sergey Biryukov 5a59a56abc Twenty Twenty: Use the `$theme_version` variable for font stylesheet.
This aims to bring more consistency with the other `wp_enqueue_style()` calls in the theme's functions.

Follow-up to [57311].

Props sabernhardt.
Fixes #60779.
Built from https://develop.svn.wordpress.org/trunk@57842


git-svn-id: http://core.svn.wordpress.org/trunk@57343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-15 13:40:12 +00:00
Pascal Birchler bf346251a3 Interactivity API: Do not print state if it’s an empty array.
This prunes stores and configurations that are empty arrays, as stores are expected to be JSON objects.
By not printing empty configurations, less redundant data is serialized into the HTML.

Props jonsurrell, luisherranz, darerodz, gziolo, swissspidy.
Fixes #60761.
Built from https://develop.svn.wordpress.org/trunk@57841


git-svn-id: http://core.svn.wordpress.org/trunk@57342 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-15 12:12:09 +00:00
Pascal Birchler 038465b836 Script Loader: Add new `script_module_loader_src` filter for the script module `src`.
Ensures parity with the `script_loader_src` filter for regular scripts, allowing the URL to be filtered, for example to load them from a CDN or alter query parameters.

Props dd32, peterwilsoncc, westonruter.
Fixes #60742.
Built from https://develop.svn.wordpress.org/trunk@57840


git-svn-id: http://core.svn.wordpress.org/trunk@57341 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-15 11:29:07 +00:00
Pascal Birchler 6e516fe3cc REST API: Prevent error when passing invalid `type` parameter to search endpoint.
In `WP_REST_Search_Controller`, the `type` parameter is accessed via the sanitization callback for the `subtype` parameter, which is too early for `type` itself to be already sanitized. This change adds a type check in the `get_search_handler()` method to prevent errors when the type doesn’t match.

Props swissspidy, timothyblynjacobs, dd32.
Fixes #60771.
Built from https://develop.svn.wordpress.org/trunk@57839


git-svn-id: http://core.svn.wordpress.org/trunk@57340 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-15 11:25:06 +00:00
gziolo 65099c4373 Tests: Fix invalid @covers annotations for Interactivity API
Follow-up [57563], #60356.
Fixes #60757.
Props jonsurrell, cbravobernal, swissspidy.


Built from https://develop.svn.wordpress.org/trunk@57836


git-svn-id: http://core.svn.wordpress.org/trunk@57337 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-15 11:17:11 +00:00
Pascal Birchler 78ea9f4ee6 Interactivity API: Prevent warning when using a bind directive with a short attribute name.
Adds new tests and improves existing ones by using `assertSame` to do type comparison as well.

Props jonsurrell, cbravobernal, swissspidy, gziolo.
Fixes #60758.
Built from https://develop.svn.wordpress.org/trunk@57835


git-svn-id: http://core.svn.wordpress.org/trunk@57336 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-14 15:30:09 +00:00
Sergey Biryukov cca720266b Coding Standards: Use strict comparison in `wp-admin/options-general.php`.
Follow-up to [1632], [12507].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57833


git-svn-id: http://core.svn.wordpress.org/trunk@57334 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-14 14:27:13 +00:00
Pascal Birchler 0a308a97bb Interactivity API: Do not propagate context from void tags to its siblings.
Resolves an issue where context on a void tag element such as `<img>` was incorrectly passed to following elements.
Adds tests.

Props santosguillamot, luisherranz, cbravobernal, dmsnell, gziolo, swissspidy.
Fixes #60768.
Built from https://develop.svn.wordpress.org/trunk@57832


git-svn-id: http://core.svn.wordpress.org/trunk@57333 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-14 13:34:13 +00:00
Pascal Birchler ce8ed7dfa1 I18N: Improve translation file cache group & expiration.
Adds an explicit 1 hour expiration for the translation file cache introduced in [57287] / #58919.
This prevents stale caches when a site does not use the regular way of installing language packs, for example when an atomic filesystem is involved.
Also configures the `translation_files` group as a global cache group on multisite.

Props dd32.
Fixes #60764.
Built from https://develop.svn.wordpress.org/trunk@57831


git-svn-id: http://core.svn.wordpress.org/trunk@57332 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-14 09:05:11 +00:00
Sergey Biryukov a5a961a3f7 Coding Standards: Update the config for `WordPress.PHP.NoSilencedErrors` in PHPCS ruleset.
Includes alphabetizing the third party library exclusions section.

Follow-up to [50810], [51658], [57524].

See #60700.
Built from https://develop.svn.wordpress.org/trunk@57829


git-svn-id: http://core.svn.wordpress.org/trunk@57330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-13 13:20:14 +00:00
Pascal Birchler 44c2d5685a Editor: disable `shadow.defaultPresets` in default `theme.json`.
This is a follow-up to [57717] to ensure that classic themes without a `theme.json` file or without `appearanceTools: true` in `theme.json` do not have shadow controls by default.

Props wildworks, vcanales, madhudollu, swissspidy, youknowriad.
Fixes #60633
Built from https://develop.svn.wordpress.org/trunk@57827


git-svn-id: http://core.svn.wordpress.org/trunk@57328 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-13 11:12:16 +00:00
Pascal Birchler 858da6cbc5 Interactivity API: Increase hook priority for processing directives.
Use a priority of 100 to ensure that other filters can add additional directives before the processing starts.
This way, directives will be processed even if the `$parsed_block` variable is edited by a filter.

Props cbravobernal, swissspidy, flixos90, joemcgill, gziolo.
Fixes #60743.
Built from https://develop.svn.wordpress.org/trunk@57826


git-svn-id: http://core.svn.wordpress.org/trunk@57327 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-13 10:48:11 +00:00
Pascal Birchler 9958729416 Interactivity API: Do not process directives when there aren’t any.
Short-circuits directive processing when the markup does not actually contain any `data-wp-*` attributes.
This reduces function calls and memory usage for the best case scenario due to not involving `WP_HTML_Tag_Processor`.

Props joemcgill, swissspidy, gziolo, cbravobernal, flixos90.
Fixes #60749.
Built from https://develop.svn.wordpress.org/trunk@57824


git-svn-id: http://core.svn.wordpress.org/trunk@57325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-13 10:41:14 +00:00
dmsnell 61de23a489 Interactivity API: Ensure proper directive processing on special elements.
Adds a test to ensure proper processing of directives on special HTML elements,
or HTML which contains special elements. These special elements are defined by
the HTML API and are the HTML elements which cannot contain other tags, such as
the IFRAME, SCRIPT, TEXTAREA, TITLE, elements, etc...

The server diretive processor performs a custom tracking of HTML structure and
this test ensures it isn't mislead by the handling of those special elements.

Developed in https://github.com/WordPress/wordpress-develop/pull/6247
Discussed in https://core.trac.wordpress.org/ticket/60746

Props santosguillamot, cbravobernal, mukesh27, westonruter, swissspidy, dmsnell.
Follow-up to [57348].
Fixes #60746.


Built from https://develop.svn.wordpress.org/trunk@57822


git-svn-id: http://core.svn.wordpress.org/trunk@57323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-12 18:54:17 +00:00
Pascal Birchler 078e6390a5 Help/About: Update the About page for WP 6.5 RC2.
Updates a translatable string to use a placeholder for the “Requires Plugins” string used in it.

Props swissspidy, sergeybiryukov, presskopp.
See #60303.
Built from https://develop.svn.wordpress.org/trunk@57817


git-svn-id: http://core.svn.wordpress.org/trunk@57318 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-12 14:45:15 +00:00
youknowriad 8a7d013dfd Editor: Update Packages with the latest bug fixes for 6.5 RC 2
It includes all the backports from this Gutenberg PR https://github.com/WordPress/gutenberg/pull/59756/

Props get_dave, swissspidy, bernhard-reiter, youknowriad.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57814


git-svn-id: http://core.svn.wordpress.org/trunk@57315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-12 14:08:24 +00:00
Sergey Biryukov 18050c7ffa Coding Standards: Use strict comparison in `WP_Image_Editor_GD::_save()`.
Follow-up to [50810], [57524].

Props pbearne, mukesh27.
Fixes #60643.
Built from https://develop.svn.wordpress.org/trunk@57811


git-svn-id: http://core.svn.wordpress.org/trunk@57312 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-12 11:49:15 +00:00
audrasjb 2ef60cc432 Help/About: Update the About page for WP 6.5 RC2.
This changeset removes the "Pattern overrides" section from features.
Also updates the field guide link, this link should redirect correctly once the post is published.

Follow-up to [57715], [57767].

Props ryelle, benjamin_zekavica.
See #60303.




Built from https://develop.svn.wordpress.org/trunk@57809


git-svn-id: http://core.svn.wordpress.org/trunk@57310 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-12 10:37:11 +00:00
dmsnell 62514c6081 HTML API: Add tests ensuring text nodes reconstruct active formatting elements.
Adds tests that should have been merged in [57806].

Follow-up to: [57806].


Built from https://develop.svn.wordpress.org/trunk@57807


git-svn-id: http://core.svn.wordpress.org/trunk@57308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-12 00:26:08 +00:00
dmsnell 6badd91e7b HTML API: Trigger active format reconstruction when reaching text nodes.
When encountering text nodes in an HTML document, the HTML parser needs
to run the active format reconstruction algorithm, even if it doesn't
stop to visit those text nodes. This is because the formats, which might
need reconstructing, will impact the breadcrumbs of all downstream nodes
from the text node.

In this patch, this process is triggered, which properly triggers the
active format reconstruction. It also enables the visiting of other token
types as is possible in the Tag Processor.

Developed in https://github.com/WordPress/wordpress-develop/pull/6054
Discussed in https://core.trac.wordpress.org/ticket/60170

Props: dmsnell, jonsurrell, westonruter.
Fixes: #60455.
Follow-up to: [57348].


Built from https://develop.svn.wordpress.org/trunk@57806


git-svn-id: http://core.svn.wordpress.org/trunk@57307 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-12 00:24:09 +00:00
dmsnell 6961426665 HTML API: Defer applying attribute updates until necessary.
When making repeated updates to a document, the Tag Processor will end
up copying the entire document once for every update. This can lead to
catastrophic behavior in the worse case.

However, when batch-applying updates it's able to copy chunks of the
document in one thread and only end up copying the entire document once
for the entire batch.

Previously the Tag Processor has been eagerly applying udpates, but in
this patch it defers applying those updates as long as is possible.

Developed in https://github.com/WordPress/wordpress-develop/pull/6120
Discussed in https://core.trac.wordpress.org/ticket/60697

Props: dmsnell, bernhard-reiter, jonsurrell, westonruter.
Fixes #60697.
Follow-up to [55706], [56941], [57348].


Built from https://develop.svn.wordpress.org/trunk@57805


git-svn-id: http://core.svn.wordpress.org/trunk@57306 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-11 23:55:09 +00:00
Peter Wilson 2d45435a7a REST API: Remove unnecessary upload overrides in font face controller.
This removes settings that are the default value or required for side-loading from the `WP_REST_Font_Faces_Controller::handle_font_file_upload()`. 

This is to harden the endpoint and future proof against any changes to `wp_handle_upload()` and related functions/security checks.

Props peterwilsoncc, dd32.
Fixes #60741.


Built from https://develop.svn.wordpress.org/trunk@57804


git-svn-id: http://core.svn.wordpress.org/trunk@57305 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-11 23:16:12 +00:00
audrasjb 5cdfecb35e Docs: Update various HelpHub links to avoid unnecessary redirections.
Follow-up to [57793], [57798], [57800].

Props mkismy.
See #60732, #60699.




Built from https://develop.svn.wordpress.org/trunk@57801


git-svn-id: http://core.svn.wordpress.org/trunk@57302 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-11 14:08:10 +00:00
audrasjb cfe6f501e2 Docs: Update various HelpHub links located in bundled themes to avoid unnecessary redirections.
Props mkismy.
See #60732, #60699.




Built from https://develop.svn.wordpress.org/trunk@57800


git-svn-id: http://core.svn.wordpress.org/trunk@57301 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-11 14:00:12 +00:00
Bernhard Reiter 671f1df1f7 Block Hooks: Remove filter global reset from test teardown.
Resetting the `$wp_current_filter` global during test teardown is unnecessary, as it is taken care of by the unit test's base class.

This changeset removes the reset accordingly.

Follow-up [57790].
Props swissspidy, timothyblynjacobs.
See #60671.
Built from https://develop.svn.wordpress.org/trunk@57799


git-svn-id: http://core.svn.wordpress.org/trunk@57300 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-11 12:54:15 +00:00
Sergey Biryukov 06615abcf7 Docs: Update the link to the “Editing wp-config.php” article in `wp-load.php`.
Follow-up to [57793].

Props fanly, shailu25.
See #60738, #60732.
Built from https://develop.svn.wordpress.org/trunk@57798


git-svn-id: http://core.svn.wordpress.org/trunk@57299 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-11 10:05:15 +00:00
Sergey Biryukov 42cb55d4c5 Docs: Update the link to the WordPress Feeds article on Reading Settings screen.
Follow-up to [57793].

Props ignatiusjeroe, sabernhardt, shailu25.
Fixes #60736. See #60732.
Built from https://develop.svn.wordpress.org/trunk@57797


git-svn-id: http://core.svn.wordpress.org/trunk@57298 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-10 16:20:14 +00:00
Sergey Biryukov b47a138372 Upload: Move an assignment in `wp-admin/upload.php` into a conditional branch.
This is a micro-optimization to reduce unnecessary memory allocation.

Follow-up to [28682].

Props mujuonly, swissspidy, mukesh27.
Fixes #60683.
Built from https://develop.svn.wordpress.org/trunk@57796


git-svn-id: http://core.svn.wordpress.org/trunk@57297 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-09 18:07:15 +00:00
desrosj 1c0a2b300c Build/Test Tools: Do not run Props Bot for certain actions from forks.
For PRs that originate from forked repositories, `pull_request_review` and `pull_request_review_comment` events do not have the permissions necessary to comment on the PR.

This avoids needlessly running the bot when these conditions are met.

Props jorbin, wildworks.
See #60733.
Built from https://develop.svn.wordpress.org/trunk@57795


git-svn-id: http://core.svn.wordpress.org/trunk@57296 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-09 01:09:13 +00:00
audrasjb 7ae05b7753 Coding Standards: Fix a WPCS indentation issue found in `wp-admin/options-general.php` after [57793].
See #60732.




Built from https://develop.svn.wordpress.org/trunk@57794


git-svn-id: http://core.svn.wordpress.org/trunk@57295 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-08 22:44:11 +00:00
audrasjb fc2935aa80 Docs: Update various HelpHub links to avoid unnecessary redirections.
This updates various WP-Admin related links that have been redirected to new HelpHub pages, to avoid unnecessary redirections.

Props mkismy.
See #60732, #60699.




Built from https://develop.svn.wordpress.org/trunk@57793


git-svn-id: http://core.svn.wordpress.org/trunk@57294 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-08 22:38:08 +00:00
audrasjb b724c7ce03 Toolbar: Fix dropdown admin menu styles on front-end.
This changeset switches back the admin menu items `height` property to `px` unit to prevent issues with themes using `html { font-size: 62.5%; }`.

Follow-up to [57765].

Props bgnicolepaschen, sabernhardt, huzaifaalmesbah, ironprogrammer, shailu25.
Fixes #60707.
See #43633.




Built from https://develop.svn.wordpress.org/trunk@57792


git-svn-id: http://core.svn.wordpress.org/trunk@57293 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-08 22:11:12 +00:00
Sergey Biryukov 1cd07a318a Plugins: Remove extra space in a translatable string.
Follow-up to [57545].

Props Presskopp.
Fixes #60730.
Built from https://develop.svn.wordpress.org/trunk@57791


git-svn-id: http://core.svn.wordpress.org/trunk@57292 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-08 14:34:11 +00:00
Bernhard Reiter 8648d06284 Block Hooks: Use new Templates Controller filter instead of action.
This changeset adds a new `rest_pre_insert_{$this->post_type}` filter in the `WP_REST_Templates_Controller`, where it is applied to the return value of the `prepare_item_for_database` method. (This is consistent with the `WP_REST_Post_Controller`, where that filter has existed before.)

The new filter is then used to inject hooked blocks into the template (or template part) content received via the endpoint, prior to persisting it to the database.

This supersedes the previous mechanism, which was using the `rest_after_insert_{$this->post_type}` ''action'', from which it performed an additional `wp_update_post` call to update the template (part) content with the hooked blocks injected. The new technique eschews that additional call and the resulting extra revision it created, as well as a problem with regard to duplicated escaping and sanitization, which had caused some special characters to be garbled.

Props tomjcafferkey, gziolo, swissspidy, karolmanijak.
Fixes #60671.
Built from https://develop.svn.wordpress.org/trunk@57790


git-svn-id: http://core.svn.wordpress.org/trunk@57291 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-07 14:12:11 +00:00
Adam Silverstein 3c6a55d3f9 Script loader: enable fetchpriority attribute in the `wp_preload_resources` filter.
Add `fetchpriority` to the attributes accepted by the `wp_preload_resources` filter. Developers can now use this filter to set fetchpriority for resources being preloaded.

Props nihar007, luboslives, tabrisrp.
Fixes #58510.


Built from https://develop.svn.wordpress.org/trunk@57789


git-svn-id: http://core.svn.wordpress.org/trunk@57290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-07 07:08:09 +00:00
Pascal Birchler 175bea53b7 Build/Test Tools: Fix typo in `variation-new-font-family.json` fixture file.
Props huzaifaalmesbah, mukesh27.
Fixes #60712.
Built from https://develop.svn.wordpress.org/trunk@57788


git-svn-id: http://core.svn.wordpress.org/trunk@57289 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-07 06:27:10 +00:00
Sergey Biryukov 3a16fb0695 Docs: Add a description for the `$table_prefix` global.
Follow-up to [57748].

See #60699.
Built from https://develop.svn.wordpress.org/trunk@57787


git-svn-id: http://core.svn.wordpress.org/trunk@57288 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-07 06:11:11 +00:00
desrosj 316d1efa23 Upload: Add links back to installer pages.
This adds a link back to the plugin or theme installers when an incompatible archive error message is encountered.

Props Presskopp, swissspidy, smub, pmbaldha, aneeshd16.
Fixes #60578.
Built from https://develop.svn.wordpress.org/trunk@57786


git-svn-id: http://core.svn.wordpress.org/trunk@57287 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-07 05:58:15 +00:00
Sergey Biryukov 4d6941a48b Docs: Add a description for the `$wp_embed` global.
Follow-up to [57748].

See #60699.
Built from https://develop.svn.wordpress.org/trunk@57785


git-svn-id: http://core.svn.wordpress.org/trunk@57286 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-06 05:05:12 +00:00
desrosj 134d366e8b Build/Test Tools: Bump version of `trunk` in the `package-lock.json` file.
Follow up to [57782].
Built from https://develop.svn.wordpress.org/trunk@57784


git-svn-id: http://core.svn.wordpress.org/trunk@57285 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-06 00:57:08 +00:00
desrosj 88d4ac2aec Build/Test Tools: Add build process test workflow to old branches testing.
Now that 6.5 has been branched, the `test-build-processes.yml` workflow can be added to the list of workflows to run for old branches.

Fixes #59632.
Built from https://develop.svn.wordpress.org/trunk@57783


git-svn-id: http://core.svn.wordpress.org/trunk@57284 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-06 00:34:12 +00:00
394 changed files with 4984 additions and 2601 deletions

View File

@ -47,17 +47,17 @@
</ol>
<h2>Migrating from other systems</h2>
<p>WordPress can <a href="https://wordpress.org/documentation/article/importing-content/">import from a number of systems</a>. First you need to get WordPress installed and working as described above, before using <a href="wp-admin/import.php">our import tools</a>.</p>
<p>WordPress can <a href="https://developer.wordpress.org/advanced-administration/wordpress/import/">import from a number of systems</a>. First you need to get WordPress installed and working as described above, before using <a href="wp-admin/import.php">our import tools</a>.</p>
<h2>System Requirements</h2>
<ul>
<li><a href="https://secure.php.net/">PHP</a> version <strong>7.0</strong> or greater.</li>
<li><a href="https://www.php.net/">PHP</a> version <strong>7.2.24</strong> or greater.</li>
<li><a href="https://www.mysql.com/">MySQL</a> version <strong>5.5.5</strong> or greater.</li>
</ul>
<h3>Recommendations</h3>
<ul>
<li><a href="https://secure.php.net/">PHP</a> version <strong>7.4</strong> or greater.</li>
<li><a href="https://www.php.net/">PHP</a> version <strong>7.4</strong> or greater.</li>
<li><a href="https://www.mysql.com/">MySQL</a> version <strong>8.0</strong> or greater OR <a href="https://mariadb.org/">MariaDB</a> version <strong>10.4</strong> or greater.</li>
<li>The <a href="https://httpd.apache.org/docs/2.2/mod/mod_rewrite.html">mod_rewrite</a> Apache module.</li>
<li><a href="https://wordpress.org/news/2016/12/moving-toward-ssl/">HTTPS</a> support.</li>

View File

@ -66,34 +66,22 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
</div>
<div class="column is-vertically-aligned-center">
<h3><?php _e( 'Add and manage fonts across your site' ); ?></h3>
<p><?php _e( 'The new Font Library puts you in control of an essential piece of your site&#8217;s design—typography—without coding or extra steps. Effortlessly install, remove, and activate local and Google Fonts across your site regardless of your active theme. The ability to include custom typography collections gives site creators and publishers even more choice.' ); ?></p>
<p><?php _e( 'The new Font Library puts you in control of an essential piece of your site&#8217;s design—typography—without coding or extra steps. Effortlessly install, remove, and activate local and Google Fonts across your site for any block theme. The ability to include custom typography collections gives site creators and publishers even more choice.' ); ?></p>
</div>
</div>
<div class="about__section has-2-columns">
<div class="column is-vertically-aligned-center">
<h3><?php _e( 'Override specific content in synced patterns' ); ?></h3>
<p><?php _e( 'Keep your design consistent while bringing more flexibility to the content within. Choose to override content for Paragraph, Image, Heading, and Button blocks and make specified changes in each instance of a synced pattern. Use it for templated pieces with recurring elements to frame unique content, like recipes, testimonials, or case studies. You can expect more blocks to gain this option in future releases.' ); ?></p>
<h3><?php _e( 'Get more details from your style revisions' ); ?></h3>
<p><?php _e( 'Work through creative projects with a more comprehensive picture of what&#8217;s been done—and what you can fall back on. Get details like time stamps, quick summaries, and a paginated list of total revisions. View revisions from the Style Book to see changes outside of what you&#8217;re working on. Revisions are also now available for templates and template parts.' ); ?></p>
</div>
<div class="column is-vertically-aligned-center">
<div class="about__image">
<img src="https://s.w.org/images/core/6.5/2-patterns-override-content.webp" alt="" height="436" width="436" />
</div>
</div>
</div>
<div class="about__section has-2-columns">
<div class="column is-vertically-aligned-center">
<div class="about__image">
<img src="https://s.w.org/images/core/6.5/3-style-revisions.webp" alt="" height="436" width="436" />
</div>
</div>
<div class="column is-vertically-aligned-center">
<h3><?php _e( 'Get more details from your style revisions' ); ?></h3>
<p><?php _e( 'Work through creative projects with a more comprehensive picture of what&#8217;s been done—and what you can fall back on. Get details like time stamps, quick summaries, and a paginated list of total revisions. View revisions from the Style Book to see changes outside of what you&#8217;re working on. Revisions are also now available for templates and template parts.' ); ?></p>
</div>
</div>
<div class="about__section has-3-columns">
<div class="column">
<div class="about__image">
@ -124,7 +112,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
<img src="https://s.w.org/images/core/6.5/7-data-views.webp" alt="" height="270" width="270" />
</div>
<h3 class="is-smaller-heading" style="margin-bottom:calc(var(--gap) / 4);"><?php _e( 'Discover new Data Views' ); ?></h3>
<p><?php _e( 'Make fast, informed changes with data views for pages, templates, patterns, and template parts. Arrange data in a table or grid view and enjoy a new UI for toggling fields and making bulk changes.' ); ?></p>
<p><?php _e( 'Find and organize your data however you like with data views for pages, templates, patterns, and template parts. Arrange it in a table or grid view with the option to toggle fields and make bulk changes.' ); ?></p>
</div>
<div class="column">
<div class="about__image">
@ -187,7 +175,15 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
</svg>
</div>
<h3 style="margin-top:calc(var(--gap) * 0.75);margin-bottom:calc(var(--gap) * 0.5)"><?php _e( 'Explore improvements to the plugin experience' ); ?></h3>
<p><?php _e( 'There&#8217;s now an easier way to manage plugin dependencies. Plugin authors can supply a new <code>Requires Plugins</code> header with a comma-separated list of required plugin slugs, presenting users with links to install and activate those plugins first.' ); ?></p>
<p>
<?php
printf(
/* translators: %s: Requires Plugins */
__( 'There&#8217;s now an easier way to manage plugin dependencies. Plugin authors can supply a new %s header with a comma-separated list of required plugin slugs, presenting users with links to install and activate those plugins first.' ),
'<code lang="en">Requires Plugins</code>'
);
?>
</p>
</div>
</div>
@ -204,7 +200,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
</svg>
</div>
<h3 style="margin-top:calc(var(--gap) * 0.75);margin-bottom:calc(var(--gap) * 0.5)"><?php _e( 'Performance updates' ); ?></h3>
<p><?php _e( 'This release includes 110+ performance updates, with an impressive increase in speed and efficiency across the Post Editor and Site Editor. Loading, input processing, and Site Editor navigation each see an increase in speed between two to six times faster than before. Translated sites see up to 25% improvement in load time for this release.' ); ?></p>
<p><?php _e( 'This release includes 110+ performance updates, with an impressive increase in speed and efficiency across the Post Editor and Site Editor. Loading is over two times faster than in 6.4, with input processing speed up to five times faster than the previous release. Translated sites see up to 25% improvement in load time for this release.' ); ?></p>
</div>
<div class="column">
<div class="about__image">
@ -260,7 +256,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
printf(
/* translators: 1: WordPress Field Guide link, 2: WordPress version number. */
__( 'Explore the <a href="%1$s">WordPress %2$s Field Guide</a>. Learn about the changes in this release with detailed developer notes to help you build with WordPress.' ),
( '#' ),
esc_url( __( 'https://make.wordpress.org/core/wordpress-6-5-field-guide/' ) ),
'6.5'
);
?>

View File

@ -29,7 +29,7 @@ nocache_headers();
/** This action is documented in wp-admin/admin.php */
do_action( 'admin_init' );
$action = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';
$action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : '';
// Reject invalid parameters.
if ( ! is_scalar( $action ) ) {

View File

@ -16,7 +16,8 @@ $submenu_file = 'edit-comments.php';
* @global string $action
*/
global $action;
wp_reset_vars( array( 'action' ) );
$action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : '';
if ( isset( $_POST['deletecomment'] ) ) {
$action = 'deletecomment';

View File

@ -514,6 +514,10 @@
display: none !important;
}
.about__container code {
font-size: inherit;
}
.about__section {
font-size: 1.125rem;
line-height: 1.55;
@ -582,7 +586,7 @@
.privacy-php .about__header-title h1,
.contribute-php .about__header-title h1 {
/* Fluid font size scales on browser size 960px - 1200px. */
font-size: clamp(2rem, 10vw - 3rem, 4rem);
font-size: clamp(2rem, 20vw - 9rem, 4rem);
}
.about__header-text {
@ -652,7 +656,7 @@
.privacy-php .about__header-title h1,
.contribute-php .about__header-title h1 {
/* Fluid font size scales on browser size 600px - 960px. */
font-size: clamp(3rem, 6.67vw - 0.5rem, 4.5rem);
font-size: clamp(2rem, 20vw - 9rem, 4rem);
}
.about__header-navigation .nav-tab {
@ -1277,24 +1281,6 @@
margin: 0.6em 0;
}
.freedoms-php .column .freedoms-image {
background-image: url('../images/freedoms.png');
background-size: 100%;
padding-top: 100%;
}
.freedoms-php .column:nth-of-type(2) .freedoms-image {
background-position: 100% 34%;
}
.freedoms-php .column:nth-of-type(3) .freedoms-image {
background-position: 100% 66%;
}
.freedoms-php .column:nth-of-type(4) .freedoms-image {
background-position: 100% 100%;
}
/*------------------------------------------------------------------------------
x.5.0 - Legacy About Styles: Media Queries
------------------------------------------------------------------------------*/

File diff suppressed because one or more lines are too long

View File

@ -513,6 +513,10 @@
display: none !important;
}
.about__container code {
font-size: inherit;
}
.about__section {
font-size: 1.125rem;
line-height: 1.55;
@ -581,7 +585,7 @@
.privacy-php .about__header-title h1,
.contribute-php .about__header-title h1 {
/* Fluid font size scales on browser size 960px - 1200px. */
font-size: clamp(2rem, 10vw - 3rem, 4rem);
font-size: clamp(2rem, 20vw - 9rem, 4rem);
}
.about__header-text {
@ -651,7 +655,7 @@
.privacy-php .about__header-title h1,
.contribute-php .about__header-title h1 {
/* Fluid font size scales on browser size 600px - 960px. */
font-size: clamp(3rem, 6.67vw - 0.5rem, 4.5rem);
font-size: clamp(2rem, 20vw - 9rem, 4rem);
}
.about__header-navigation .nav-tab {
@ -1276,24 +1280,6 @@
margin: 0.6em 0;
}
.freedoms-php .column .freedoms-image {
background-image: url('../images/freedoms.png');
background-size: 100%;
padding-top: 100%;
}
.freedoms-php .column:nth-of-type(2) .freedoms-image {
background-position: 0 34%;
}
.freedoms-php .column:nth-of-type(3) .freedoms-image {
background-position: 0 66%;
}
.freedoms-php .column:nth-of-type(4) .freedoms-image {
background-position: 0 100%;
}
/*------------------------------------------------------------------------------
x.5.0 - Legacy About Styles: Media Queries
------------------------------------------------------------------------------*/

File diff suppressed because one or more lines are too long

View File

@ -1091,7 +1091,9 @@ th.action-links {
.wp-filter .search-form {
float: left;
margin: 10px 0;
display: flex;
align-items: center;
column-gap: .5rem;
}
.wp-filter .search-form input[type="search"] {
@ -1120,7 +1122,6 @@ th.action-links {
.wp-filter .search-form.search-plugins .wp-filter-search,
.no-js .wp-filter .search-form.search-plugins .button {
display: inline-block;
margin-top: 10px;
vertical-align: top;
}
@ -1361,6 +1362,11 @@ th.action-links {
position: relative;
max-width: 100%;
}
.wp-filter .search-form {
margin: 11px 0;
flex-wrap: wrap;
row-gap: 10px;
}
}
@media only screen and (max-width: 782px) {
@ -1514,6 +1520,25 @@ div.error {
margin-top: -5px;
}
#plugin-information-footer #plugin-activated-successfully {
margin-bottom: 0;
}
#plugin-information-footer #plugin-activated-successfully p {
display: flex;
gap: 1em;
align-items: center;
justify-content: space-between;
margin: 0;
}
#plugin-information-footer #plugin-activated-successfully .refresh-page {
flex-grow: 0;
line-height: 2.15384615;
min-height: 0;
margin-bottom: 0;
}
.update-message p:before,
.updating-message p:before,
.updated-message p:before,
@ -4133,7 +4158,6 @@ img {
}
.wp-filter .search-form input[type="search"] {
width: 100%;
font-size: 1rem;
}
@ -4187,6 +4211,10 @@ img {
.nav-tab-active:focus:active {
border-bottom: 1px solid #c3c4c7;
}
.wp-filter .search-form.search-plugins label {
width: 100%;
}
}
@media screen and (max-width: 480px) {

File diff suppressed because one or more lines are too long

View File

@ -1090,7 +1090,9 @@ th.action-links {
.wp-filter .search-form {
float: right;
margin: 10px 0;
display: flex;
align-items: center;
column-gap: .5rem;
}
.wp-filter .search-form input[type="search"] {
@ -1119,7 +1121,6 @@ th.action-links {
.wp-filter .search-form.search-plugins .wp-filter-search,
.no-js .wp-filter .search-form.search-plugins .button {
display: inline-block;
margin-top: 10px;
vertical-align: top;
}
@ -1360,6 +1361,11 @@ th.action-links {
position: relative;
max-width: 100%;
}
.wp-filter .search-form {
margin: 11px 0;
flex-wrap: wrap;
row-gap: 10px;
}
}
@media only screen and (max-width: 782px) {
@ -1513,6 +1519,25 @@ div.error {
margin-top: -5px;
}
#plugin-information-footer #plugin-activated-successfully {
margin-bottom: 0;
}
#plugin-information-footer #plugin-activated-successfully p {
display: flex;
gap: 1em;
align-items: center;
justify-content: space-between;
margin: 0;
}
#plugin-information-footer #plugin-activated-successfully .refresh-page {
flex-grow: 0;
line-height: 2.15384615;
min-height: 0;
margin-bottom: 0;
}
.update-message p:before,
.updating-message p:before,
.updated-message p:before,
@ -4132,7 +4157,6 @@ img {
}
.wp-filter .search-form input[type="search"] {
width: 100%;
font-size: 1rem;
}
@ -4186,6 +4210,10 @@ img {
.nav-tab-active:focus:active {
border-bottom: 1px solid #c3c4c7;
}
.wp-filter .search-form.search-plugins label {
width: 100%;
}
}
@media screen and (max-width: 480px) {

File diff suppressed because one or more lines are too long

View File

@ -1083,14 +1083,24 @@ p.customize-section-description {
float: right;
}
#available-menu-items .accordion-section-content .new-content-item,
.customize-control-dropdown-pages .new-content-item {
#available-menu-items .accordion-section-content .new-content-item-wrapper,
.customize-control-dropdown-pages .new-content-item-wrapper {
width: calc(100% - 30px);
padding: 8px 15px;
position: absolute;
bottom: 0;
z-index: 10;
background: #f0f0f1;
}
.customize-control-dropdown-pages .new-content-item-wrapper {
width: 100%;
padding: 0;
position: static;
}
#available-menu-items .accordion-section-content .new-content-item,
.customize-control-dropdown-pages .new-content-item {
display: flex;
}
@ -1100,6 +1110,14 @@ p.customize-section-description {
position: relative;
}
.customize-control-dropdown-pages .new-content-item-wrapper .new-content-item {
padding: 0;
}
.customize-control-dropdown-pages .new-content-item-wrapper .new-content-item label {
line-height: 1.6;
}
#available-menu-items .new-content-item .create-item-input,
.customize-control-dropdown-pages .new-content-item .create-item-input {
flex-grow: 10;
@ -1816,11 +1834,6 @@ p.customize-section-description {
bottom: 0;
}
.themes-filter-bar .feature-filter-toggle {
float: left;
margin: 3px 25px 3px 0;
}
.themes-filter-bar .feature-filter-toggle:before {
content: "\f111";
margin: 0 0 0 5px;
@ -1881,12 +1894,6 @@ p.customize-section-description {
animation: .6s themes-fade-in 1;
}
.control-panel-themes .filter-themes-count {
position: relative;
float: left;
line-height: 2.6;
}
.control-panel-themes .filter-themes-count .themes-displayed {
font-weight: 600;
color: #50575e;
@ -2098,6 +2105,28 @@ p.customize-section-description {
box-sizing: border-box;
border-bottom: 1px solid #dcdcde;
}
.customize-preview-header.themes-filter-bar,
.customize-preview-header.themes-filter-bar .search-form {
display: flex;
align-items: center;
gap: 10px;
flex-wrap: wrap;
}
.customize-preview-header.themes-filter-bar .search-form-input {
position: relative;
}
.customize-preview-header .filter-themes-wrapper {
display: grid;
align-items: center;
gap: 10px;
grid-template-columns: auto 1fr;
}
.customize-preview-header .filter-themes-wrapper .filter-themes-count {
justify-self: end;
}
@media screen and (min-width: 1670px) {
.customize-preview-header.themes-filter-bar {
@ -2110,6 +2139,9 @@ p.customize-section-description {
.themes-filter-bar .themes-filter-container {
margin: 0;
padding: 0;
display: flex;
align-items: center;
gap: 10px;
}
.themes-filter-bar .wp-filter-search {
@ -2118,11 +2150,10 @@ p.customize-section-description {
max-width: 100%;
width: 40%;
min-width: 300px;
position: absolute;
top: 6px;
right: 25px;
height: 32px;
margin: 1px 0;
top: 0;
right: 0;
}
/* Unstick the filter bar on short windows/screens. This breakpoint is based on the
@ -2156,18 +2187,31 @@ p.customize-section-description {
}
}
@media screen and (max-width: 900px) {
@media screen and (max-width: 960px) {
.customize-preview-header.themes-filter-bar {
height: 86px;
padding-top: 46px;
height: 96px;
}
}
@media screen and (max-width: 900px) {
.themes-filter-bar .wp-filter-search {
width: calc(100% - 50px);
width: 100%;
margin: 0;
min-width: 200px;
}
.customize-preview-header.themes-filter-bar,
.customize-preview-header.themes-filter-bar .search-form
.themes-filter-bar .themes-filter-container {
display: grid;
gap: 4px;
}
.customize-preview-header.themes-filter-bar .search-form-input {
display: flex;
flex-grow: 1;
}
.filter-drawer {
top: 86px;
}
@ -2581,7 +2625,7 @@ body.adding-widget .add-new-widget:before,
}
#available-widgets-list {
top: 60px;
top: 82px;
position: absolute;
overflow: auto;
bottom: 0;
@ -2625,7 +2669,7 @@ body.adding-widget .add-new-widget:before,
#available-widgets-filter .search-icon {
display: block;
position: absolute;
top: 15px; /* 13 container padding +1 input margin +1 input border */
bottom: 15px; /* 13 container padding +1 input margin +1 input border */
right: 16px;
width: 30px;
height: 30px;
@ -2635,9 +2679,9 @@ body.adding-widget .add-new-widget:before,
}
#available-widgets-filter .clear-results,
#available-menu-items-search .clear-results {
#available-menu-items-search .accordion-section-title .clear-results {
position: absolute;
top: 15px; /* 13 container padding +1 input margin +1 input border */
top: 36px; /* 13 container padding +1 input margin +1 input border */
left: 16px;
width: 30px;
height: 30px;
@ -2696,8 +2740,8 @@ body.adding-widget .add-new-widget:before,
.themes-filter-bar .search-icon {
position: absolute;
top: 7px;
right: 26px;
top: 2px;
right: 2px;
z-index: 1;
color: #646970;
height: 30px;
@ -2815,8 +2859,8 @@ body.adding-widget .add-new-widget:before,
margin-top: 12px;
}
.wp-core-ui .themes-filter-bar .feature-filter-toggle {
margin: 3px 25px 3px 0;
.customize-preview-header.themes-filter-bar .search-icon {
top: 6px;
}
}
@ -2953,22 +2997,18 @@ body.adding-widget .add-new-widget:before,
}
#available-widgets-list {
top: 130px;
top: 152px;
}
#available-menu-items-search .clear-results,
#available-menu-items-search .search-icon {
top: 85px; /* 70 section title height + 13 container padding +1 input margin +1 input border */
#available-menu-items-search .clear-results {
top: 36px;
left: 16px;
}
.reorder,
.reordering .reorder-done {
padding: 8px;
}
.wp-core-ui .themes-filter-bar .feature-filter-toggle {
margin: 0;
}
}
@media screen and (max-width: 600px) {

File diff suppressed because one or more lines are too long

View File

@ -1082,14 +1082,24 @@ p.customize-section-description {
float: left;
}
#available-menu-items .accordion-section-content .new-content-item,
.customize-control-dropdown-pages .new-content-item {
#available-menu-items .accordion-section-content .new-content-item-wrapper,
.customize-control-dropdown-pages .new-content-item-wrapper {
width: calc(100% - 30px);
padding: 8px 15px;
position: absolute;
bottom: 0;
z-index: 10;
background: #f0f0f1;
}
.customize-control-dropdown-pages .new-content-item-wrapper {
width: 100%;
padding: 0;
position: static;
}
#available-menu-items .accordion-section-content .new-content-item,
.customize-control-dropdown-pages .new-content-item {
display: flex;
}
@ -1099,6 +1109,14 @@ p.customize-section-description {
position: relative;
}
.customize-control-dropdown-pages .new-content-item-wrapper .new-content-item {
padding: 0;
}
.customize-control-dropdown-pages .new-content-item-wrapper .new-content-item label {
line-height: 1.6;
}
#available-menu-items .new-content-item .create-item-input,
.customize-control-dropdown-pages .new-content-item .create-item-input {
flex-grow: 10;
@ -1815,11 +1833,6 @@ p.customize-section-description {
bottom: 0;
}
.themes-filter-bar .feature-filter-toggle {
float: right;
margin: 3px 0 3px 25px;
}
.themes-filter-bar .feature-filter-toggle:before {
content: "\f111";
margin: 0 5px 0 0;
@ -1880,12 +1893,6 @@ p.customize-section-description {
animation: .6s themes-fade-in 1;
}
.control-panel-themes .filter-themes-count {
position: relative;
float: right;
line-height: 2.6;
}
.control-panel-themes .filter-themes-count .themes-displayed {
font-weight: 600;
color: #50575e;
@ -2097,6 +2104,28 @@ p.customize-section-description {
box-sizing: border-box;
border-bottom: 1px solid #dcdcde;
}
.customize-preview-header.themes-filter-bar,
.customize-preview-header.themes-filter-bar .search-form {
display: flex;
align-items: center;
gap: 10px;
flex-wrap: wrap;
}
.customize-preview-header.themes-filter-bar .search-form-input {
position: relative;
}
.customize-preview-header .filter-themes-wrapper {
display: grid;
align-items: center;
gap: 10px;
grid-template-columns: auto 1fr;
}
.customize-preview-header .filter-themes-wrapper .filter-themes-count {
justify-self: end;
}
@media screen and (min-width: 1670px) {
.customize-preview-header.themes-filter-bar {
@ -2109,6 +2138,9 @@ p.customize-section-description {
.themes-filter-bar .themes-filter-container {
margin: 0;
padding: 0;
display: flex;
align-items: center;
gap: 10px;
}
.themes-filter-bar .wp-filter-search {
@ -2117,11 +2149,10 @@ p.customize-section-description {
max-width: 100%;
width: 40%;
min-width: 300px;
position: absolute;
top: 6px;
left: 25px;
height: 32px;
margin: 1px 0;
top: 0;
left: 0;
}
/* Unstick the filter bar on short windows/screens. This breakpoint is based on the
@ -2155,18 +2186,31 @@ p.customize-section-description {
}
}
@media screen and (max-width: 900px) {
@media screen and (max-width: 960px) {
.customize-preview-header.themes-filter-bar {
height: 86px;
padding-top: 46px;
height: 96px;
}
}
@media screen and (max-width: 900px) {
.themes-filter-bar .wp-filter-search {
width: calc(100% - 50px);
width: 100%;
margin: 0;
min-width: 200px;
}
.customize-preview-header.themes-filter-bar,
.customize-preview-header.themes-filter-bar .search-form
.themes-filter-bar .themes-filter-container {
display: grid;
gap: 4px;
}
.customize-preview-header.themes-filter-bar .search-form-input {
display: flex;
flex-grow: 1;
}
.filter-drawer {
top: 86px;
}
@ -2580,7 +2624,7 @@ body.adding-widget .add-new-widget:before,
}
#available-widgets-list {
top: 60px;
top: 82px;
position: absolute;
overflow: auto;
bottom: 0;
@ -2624,7 +2668,7 @@ body.adding-widget .add-new-widget:before,
#available-widgets-filter .search-icon {
display: block;
position: absolute;
top: 15px; /* 13 container padding +1 input margin +1 input border */
bottom: 15px; /* 13 container padding +1 input margin +1 input border */
left: 16px;
width: 30px;
height: 30px;
@ -2634,9 +2678,9 @@ body.adding-widget .add-new-widget:before,
}
#available-widgets-filter .clear-results,
#available-menu-items-search .clear-results {
#available-menu-items-search .accordion-section-title .clear-results {
position: absolute;
top: 15px; /* 13 container padding +1 input margin +1 input border */
top: 36px; /* 13 container padding +1 input margin +1 input border */
right: 16px;
width: 30px;
height: 30px;
@ -2695,8 +2739,8 @@ body.adding-widget .add-new-widget:before,
.themes-filter-bar .search-icon {
position: absolute;
top: 7px;
left: 26px;
top: 2px;
left: 2px;
z-index: 1;
color: #646970;
height: 30px;
@ -2814,8 +2858,8 @@ body.adding-widget .add-new-widget:before,
margin-top: 12px;
}
.wp-core-ui .themes-filter-bar .feature-filter-toggle {
margin: 3px 0 3px 25px;
.customize-preview-header.themes-filter-bar .search-icon {
top: 6px;
}
}
@ -2952,22 +2996,18 @@ body.adding-widget .add-new-widget:before,
}
#available-widgets-list {
top: 130px;
top: 152px;
}
#available-menu-items-search .clear-results,
#available-menu-items-search .search-icon {
top: 85px; /* 70 section title height + 13 container padding +1 input margin +1 input border */
#available-menu-items-search .clear-results {
top: 36px;
right: 16px;
}
.reorder,
.reordering .reorder-done {
padding: 8px;
}
.wp-core-ui .themes-filter-bar .feature-filter-toggle {
margin: 0;
}
}
@media screen and (max-width: 600px) {

File diff suppressed because one or more lines are too long

View File

@ -558,7 +558,7 @@
#available-menu-items .accordion-section-title .no-items,
#available-menu-items .cannot-expand .accordion-section-title .spinner,
#available-menu-items .cannot-expand .accordion-section-title > button {
#available-menu-items .cannot-expand .accordion-section-title > button:not(#available-menu-items-search button.is-visible) {
display: none;
}
@ -582,7 +582,7 @@
}
#available-menu-items .accordion-section-content .available-menu-items-list {
margin: 0 0 45px;
margin: 0 0 64px;
padding: 1px 15px 15px;
}
@ -681,7 +681,7 @@
#available-menu-items-search .spinner {
position: absolute;
top: 20px; /* 13 container padding +1 input margin +6 ( ( 32 input height - 20 spinner height ) / 2 ) */
bottom: 20px; /* 13 container padding +1 input margin +6 ( ( 32 input height - 20 spinner height ) / 2 ) */
left: 21px;
margin: 0 !important;
}
@ -690,7 +690,7 @@
#available-menu-items #available-menu-items-search .accordion-section-content {
position: absolute;
right: 0;
top: 60px; /* below title div / search input */
top: 75px; /* below title div / search input */
bottom: 0; /* 100% height that still triggers lazy load */
max-height: none;
width: 100%;
@ -879,6 +879,6 @@ li.assigned-to-menu-location .add-new-menu-item {
@media screen and (max-width: 640px) {
#available-menu-items #available-menu-items-search .accordion-section-content {
top: 130px;
top: 146px;
}
}

File diff suppressed because one or more lines are too long

View File

@ -557,7 +557,7 @@
#available-menu-items .accordion-section-title .no-items,
#available-menu-items .cannot-expand .accordion-section-title .spinner,
#available-menu-items .cannot-expand .accordion-section-title > button {
#available-menu-items .cannot-expand .accordion-section-title > button:not(#available-menu-items-search button.is-visible) {
display: none;
}
@ -581,7 +581,7 @@
}
#available-menu-items .accordion-section-content .available-menu-items-list {
margin: 0 0 45px;
margin: 0 0 64px;
padding: 1px 15px 15px;
}
@ -680,7 +680,7 @@
#available-menu-items-search .spinner {
position: absolute;
top: 20px; /* 13 container padding +1 input margin +6 ( ( 32 input height - 20 spinner height ) / 2 ) */
bottom: 20px; /* 13 container padding +1 input margin +6 ( ( 32 input height - 20 spinner height ) / 2 ) */
right: 21px;
margin: 0 !important;
}
@ -689,7 +689,7 @@
#available-menu-items #available-menu-items-search .accordion-section-content {
position: absolute;
left: 0;
top: 60px; /* below title div / search input */
top: 75px; /* below title div / search input */
bottom: 0; /* 100% height that still triggers lazy load */
max-height: none;
width: 100%;
@ -878,6 +878,6 @@ li.assigned-to-menu-location .add-new-menu-item {
@media screen and (max-width: 640px) {
#available-menu-items #available-menu-items-search .accordion-section-content {
top: 130px;
top: 146px;
}
}

File diff suppressed because one or more lines are too long

View File

@ -721,8 +721,13 @@ fieldset label,
}
p.search-box {
display: flex;
flex-wrap: wrap;
align-items: center;
column-gap: 0.5rem;
position: relative;
float: left;
margin: 0;
margin: 11px 0;
}
.network-admin.themes-php p.search-box {

File diff suppressed because one or more lines are too long

View File

@ -720,8 +720,13 @@ fieldset label,
}
p.search-box {
display: flex;
flex-wrap: wrap;
align-items: center;
column-gap: 0.5rem;
position: relative;
float: right;
margin: 0;
margin: 11px 0;
}
.network-admin.themes-php p.search-box {

File diff suppressed because one or more lines are too long

View File

@ -905,7 +905,7 @@ tr:hover .row-actions,
tr.inline-edit-row td {
padding: 0;
/* Prevents the focus style on .inline-edit-wrapper from being cutted-off */
/* Prevents the focus style on .inline-edit-wrapper from being cut-off */
position: relative;
}

View File

@ -904,7 +904,7 @@ tr:hover .row-actions,
tr.inline-edit-row td {
padding: 0;
/* Prevents the focus style on .inline-edit-wrapper from being cutted-off */
/* Prevents the focus style on .inline-edit-wrapper from being cut-off */
position: relative;
}

View File

@ -586,15 +586,9 @@ border color while dragging a file over the uploader drop area */
}
.media-frame-content .media-search-input-label {
margin: 0 0 0 .2em;
vertical-align: baseline;
}
.media-frame.mode-grid .media-search-input-label {
position: static;
margin: 0 0 0 .5em;
}
.attachments-browser .media-toolbar-secondary > .media-button {
margin-left: 10px;
}
@ -1125,7 +1119,7 @@ border color while dragging a file over the uploader drop area */
.imgedit-panel-tools > .imgedit-menu {
display: flex;
column-gap: 4px;
align-items: start;
align-items: flex-start;
flex-wrap: wrap;
}
@ -1374,6 +1368,12 @@ audio, video {
width: 100%;
margin-bottom: 20px;
display: flex;
flex-wrap: nowrap;
column-gap: 0;
}
.wp-filter p.search-box #media-search-input {
width: 100%;
}
}

File diff suppressed because one or more lines are too long

View File

@ -585,15 +585,9 @@ border color while dragging a file over the uploader drop area */
}
.media-frame-content .media-search-input-label {
margin: 0 .2em 0 0;
vertical-align: baseline;
}
.media-frame.mode-grid .media-search-input-label {
position: static;
margin: 0 .5em 0 0;
}
.attachments-browser .media-toolbar-secondary > .media-button {
margin-right: 10px;
}
@ -1124,7 +1118,7 @@ border color while dragging a file over the uploader drop area */
.imgedit-panel-tools > .imgedit-menu {
display: flex;
column-gap: 4px;
align-items: start;
align-items: flex-start;
flex-wrap: wrap;
}
@ -1373,6 +1367,12 @@ audio, video {
width: 100%;
margin-bottom: 20px;
display: flex;
flex-wrap: nowrap;
column-gap: 0;
}
.wp-filter p.search-box #media-search-input {
width: 100%;
}
}

File diff suppressed because one or more lines are too long

View File

@ -84,8 +84,10 @@ if ( $wp_customize->changeset_post_id() ) {
}
}
$url = ! empty( $_REQUEST['url'] ) ? sanitize_text_field( $_REQUEST['url'] ) : '';
$return = ! empty( $_REQUEST['return'] ) ? sanitize_text_field( $_REQUEST['return'] ) : '';
$autofocus = ! empty( $_REQUEST['autofocus'] ) ? sanitize_text_field( $_REQUEST['autofocus'] ) : '';
wp_reset_vars( array( 'url', 'return', 'autofocus' ) );
if ( ! empty( $url ) ) {
$wp_customize->set_preview_url( wp_unslash( $url ) );
}

View File

@ -377,7 +377,7 @@ if ( 'post' === $post_type ) {
'</li>';
if ( current_theme_supports( 'post-formats' ) && post_type_supports( 'post', 'post-formats' ) ) {
$publish_box .= '<li>' . __( '<strong>Format</strong> &mdash; Post Formats designate how your theme will display a specific post. For example, you could have a <em>standard</em> blog post with a title and paragraphs, or a short <em>aside</em> that omits the title and contains a short text blurb. Your theme could enable all or some of 10 possible formats. <a href="https://wordpress.org/documentation/article/post-formats/#supported-formats">Learn more about each post format</a>.' ) . '</li>';
$publish_box .= '<li>' . __( '<strong>Format</strong> &mdash; Post Formats designate how your theme will display a specific post. For example, you could have a <em>standard</em> blog post with a title and paragraphs, or a short <em>aside</em> that omits the title and contains a short text blurb. Your theme could enable all or some of 10 possible formats. <a href="https://developer.wordpress.org/advanced-administration/wordpress/post-formats/#supported-formats">Learn more about each post format</a>.' ) . '</li>';
}
if ( current_theme_supports( 'post-thumbnails' ) && post_type_supports( 'post', 'thumbnail' ) ) {

View File

@ -44,11 +44,7 @@ if ( 'category' === $taxonomy ) {
do_action_deprecated( 'edit_tag_form_pre', array( $tag ), '3.0.0', '{$taxonomy}_pre_edit_form' );
}
/**
* Use with caution, see https://developer.wordpress.org/reference/functions/wp_reset_vars/
*/
wp_reset_vars( array( 'wp_http_referer' ) );
$wp_http_referer = ! empty( $_REQUEST['wp_http_referer'] ) ? sanitize_text_field( $_REQUEST['wp_http_referer'] ) : '';
$wp_http_referer = remove_query_arg( array( 'action', 'message', 'tag_ID' ), $wp_http_referer );
// Also used by Edit Tags.

View File

@ -55,8 +55,8 @@ get_current_screen()->add_help_tab(
'title' => __( 'Plugin Data' ),
'content' =>
'<p>' . __( 'Many plugins may collect or store personal data either in the WordPress database or remotely. Any Erase Personal Data request should delete data from plugins as well.' ) . '</p>' .
'<p>' . __( 'If you are a plugin author, you can <a href="https://developer.wordpress.org/plugins/privacy/adding-the-personal-data-eraser-to-your-plugin/" target="_blank">learn more about how to add support for the Personal Data Eraser to a plugin here</a>.' ) . '</p>' .
$privacy_policy_guide,
$privacy_policy_guide .
'<p>' . __( 'If you are a plugin author, you can learn more about <a href="https://developer.wordpress.org/plugins/privacy/adding-the-personal-data-eraser-to-your-plugin/">how to add the Personal Data Eraser to a plugin</a>.' ) . '</p>',
)
);

View File

@ -55,8 +55,8 @@ get_current_screen()->add_help_tab(
'title' => __( 'Plugin Data' ),
'content' =>
'<p>' . __( 'Many plugins may collect or store personal data either in the WordPress database or remotely. Any Export Personal Data request should include data from plugins as well.' ) . '</p>' .
'<p>' . __( 'Plugin authors can <a href="https://developer.wordpress.org/plugins/privacy/adding-the-personal-data-exporter-to-your-plugin/" target="_blank">learn more about how to add the Personal Data Exporter to a plugin here</a>.' ) . '</p>' .
$privacy_policy_guide,
$privacy_policy_guide .
'<p>' . __( 'If you are a plugin author, you can learn more about <a href="https://developer.wordpress.org/plugins/privacy/adding-the-personal-data-exporter-to-your-plugin/">how to add the Personal Data Exporter to a plugin</a>.' ) . '</p>',
)
);

View File

@ -238,8 +238,8 @@ function export_date_options( $post_type = 'post' ) {
<select name="post_status" id="post-status">
<option value="0"><?php _e( 'All' ); ?></option>
<?php
$post_stati = get_post_stati( array( 'internal' => false ), 'objects' );
foreach ( $post_stati as $status ) :
$post_statuses = get_post_stati( array( 'internal' => false ), 'objects' );
foreach ( $post_statuses as $status ) :
?>
<option value="<?php echo esc_attr( $status->name ); ?>"><?php echo esc_html( $status->label ); ?></option>
<?php endforeach; ?>
@ -289,7 +289,7 @@ function export_date_options( $post_type = 'post' ) {
<label for="page-status" class="label-responsive"><?php _e( 'Status:' ); ?></label>
<select name="page_status" id="page-status">
<option value="0"><?php _e( 'All' ); ?></option>
<?php foreach ( $post_stati as $status ) : ?>
<?php foreach ( $post_statuses as $status ) : ?>
<option value="<?php echo esc_attr( $status->name ); ?>"><?php echo esc_html( $status->label ); ?></option>
<?php endforeach; ?>
</select>

View File

@ -192,7 +192,7 @@ function wp_ajax_wp_compression_test() {
if ( is_multisite() ) {
update_site_option( 'can_compress_scripts', 0 );
} else {
update_option( 'can_compress_scripts', 0, 'yes' );
update_option( 'can_compress_scripts', 0, 'on' );
}
wp_die( 0 );
}
@ -231,7 +231,7 @@ function wp_ajax_wp_compression_test() {
if ( is_multisite() ) {
update_site_option( 'can_compress_scripts', 0 );
} else {
update_option( 'can_compress_scripts', 0, 'yes' );
update_option( 'can_compress_scripts', 0, 'on' );
}
} elseif ( 'yes' === $_GET['test'] ) {
check_ajax_referer( 'update_can_compress_scripts' );
@ -239,7 +239,7 @@ function wp_ajax_wp_compression_test() {
if ( is_multisite() ) {
update_site_option( 'can_compress_scripts', 1 );
} else {
update_option( 'can_compress_scripts', 1, 'yes' );
update_option( 'can_compress_scripts', 1, 'on' );
}
}
}
@ -274,7 +274,7 @@ function wp_ajax_imgedit_preview() {
*
* @since 3.1.0
*
* @global WP_Embed $wp_embed
* @global WP_Embed $wp_embed WordPress Embed object.
*/
function wp_ajax_oembed_cache() {
$GLOBALS['wp_embed']->cache_oembed( $_GET['post'] );
@ -3381,7 +3381,7 @@ function wp_ajax_send_attachment_to_editor() {
* @since 3.5.0
*
* @global WP_Post $post Global post object.
* @global WP_Embed $wp_embed
* @global WP_Embed $wp_embed WordPress Embed object.
*/
function wp_ajax_send_link_to_editor() {
global $post, $wp_embed;
@ -3733,8 +3733,8 @@ function wp_ajax_query_themes() {
*
* @since 4.0.0
*
* @global WP_Post $post Global post object.
* @global WP_Embed $wp_embed Embed API instance.
* @global WP_Post $post Global post object.
* @global WP_Embed $wp_embed WordPress Embed object.
* @global WP_Scripts $wp_scripts
* @global int $content_width
*/

View File

@ -23,10 +23,16 @@ class Bulk_Plugin_Upgrader_Skin extends Bulk_Upgrader_Skin {
* The Plugin_Upgrader::bulk_upgrade() method will fill this in
* with info retrieved from the get_plugin_data() function.
*
* @since 3.0.0
* @var array Plugin data. Values will be empty if not supplied by the plugin.
*/
public $plugin_info = array();
/**
* Sets up the strings used in the update process.
*
* @since 3.0.0
*/
public function add_strings() {
parent::add_strings();
/* translators: 1: Plugin name, 2: Number of the plugin, 3: Total number of plugins being updated. */
@ -34,6 +40,10 @@ class Bulk_Plugin_Upgrader_Skin extends Bulk_Upgrader_Skin {
}
/**
* Performs an action before a bulk plugin update.
*
* @since 3.0.0
*
* @param string $title
*/
public function before( $title = '' ) {
@ -41,6 +51,10 @@ class Bulk_Plugin_Upgrader_Skin extends Bulk_Upgrader_Skin {
}
/**
* Performs an action following a bulk plugin update.
*
* @since 3.0.0
*
* @param string $title
*/
public function after( $title = '' ) {
@ -49,6 +63,9 @@ class Bulk_Plugin_Upgrader_Skin extends Bulk_Upgrader_Skin {
}
/**
* Displays the footer following the bulk update process.
*
* @since 3.0.0
*/
public function bulk_footer() {
parent::bulk_footer();

View File

@ -24,10 +24,16 @@ class Bulk_Theme_Upgrader_Skin extends Bulk_Upgrader_Skin {
* with info retrieved from the Theme_Upgrader::theme_info() method,
* which in turn calls the wp_get_theme() function.
*
* @since 3.0.0
* @var WP_Theme|false The theme's info object, or false.
*/
public $theme_info = false;
/**
* Sets up the strings used in the update process.
*
* @since 3.0.0
*/
public function add_strings() {
parent::add_strings();
/* translators: 1: Theme name, 2: Number of the theme, 3: Total number of themes being updated. */
@ -35,6 +41,10 @@ class Bulk_Theme_Upgrader_Skin extends Bulk_Upgrader_Skin {
}
/**
* Performs an action before a bulk theme update.
*
* @since 3.0.0
*
* @param string $title
*/
public function before( $title = '' ) {
@ -42,6 +52,10 @@ class Bulk_Theme_Upgrader_Skin extends Bulk_Upgrader_Skin {
}
/**
* Performs an action following a bulk theme update.
*
* @since 3.0.0
*
* @param string $title
*/
public function after( $title = '' ) {
@ -50,6 +64,9 @@ class Bulk_Theme_Upgrader_Skin extends Bulk_Upgrader_Skin {
}
/**
* Displays the footer following the bulk update process.
*
* @since 3.0.0
*/
public function bulk_footer() {
parent::bulk_footer();

View File

@ -16,13 +16,30 @@
* @see WP_Upgrader_Skin
*/
class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
public $in_loop = false;
/**
* Whether the bulk update process has started.
*
* @since 3.0.0
* @var bool
*/
public $in_loop = false;
/**
* Stores an error message about the update.
*
* @since 3.0.0
* @var string|false
*/
public $error = false;
/**
* Constructor.
*
* Sets up the generic skin for the Bulk Upgrader classes.
*
* @since 3.0.0
*
* @param array $args
*/
public function __construct( $args = array() ) {
@ -36,6 +53,9 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
}
/**
* Sets up the strings used in the update process.
*
* @since 3.0.0
*/
public function add_strings() {
$this->upgrader->strings['skin_upgrade_start'] = __( 'The update process is starting. This process may take a while on some hosts, so please be patient.' );
@ -49,6 +69,9 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
}
/**
* Displays a message about the update.
*
* @since 3.0.0
* @since 5.9.0 Renamed `$string` (a PHP reserved keyword) to `$feedback` for PHP 8 named parameter support.
*
* @param string $feedback Message data.
@ -77,18 +100,27 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
}
/**
* Displays the header before the update process.
*
* @since 3.0.0
*/
public function header() {
// Nothing. This will be displayed within an iframe.
}
/**
* Displays the footer following the update process.
*
* @since 3.0.0
*/
public function footer() {
// Nothing. This will be displayed within an iframe.
}
/**
* Displays an error message about the update.
*
* @since 3.0.0
* @since 5.9.0 Renamed `$error` to `$errors` for PHP 8 named parameter support.
*
* @param string|WP_Error $errors Errors.
@ -113,18 +145,28 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
}
/**
* Displays the header before the bulk update process.
*
* @since 3.0.0
*/
public function bulk_header() {
$this->feedback( 'skin_upgrade_start' );
}
/**
* Displays the footer following the bulk update process.
*
* @since 3.0.0
*/
public function bulk_footer() {
$this->feedback( 'skin_upgrade_end' );
}
/**
* Performs an action before a bulk update.
*
* @since 3.0.0
*
* @param string $title
*/
public function before( $title = '' ) {
@ -137,6 +179,10 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
}
/**
* Performs an action following a bulk update.
*
* @since 3.0.0
*
* @param string $title
*/
public function after( $title = '' ) {
@ -172,6 +218,9 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
}
/**
* Resets the properties used in the update process.
*
* @since 3.0.0
*/
public function reset() {
$this->in_loop = false;
@ -179,6 +228,9 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
}
/**
* Flushes all output buffers.
*
* @since 3.0.0
*/
public function flush_output() {
wp_ob_end_flush_all();

View File

@ -72,7 +72,24 @@ class File_Upload_Upgrader {
if ( 'pluginzip' === $form || 'themezip' === $form ) {
if ( ! wp_zip_file_is_valid( $file['file'] ) ) {
wp_delete_file( $file['file'] );
wp_die( __( 'Incompatible Archive.' ) );
if ( 'pluginzip' === $form ) {
$plugins_page = sprintf(
'<a href="%s">%s</a>',
self_admin_url( 'plugin-install.php' ),
__( 'Return to the Plugin Installer' )
);
wp_die( __( 'Incompatible Archive.' ) . '<br />' . $plugins_page );
}
if ( 'themezip' === $form ) {
$themes_page = sprintf(
'<a href="%s" target="_parent">%s</a>',
self_admin_url( 'theme-install.php' ),
__( 'Return to the Theme Installer' )
);
wp_die( __( 'Incompatible Archive.' ) . '<br />' . $themes_page );
}
}
}

View File

@ -22,6 +22,12 @@ class Language_Pack_Upgrader_Skin extends WP_Upgrader_Skin {
public $display_footer_actions = true;
/**
* Constructor.
*
* Sets up the language pack upgrader skin.
*
* @since 3.7.0
*
* @param array $args
*/
public function __construct( $args = array() ) {
@ -41,6 +47,9 @@ class Language_Pack_Upgrader_Skin extends WP_Upgrader_Skin {
}
/**
* Performs an action before a language pack update.
*
* @since 3.7.0
*/
public function before() {
$name = $this->upgrader->get_name_for_update( $this->language_update );
@ -52,6 +61,9 @@ class Language_Pack_Upgrader_Skin extends WP_Upgrader_Skin {
}
/**
* Displays an error message about the update.
*
* @since 3.7.0
* @since 5.9.0 Renamed `$error` to `$errors` for PHP 8 named parameter support.
*
* @param string|WP_Error $errors Errors.
@ -63,12 +75,18 @@ class Language_Pack_Upgrader_Skin extends WP_Upgrader_Skin {
}
/**
* Performs an action following a language pack update.
*
* @since 3.7.0
*/
public function after() {
echo '</div>';
}
/**
* Displays the footer following the bulk update process.
*
* @since 3.7.0
*/
public function bulk_footer() {
$this->decrement_update_count( 'translation' );

View File

@ -332,26 +332,34 @@ class Language_Pack_Upgrader extends WP_Upgrader {
// Check that the folder contains a valid language.
$files = $wp_filesystem->dirlist( $remote_source );
// Check to see if a .po and .mo exist in the folder.
$po = false;
$mo = false;
// Check to see if the expected files exist in the folder.
$po = false;
$mo = false;
$php = false;
foreach ( (array) $files as $file => $filedata ) {
if ( str_ends_with( $file, '.po' ) ) {
$po = true;
} elseif ( str_ends_with( $file, '.mo' ) ) {
$mo = true;
} elseif ( str_ends_with( $file, '.l10n.php' ) ) {
$php = true;
}
}
if ( $php ) {
return $source;
}
if ( ! $mo || ! $po ) {
return new WP_Error(
'incompatible_archive_pomo',
$this->strings['incompatible_archive'],
sprintf(
/* translators: 1: .po, 2: .mo */
__( 'The language pack is missing either the %1$s or %2$s files.' ),
/* translators: 1: .po, 2: .mo, 3: .l10n.php */
__( 'The language pack is missing either the %1$s, %2$s, or %3$s files.' ),
'<code>.po</code>',
'<code>.mo</code>'
'<code>.mo</code>',
'<code>.l10n.php</code>'
)
);
}

View File

@ -48,7 +48,7 @@
// 0 : PclZip Class integrated error handling
// 1 : PclError external library error handling. By enabling this
// you must ensure that you have included PclError library.
// [2,...] : reserved for futur use
// [2,...] : reserved for future use
if (!defined('PCLZIP_ERROR_EXTERNAL')) {
define( 'PCLZIP_ERROR_EXTERNAL', 0 );
}
@ -166,7 +166,7 @@
define( 'PCLZIP_CB_POST_EXTRACT', 78002 );
define( 'PCLZIP_CB_PRE_ADD', 78003 );
define( 'PCLZIP_CB_POST_ADD', 78004 );
/* For futur use
/* For future use
define( 'PCLZIP_CB_PRE_LIST', 78005 );
define( 'PCLZIP_CB_POST_LIST', 78006 );
define( 'PCLZIP_CB_PRE_DELETE', 78007 );
@ -1364,12 +1364,12 @@
// Function : privCheckFormat()
// Description :
// This method check that the archive exists and is a valid zip archive.
// Several level of check exists. (futur)
// Several level of check exists. (future)
// Parameters :
// $p_level : Level of check. Default 0.
// 0 : Check the first bytes (magic codes) (default value))
// 1 : 0 + Check the central directory (futur)
// 2 : 1 + Check each file header (futur)
// 1 : 0 + Check the central directory (future)
// 2 : 1 + Check each file header (future)
// Return Values :
// true on success,
// false on error, the error code is set.
@ -1748,7 +1748,7 @@
case PCLZIP_CB_POST_EXTRACT :
case PCLZIP_CB_PRE_ADD :
case PCLZIP_CB_POST_ADD :
/* for futur use
/* for future use
case PCLZIP_CB_PRE_DELETE :
case PCLZIP_CB_POST_DELETE :
case PCLZIP_CB_PRE_LIST :

View File

@ -24,6 +24,12 @@ class Plugin_Installer_Skin extends WP_Upgrader_Skin {
private $is_downgrading = false;
/**
* Constructor.
*
* Sets up the plugin installer skin.
*
* @since 2.8.0
*
* @param array $args
*/
public function __construct( $args = array() ) {
@ -293,13 +299,13 @@ class Plugin_Installer_Skin extends WP_Upgrader_Skin {
$warning = sprintf(
/* translators: %s: Documentation URL. */
__( 'You are uploading an older version of a current plugin. You can continue to install the older version, but be sure to <a href="%s">back up your database and files</a> first.' ),
__( 'https://wordpress.org/documentation/article/wordpress-backups/' )
__( 'https://developer.wordpress.org/advanced-administration/security/backup/' )
);
} else {
$warning = sprintf(
/* translators: %s: Documentation URL. */
__( 'You are updating a plugin. Be sure to <a href="%s">back up your database and files</a> first.' ),
__( 'https://wordpress.org/documentation/article/wordpress-backups/' )
__( 'https://developer.wordpress.org/advanced-administration/security/backup/' )
);
}

View File

@ -24,6 +24,12 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin {
private $is_downgrading = false;
/**
* Constructor.
*
* Sets up the theme installer skin.
*
* @since 2.8.0
*
* @param array $args
*/
public function __construct( $args = array() ) {
@ -328,13 +334,13 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin {
$warning = sprintf(
/* translators: %s: Documentation URL. */
__( 'You are uploading an older version of the active theme. You can continue to install the older version, but be sure to <a href="%s">back up your database and files</a> first.' ),
__( 'https://wordpress.org/documentation/article/wordpress-backups/' )
__( 'https://developer.wordpress.org/advanced-administration/security/backup/' )
);
} else {
$warning = sprintf(
/* translators: %s: Documentation URL. */
__( 'You are updating a theme. Be sure to <a href="%s">back up your database and files</a> first.' ),
__( 'https://wordpress.org/documentation/article/wordpress-backups/' )
__( 'https://developer.wordpress.org/advanced-administration/security/backup/' )
);
}

View File

@ -446,6 +446,32 @@ class WP_Automatic_Updater {
$allow_relaxed_file_ownership = true;
}
$is_debug = WP_DEBUG && WP_DEBUG_LOG;
if ( 'plugin' === $type ) {
$was_active = is_plugin_active( $upgrader_item );
if ( $is_debug ) {
error_log( ' Upgrading plugin ' . var_export( $item->slug, true ) . '...' );
}
}
if ( 'theme' === $type && $is_debug ) {
error_log( ' Upgrading theme ' . var_export( $item->theme, true ) . '...' );
}
/*
* Enable maintenance mode before upgrading the plugin or theme.
*
* This avoids potential non-fatal errors being detected
* while scraping for a fatal error if some files are still
* being moved.
*
* While these checks are intended only for plugins,
* maintenance mode is enabled for all upgrade types as any
* update could contain an error or warning, which could cause
* the scrape to miss a fatal error in the plugin update.
*/
$upgrader->maintenance_mode( true );
// Boom, this site's about to get a whole new splash of paint!
$upgrade_result = $upgrader->upgrade(
$upgrader_item,
@ -460,6 +486,17 @@ class WP_Automatic_Updater {
)
);
/*
* After WP_Upgrader::upgrade() completes, maintenance mode is disabled.
*
* Re-enable maintenance mode while attempting to detect fatal errors
* and potentially rolling back.
*
* This avoids errors if the site is visited while fatal errors exist
* or while files are still being moved.
*/
$upgrader->maintenance_mode( true );
// If the filesystem is unavailable, false is returned.
if ( false === $upgrade_result ) {
$upgrade_result = new WP_Error( 'fs_unavailable', __( 'Could not access filesystem.' ) );
@ -486,6 +523,98 @@ class WP_Automatic_Updater {
}
}
$is_debug = WP_DEBUG && WP_DEBUG_LOG;
if ( 'theme' === $type && $is_debug ) {
error_log( ' Theme ' . var_export( $item->theme, true ) . ' has been upgraded.' );
}
if ( 'plugin' === $type ) {
if ( $is_debug ) {
error_log( ' Plugin ' . var_export( $item->slug, true ) . ' has been upgraded.' );
if ( is_plugin_inactive( $upgrader_item ) ) {
error_log( ' ' . var_export( $upgrader_item, true ) . ' is inactive and will not be checked for fatal errors.' );
}
}
if ( $was_active && ! is_wp_error( $upgrade_result ) ) {
/*
* The usual time limit is five minutes. However, as a loopback request
* is about to be performed, increase the time limit to account for this.
*/
if ( function_exists( 'set_time_limit' ) ) {
set_time_limit( 10 * MINUTE_IN_SECONDS );
}
/*
* Avoids a race condition when there are 2 sequential plugins that have
* fatal errors. It seems a slight delay is required for the loopback to
* use the updated plugin code in the request. This can cause the second
* plugin's fatal error checking to be inaccurate, and may also affect
* subsequent plugin checks.
*/
sleep( 2 );
if ( $this->has_fatal_error() ) {
$upgrade_result = new WP_Error();
$temp_backup = array(
array(
'dir' => 'plugins',
'slug' => $item->slug,
'src' => WP_PLUGIN_DIR,
),
);
$backup_restored = $upgrader->restore_temp_backup( $temp_backup );
if ( is_wp_error( $backup_restored ) ) {
$upgrade_result->add(
'plugin_update_fatal_error_rollback_failed',
sprintf(
/* translators: %s: The plugin's slug. */
__( "The update for '%s' contained a fatal error. The previously installed version could not be restored." ),
$item->slug
)
);
$upgrade_result->merge_from( $backup_restored );
} else {
$upgrade_result->add(
'plugin_update_fatal_error_rollback_successful',
sprintf(
/* translators: %s: The plugin's slug. */
__( "The update for '%s' contained a fatal error. The previously installed version has been restored." ),
$item->slug
)
);
$backup_deleted = $upgrader->delete_temp_backup( $temp_backup );
if ( is_wp_error( $backup_deleted ) ) {
$upgrade_result->merge_from( $backup_deleted );
}
}
/*
* Should emails not be working, log the message(s) so that
* the log file contains context for the fatal error,
* and whether a rollback was performed.
*
* `trigger_error()` is not used as it outputs a stack trace
* to this location rather than to the fatal error, which will
* appear above this entry in the log file.
*/
if ( $is_debug ) {
error_log( ' ' . implode( "\n", $upgrade_result->get_error_messages() ) );
}
} elseif ( $is_debug ) {
error_log( ' The update for ' . var_export( $item->slug, true ) . ' has no fatal errors.' );
}
}
}
// All processes are complete. Allow visitors to browse the site again.
$upgrader->maintenance_mode( false );
$this->update_results[ $type ][] = (object) array(
'item' => $item,
'result' => $upgrade_result,
@ -514,6 +643,12 @@ class WP_Automatic_Updater {
return;
}
$is_debug = WP_DEBUG && WP_DEBUG_DISPLAY;
if ( $is_debug ) {
error_log( 'Automatic updates starting...' );
}
// Don't automatically run these things, as we'll handle it ourselves.
remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
remove_action( 'upgrader_process_complete', 'wp_version_check' );
@ -524,22 +659,43 @@ class WP_Automatic_Updater {
wp_update_plugins(); // Check for plugin updates.
$plugin_updates = get_site_transient( 'update_plugins' );
if ( $plugin_updates && ! empty( $plugin_updates->response ) ) {
if ( $is_debug ) {
error_log( ' Automatic plugin updates starting...' );
}
foreach ( $plugin_updates->response as $plugin ) {
$this->update( 'plugin', $plugin );
}
// Force refresh of plugin update information.
wp_clean_plugins_cache();
if ( $is_debug ) {
error_log( ' Automatic plugin updates complete.' );
}
}
// Next, those themes we all love.
wp_update_themes(); // Check for theme updates.
$theme_updates = get_site_transient( 'update_themes' );
if ( $theme_updates && ! empty( $theme_updates->response ) ) {
if ( $is_debug ) {
error_log( ' Automatic theme updates starting...' );
}
foreach ( $theme_updates->response as $theme ) {
$this->update( 'theme', (object) $theme );
}
// Force refresh of theme update information.
wp_clean_themes_cache();
if ( $is_debug ) {
error_log( ' Automatic theme updates complete.' );
}
}
if ( $is_debug ) {
error_log( 'Automatic updates complete.' );
}
// Next, process any core update.
@ -1163,7 +1319,7 @@ class WP_Automatic_Updater {
// List failed plugin updates.
if ( ! empty( $failed_updates['plugin'] ) ) {
$body[] = __( 'These plugins failed to update:' );
$body[] = __( 'The following plugins failed to update. If there was a fatal error in the update, the previously installed version has been restored.' );
foreach ( $failed_updates['plugin'] as $item ) {
$body_message = '';
@ -1551,4 +1707,91 @@ Thanks! -- The WordPress Team"
wp_mail( $email['to'], wp_specialchars_decode( $email['subject'] ), $email['body'], $email['headers'] );
}
/**
* Performs a loopback request to check for potential fatal errors.
*
* Fatal errors cannot be detected unless maintenance mode is enabled.
*
* @since 6.6.0
*
* @global int $upgrading The Unix timestamp marking when upgrading WordPress began.
*
* @return bool Whether a fatal error was detected.
*/
protected function has_fatal_error() {
global $upgrading;
$maintenance_file = ABSPATH . '.maintenance';
if ( ! file_exists( $maintenance_file ) ) {
return false;
}
require $maintenance_file;
if ( ! is_int( $upgrading ) ) {
return false;
}
$scrape_key = md5( $upgrading );
$scrape_nonce = (string) $upgrading;
$transient = 'scrape_key_' . $scrape_key;
set_transient( $transient, $scrape_nonce, 30 );
$cookies = wp_unslash( $_COOKIE );
$scrape_params = array(
'wp_scrape_key' => $scrape_key,
'wp_scrape_nonce' => $scrape_nonce,
);
$headers = array(
'Cache-Control' => 'no-cache',
);
/** This filter is documented in wp-includes/class-wp-http-streams.php */
$sslverify = apply_filters( 'https_local_ssl_verify', false );
// Include Basic auth in the loopback request.
if ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) {
$headers['Authorization'] = 'Basic ' . base64_encode( wp_unslash( $_SERVER['PHP_AUTH_USER'] ) . ':' . wp_unslash( $_SERVER['PHP_AUTH_PW'] ) );
}
// Time to wait for loopback request to finish.
$timeout = 50; // 50 seconds.
$is_debug = WP_DEBUG && WP_DEBUG_DISPLAY;
if ( $is_debug ) {
error_log( ' Scraping home page...' );
}
$needle_start = "###### wp_scraping_result_start:$scrape_key ######";
$needle_end = "###### wp_scraping_result_end:$scrape_key ######";
$url = add_query_arg( $scrape_params, home_url( '/' ) );
$response = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout', 'sslverify' ) );
if ( is_wp_error( $response ) ) {
if ( $is_debug ) {
error_log( 'Loopback request failed: ' . $response->get_error_message() );
}
return true;
}
// If this outputs `true` in the log, it means there were no fatal errors detected.
if ( $is_debug ) {
error_log( var_export( substr( $response['body'], strpos( $response['body'], '###### wp_scraping_result_start:' ) ), true ) );
}
$body = wp_remote_retrieve_body( $response );
$scrape_result_position = strpos( $body, $needle_start );
$result = null;
if ( false !== $scrape_result_position ) {
$error_output = substr( $body, $scrape_result_position + strlen( $needle_start ) );
$error_output = substr( $error_output, 0, strpos( $error_output, $needle_end ) );
$result = json_decode( trim( $error_output ), true );
}
delete_transient( $transient );
// Only fatal errors will result in a 'type' key.
return isset( $result['type'] );
}
}

View File

@ -237,7 +237,7 @@ class WP_Comments_List_Table extends WP_List_Table {
$status_links = array();
$num_comments = ( $post_id ) ? wp_count_comments( $post_id ) : wp_count_comments();
$stati = array(
$statuses = array(
/* translators: %s: Number of comments. */
'all' => _nx_noop(
'All <span class="count">(%s)</span>',
@ -282,7 +282,7 @@ class WP_Comments_List_Table extends WP_List_Table {
);
if ( ! EMPTY_TRASH_DAYS ) {
unset( $stati['trash'] );
unset( $statuses['trash'] );
}
$link = admin_url( 'edit-comments.php' );
@ -291,7 +291,7 @@ class WP_Comments_List_Table extends WP_List_Table {
$link = add_query_arg( 'comment_type', $comment_type, $link );
}
foreach ( $stati as $status => $label ) {
foreach ( $statuses as $status => $label ) {
if ( 'mine' === $status ) {
$current_user_id = get_current_user_id();
$num_comments->mine = get_comments(

View File

@ -50,7 +50,10 @@ class WP_Links_List_Table extends WP_List_Table {
public function prepare_items() {
global $cat_id, $s, $orderby, $order;
wp_reset_vars( array( 'action', 'cat_id', 'link_id', 'orderby', 'order', 's' ) );
$cat_id = ! empty( $_REQUEST['cat_id'] ) ? absint( $_REQUEST['cat_id'] ) : 0;
$orderby = ! empty( $_REQUEST['orderby'] ) ? sanitize_text_field( $_REQUEST['orderby'] ) : '';
$order = ! empty( $_REQUEST['order'] ) ? sanitize_text_field( $_REQUEST['order'] ) : '';
$s = ! empty( $_REQUEST['s'] ) ? sanitize_text_field( $_REQUEST['s'] ) : '';
$args = array(
'hide_invisible' => 0,

View File

@ -99,7 +99,9 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
public function prepare_items() {
global $status, $totals, $page, $orderby, $order, $s;
wp_reset_vars( array( 'orderby', 'order', 's' ) );
$orderby = ! empty( $_REQUEST['orderby'] ) ? sanitize_text_field( $_REQUEST['orderby'] ) : '';
$order = ! empty( $_REQUEST['order'] ) ? sanitize_text_field( $_REQUEST['order'] ) : '';
$s = ! empty( $_REQUEST['s'] ) ? sanitize_text_field( $_REQUEST['s'] ) : '';
$themes = array(
/**

View File

@ -92,7 +92,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
global $tabs, $tab, $paged, $type, $term;
wp_reset_vars( array( 'tab' ) );
$tab = ! empty( $_REQUEST['tab'] ) ? sanitize_text_field( $_REQUEST['tab'] ) : '';
$paged = $this->get_pagenum();

View File

@ -90,7 +90,8 @@ class WP_Plugins_List_Table extends WP_List_Table {
public function prepare_items() {
global $status, $plugins, $totals, $page, $orderby, $order, $s;
wp_reset_vars( array( 'orderby', 'order' ) );
$orderby = ! empty( $_REQUEST['orderby'] ) ? sanitize_text_field( $_REQUEST['orderby'] ) : '';
$order = ! empty( $_REQUEST['order'] ) ? sanitize_text_field( $_REQUEST['order'] ) : '';
/**
* Filters the full array of plugins to list in the Plugins list table.
@ -452,8 +453,8 @@ class WP_Plugins_List_Table extends WP_List_Table {
}
?>
<p class="search-box">
<label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo $text; ?>:</label>
<input type="search" id="<?php echo esc_attr( $input_id ); ?>" class="wp-filter-search" name="s" value="<?php _admin_search_query(); ?>" placeholder="<?php esc_attr_e( 'Search installed plugins...' ); ?>" />
<label for="<?php echo esc_attr( $input_id ); ?>"><?php echo $text; ?></label>
<input type="search" id="<?php echo esc_attr( $input_id ); ?>" class="wp-filter-search" name="s" value="<?php _admin_search_query(); ?>" />
<?php submit_button( $text, 'hide-if-js', '', false, array( 'id' => 'search-submit' ) ); ?>
</p>
<?php

View File

@ -1283,120 +1283,6 @@ class WP_Site_Health {
return $result;
}
/**
* Tests if the database server is capable of using utf8mb4.
*
* @since 5.2.0
*
* @return array The test results.
*/
public function get_test_utf8mb4_support() {
if ( ! $this->mysql_server_version ) {
$this->prepare_sql_data();
}
$result = array(
'label' => __( 'UTF8MB4 is supported' ),
'status' => 'good',
'badge' => array(
'label' => __( 'Performance' ),
'color' => 'blue',
),
'description' => sprintf(
'<p>%s</p>',
__( 'UTF8MB4 is the character set WordPress prefers for database storage because it safely supports the widest set of characters and encodings, including Emoji, enabling better support for non-English languages.' )
),
'actions' => '',
'test' => 'utf8mb4_support',
);
if ( ! $this->is_mariadb ) {
if ( version_compare( $this->mysql_server_version, '5.5.3', '<' ) ) {
$result['status'] = 'recommended';
$result['label'] = __( 'utf8mb4 requires a MySQL update' );
$result['description'] .= sprintf(
'<p>%s</p>',
sprintf(
/* translators: %s: Version number. */
__( 'WordPress&#8217; utf8mb4 support requires MySQL version %s or greater. Please contact your server administrator.' ),
'5.5.3'
)
);
} else {
$result['description'] .= sprintf(
'<p>%s</p>',
__( 'Your MySQL version supports utf8mb4.' )
);
}
} else { // MariaDB introduced utf8mb4 support in 5.5.0.
if ( version_compare( $this->mysql_server_version, '5.5.0', '<' ) ) {
$result['status'] = 'recommended';
$result['label'] = __( 'utf8mb4 requires a MariaDB update' );
$result['description'] .= sprintf(
'<p>%s</p>',
sprintf(
/* translators: %s: Version number. */
__( 'WordPress&#8217; utf8mb4 support requires MariaDB version %s or greater. Please contact your server administrator.' ),
'5.5.0'
)
);
} else {
$result['description'] .= sprintf(
'<p>%s</p>',
__( 'Your MariaDB version supports utf8mb4.' )
);
}
}
// phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysqli_get_client_info
$mysql_client_version = mysqli_get_client_info();
/*
* libmysql has supported utf8mb4 since 5.5.3, same as the MySQL server.
* mysqlnd has supported utf8mb4 since 5.0.9.
*/
if ( str_contains( $mysql_client_version, 'mysqlnd' ) ) {
$mysql_client_version = preg_replace( '/^\D+([\d.]+).*/', '$1', $mysql_client_version );
if ( version_compare( $mysql_client_version, '5.0.9', '<' ) ) {
$result['status'] = 'recommended';
$result['label'] = __( 'utf8mb4 requires a newer client library' );
$result['description'] .= sprintf(
'<p>%s</p>',
sprintf(
/* translators: 1: Name of the library, 2: Number of version. */
__( 'WordPress&#8217; utf8mb4 support requires MySQL client library (%1$s) version %2$s or newer. Please contact your server administrator.' ),
'mysqlnd',
'5.0.9'
)
);
}
} else {
if ( version_compare( $mysql_client_version, '5.5.3', '<' ) ) {
$result['status'] = 'recommended';
$result['label'] = __( 'utf8mb4 requires a newer client library' );
$result['description'] .= sprintf(
'<p>%s</p>',
sprintf(
/* translators: 1: Name of the library, 2: Number of version. */
__( 'WordPress&#8217; utf8mb4 support requires MySQL client library (%1$s) version %2$s or newer. Please contact your server administrator.' ),
'libmysql',
'5.5.3'
)
);
}
}
return $result;
}
/**
* Tests if the site can communicate with WordPress.org.
*
@ -1489,7 +1375,7 @@ class WP_Site_Health {
'actions' => sprintf(
'<p><a href="%s" target="_blank" rel="noopener">%s<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
/* translators: Documentation explaining debugging in WordPress. */
esc_url( __( 'https://wordpress.org/documentation/article/debugging-in-wordpress/' ) ),
esc_url( __( 'https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/' ) ),
__( 'Learn more about debugging in WordPress.' ),
/* translators: Hidden accessibility text. */
__( '(opens in a new tab)' )
@ -1953,10 +1839,18 @@ class WP_Site_Health {
$result['description'] = __( 'Could not determine available disk space for updates.' );
$result['status'] = 'recommended';
} elseif ( $available_space < 20 * MB_IN_BYTES ) {
$result['description'] = __( 'Available disk space is critically low, less than 20 MB available. Proceed with caution, updates may fail.' );
$result['description'] = sprintf(
/* translators: %s: Available disk space in MB or GB. */
__( 'Available disk space is critically low, less than %s available. Proceed with caution, updates may fail.' ),
size_format( 20 * MB_IN_BYTES )
);
$result['status'] = 'critical';
} elseif ( $available_space < 100 * MB_IN_BYTES ) {
$result['description'] = __( 'Available disk space is low, less than 100 MB available.' );
$result['description'] = sprintf(
/* translators: %s: Available disk space in MB or GB. */
__( 'Available disk space is low, less than %s available.' ),
size_format( 100 * MB_IN_BYTES )
);
$result['status'] = 'recommended';
}
@ -2504,7 +2398,7 @@ class WP_Site_Health {
'label' => '',
'actions' => sprintf(
'<p><a href="%1$s" target="_blank" rel="noopener noreferrer">%2$s<span class="screen-reader-text"> %3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
__( 'https://wordpress.org/documentation/article/optimization/#Caching' ),
__( 'https://developer.wordpress.org/advanced-administration/performance/optimization/#caching' ),
__( 'Learn more about page cache' ),
/* translators: Hidden accessibility text. */
__( '(opens in a new tab)' )
@ -2613,7 +2507,7 @@ class WP_Site_Health {
$action_url = apply_filters(
'site_status_persistent_object_cache_url',
/* translators: Localized Support reference. */
__( 'https://wordpress.org/documentation/article/optimization/#persistent-object-cache' )
__( 'https://developer.wordpress.org/advanced-administration/performance/optimization/#persistent-object-cache' )
);
$result = array(
@ -2739,10 +2633,6 @@ class WP_Site_Health {
'label' => __( 'Database Server version' ),
'test' => 'sql_server',
),
'utf8mb4_support' => array(
'label' => __( 'MySQL utf8mb4 support' ),
'test' => 'utf8mb4_support',
),
'ssl_support' => array(
'label' => __( 'Secure communication' ),
'test' => 'ssl_support',
@ -3443,12 +3333,12 @@ class WP_Site_Health {
* @since 6.1.0
*
* @return WP_Error|array {
* Page cache detail or else a WP_Error if unable to determine.
* Page cache detail or else a WP_Error if unable to determine.
*
* @type string $status Page cache status. Good, Recommended or Critical.
* @type bool $advanced_cache_present Whether page cache plugin is available or not.
* @type string[] $headers Client caching response headers detected.
* @type float $response_time Response time of site.
* @type string $status Page cache status. Good, Recommended or Critical.
* @type bool $advanced_cache_present Whether page cache plugin is available or not.
* @type string[] $headers Client caching response headers detected.
* @type float $response_time Response time of site.
* }
*/
private function get_page_cache_detail() {

View File

@ -36,7 +36,8 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
require ABSPATH . 'wp-admin/includes/theme-install.php';
global $tabs, $tab, $paged, $type, $theme_field_defaults;
wp_reset_vars( array( 'tab' ) );
$tab = ! empty( $_REQUEST['tab'] ) ? sanitize_text_field( $_REQUEST['tab'] ) : '';
$search_terms = array();
$search_string = '';

View File

@ -20,7 +20,6 @@ class WP_Upgrader_Skin {
* Holds the upgrader data.
*
* @since 2.8.0
*
* @var WP_Upgrader
*/
public $upgrader;
@ -29,7 +28,6 @@ class WP_Upgrader_Skin {
* Whether header is done.
*
* @since 2.8.0
*
* @var bool
*/
public $done_header = false;
@ -38,7 +36,6 @@ class WP_Upgrader_Skin {
* Whether footer is done.
*
* @since 2.8.0
*
* @var bool
*/
public $done_footer = false;
@ -47,7 +44,6 @@ class WP_Upgrader_Skin {
* Holds the result of an upgrade.
*
* @since 2.8.0
*
* @var string|bool|WP_Error
*/
public $result = false;
@ -56,7 +52,6 @@ class WP_Upgrader_Skin {
* Holds the options of an upgrade.
*
* @since 2.8.0
*
* @var array
*/
public $options = array();
@ -82,6 +77,8 @@ class WP_Upgrader_Skin {
}
/**
* Sets the relationship between the skin being used and the upgrader.
*
* @since 2.8.0
*
* @param WP_Upgrader $upgrader
@ -94,6 +91,8 @@ class WP_Upgrader_Skin {
}
/**
* Sets up the strings used in the update process.
*
* @since 3.0.0
*/
public function add_strings() {
@ -141,6 +140,8 @@ class WP_Upgrader_Skin {
}
/**
* Displays the header before the update process.
*
* @since 2.8.0
*/
public function header() {
@ -153,6 +154,8 @@ class WP_Upgrader_Skin {
}
/**
* Displays the footer following the update process.
*
* @since 2.8.0
*/
public function footer() {
@ -164,6 +167,8 @@ class WP_Upgrader_Skin {
}
/**
* Displays an error message about the update.
*
* @since 2.8.0
*
* @param string|WP_Error $errors Errors.
@ -186,6 +191,8 @@ class WP_Upgrader_Skin {
}
/**
* Displays a message about the update.
*
* @since 2.8.0
* @since 5.9.0 Renamed `$string` (a PHP reserved keyword) to `$feedback` for PHP 8 named parameter support.
*
@ -218,7 +225,7 @@ class WP_Upgrader_Skin {
public function before() {}
/**
* Performs and action following an update.
* Performs an action following an update.
*
* @since 2.8.0
*/
@ -262,11 +269,15 @@ class WP_Upgrader_Skin {
}
/**
* Displays the header before the bulk update process.
*
* @since 3.0.0
*/
public function bulk_header() {}
/**
* Displays the footer following the bulk update process.
*
* @since 3.0.0
*/
public function bulk_footer() {}

View File

@ -196,6 +196,7 @@ class WP_Upgrader {
/* translators: %s: Directory name. */
$this->strings['fs_no_folder'] = __( 'Unable to locate needed folder (%s).' );
$this->strings['no_package'] = __( 'Package not available.' );
$this->strings['download_failed'] = __( 'Download failed.' );
$this->strings['installing_package'] = __( 'Installing the latest version&#8230;' );
$this->strings['no_files'] = __( 'The package contains no files.' );
@ -527,7 +528,10 @@ class WP_Upgrader {
set_time_limit( 300 );
}
if ( empty( $source ) || empty( $destination ) ) {
if (
( ! is_string( $source ) || '' === $source || trim( $source ) !== $source ) ||
( ! is_string( $destination ) || '' === $destination || trim( $destination ) !== $destination )
) {
return new WP_Error( 'bad_request', $this->strings['bad_request'] );
}
$this->skin->feedback( 'installing_package' );
@ -897,6 +901,7 @@ class WP_Upgrader {
$this->skin->set_result( $result );
if ( is_wp_error( $result ) ) {
// An automatic plugin update will have already performed its rollback.
if ( ! empty( $options['hook_extra']['temp_backup'] ) ) {
$this->temp_restores[] = $options['hook_extra']['temp_backup'];
@ -905,8 +910,12 @@ class WP_Upgrader {
* Actions running on `shutdown` are immune to PHP timeouts,
* so in case the failure was due to a PHP timeout,
* it will still be able to properly restore the previous version.
*
* Zero arguments are accepted as a string can sometimes be passed
* internally during actions, causing an error because
* `WP_Upgrader::restore_temp_backup()` expects an array.
*/
add_action( 'shutdown', array( $this, 'restore_temp_backup' ) );
add_action( 'shutdown', array( $this, 'restore_temp_backup' ), 10, 0 );
}
$this->skin->error( $result );
@ -979,15 +988,25 @@ class WP_Upgrader {
*/
public function maintenance_mode( $enable = false ) {
global $wp_filesystem;
if ( ! $wp_filesystem ) {
require_once ABSPATH . 'wp-admin/includes/file.php';
WP_Filesystem();
}
$file = $wp_filesystem->abspath() . '.maintenance';
if ( $enable ) {
$this->skin->feedback( 'maintenance_start' );
if ( ! wp_doing_cron() ) {
$this->skin->feedback( 'maintenance_start' );
}
// Create maintenance file to signal that we are upgrading.
$maintenance_string = '<?php $upgrading = ' . time() . '; ?>';
$wp_filesystem->delete( $file );
$wp_filesystem->put_contents( $file, $maintenance_string, FS_CHMOD_FILE );
} elseif ( ! $enable && $wp_filesystem->exists( $file ) ) {
$this->skin->feedback( 'maintenance_end' );
if ( ! wp_doing_cron() ) {
$this->skin->feedback( 'maintenance_end' );
}
$wp_filesystem->delete( $file );
}
}
@ -1012,7 +1031,7 @@ class WP_Upgrader {
$lock_option = $lock_name . '.lock';
// Try to lock.
$lock_result = $wpdb->query( $wpdb->prepare( "INSERT IGNORE INTO `$wpdb->options` ( `option_name`, `option_value`, `autoload` ) VALUES (%s, %s, 'no') /* LOCK */", $lock_option, time() ) );
$lock_result = $wpdb->query( $wpdb->prepare( "INSERT IGNORE INTO `$wpdb->options` ( `option_name`, `option_value`, `autoload` ) VALUES (%s, %s, 'off') /* LOCK */", $lock_option, time() ) );
if ( ! $lock_result ) {
$lock_result = get_option( $lock_option );
@ -1129,17 +1148,33 @@ class WP_Upgrader {
* Restores the plugin or theme from temporary backup.
*
* @since 6.3.0
* @since 6.6.0 Added the `$temp_backups` parameter.
*
* @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
*
* @param array[] $temp_backups {
* Optional. An array of temporary backups.
*
* @type array ...$0 {
* Information about the backup.
*
* @type string $dir The temporary backup location in the upgrade-temp-backup directory.
* @type string $slug The item's slug.
* @type string $src The directory where the original is stored. For example, `WP_PLUGIN_DIR`.
* }
* }
* @return bool|WP_Error True on success, false on early exit, otherwise WP_Error.
*/
public function restore_temp_backup() {
public function restore_temp_backup( array $temp_backups = array() ) {
global $wp_filesystem;
$errors = new WP_Error();
foreach ( $this->temp_restores as $args ) {
if ( empty( $temp_backups ) ) {
$temp_backups = $this->temp_restores;
}
foreach ( $temp_backups as $args ) {
if ( empty( $args['slug'] ) || empty( $args['src'] ) || empty( $args['dir'] ) ) {
return false;
}
@ -1182,17 +1217,33 @@ class WP_Upgrader {
* Deletes a temporary backup.
*
* @since 6.3.0
* @since 6.6.0 Added the `$temp_backups` parameter.
*
* @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
*
* @param array[] $temp_backups {
* Optional. An array of temporary backups.
*
* @type array ...$0 {
* Information about the backup.
*
* @type string $dir The temporary backup location in the upgrade-temp-backup directory.
* @type string $slug The item's slug.
* @type string $src The directory where the original is stored. For example, `WP_PLUGIN_DIR`.
* }
* }
* @return bool|WP_Error True on success, false on early exit, otherwise WP_Error.
*/
public function delete_temp_backup() {
public function delete_temp_backup( array $temp_backups = array() ) {
global $wp_filesystem;
$errors = new WP_Error();
foreach ( $this->temp_backups as $args ) {
if ( empty( $temp_backups ) ) {
$temp_backups = $this->temp_backups;
}
foreach ( $temp_backups as $args ) {
if ( empty( $args['slug'] ) || empty( $args['dir'] ) ) {
return false;
}

View File

@ -401,7 +401,7 @@ function export_wp( $args = array() ) {
*
* @param int[] $post_ids Optional. Array of post IDs to filter the query by.
*/
function wxr_authors_list( array $post_ids = null ) {
function wxr_authors_list( ?array $post_ids = null ) {
global $wpdb;
if ( ! empty( $post_ids ) ) {

View File

@ -326,7 +326,7 @@ function wp_print_file_editor_templates() {
printf(
/* translators: %s: Documentation URL. */
__( 'You need to make this file writable before you can save your changes. See <a href="%s">Changing File Permissions</a> for more information.' ),
__( 'https://wordpress.org/documentation/article/changing-file-permissions/' )
__( 'https://developer.wordpress.org/advanced-administration/server/file-permissions/' )
);
?>
</p>
@ -1089,7 +1089,7 @@ function _wp_handle_upload( &$file, $overrides, $time, $action ) {
* @param array|false $overrides Optional. An associative array of names => values
* to override default variables. Default false.
* See _wp_handle_upload() for accepted values.
* @param string $time Optional. Time formatted in 'yyyy/mm'. Default null.
* @param string|null $time Optional. Time formatted in 'yyyy/mm'. Default null.
* @return array See _wp_handle_upload() for return value.
*/
function wp_handle_upload( &$file, $overrides = false, $time = null ) {
@ -1120,7 +1120,7 @@ function wp_handle_upload( &$file, $overrides = false, $time = null ) {
* @param array|false $overrides Optional. An associative array of names => values
* to override default variables. Default false.
* See _wp_handle_upload() for accepted values.
* @param string $time Optional. Time formatted in 'yyyy/mm'. Default null.
* @param string|null $time Optional. Time formatted in 'yyyy/mm'. Default null.
* @return array See _wp_handle_upload() for return value.
*/
function wp_handle_sideload( &$file, $overrides = false, $time = null ) {
@ -2249,7 +2249,7 @@ function WP_Filesystem( $args = false, $context = false, $allow_relaxed_file_own
* The return value can be overridden by defining the `FS_METHOD` constant in `wp-config.php`,
* or filtering via {@see 'filesystem_method'}.
*
* @link https://wordpress.org/documentation/article/editing-wp-config-php/#wordpress-upgrade-constants
* @link https://developer.wordpress.org/advanced-administration/wordpress/wp-config/#wordpress-upgrade-constants
*
* Plugins may define a custom transport handler, See WP_Filesystem().
*
@ -2664,7 +2664,7 @@ function request_filesystem_credentials( $form_post, $type = '', $error = false,
<p class="request-filesystem-credentials-action-buttons">
<?php wp_nonce_field( 'filesystem-credentials', '_fs_nonce', false, true ); ?>
<button class="button cancel-button" data-js-action="close" type="button"><?php _e( 'Cancel' ); ?></button>
<?php submit_button( __( 'Proceed' ), '', 'upgrade', false ); ?>
<?php submit_button( __( 'Proceed' ), 'primary', 'upgrade', false ); ?>
</p>
</div>
</form>

View File

@ -1679,13 +1679,15 @@ function register_and_do_post_meta_boxes( $post ) {
add_meta_box( 'commentstatusdiv', __( 'Discussion' ), 'post_comment_status_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
}
$stati = get_post_stati( array( 'public' => true ) );
if ( empty( $stati ) ) {
$stati = array( 'publish' );
}
$stati[] = 'private';
$statuses = get_post_stati( array( 'public' => true ) );
if ( in_array( get_post_status( $post ), $stati, true ) ) {
if ( empty( $statuses ) ) {
$statuses = array( 'publish' );
}
$statuses[] = 'private';
if ( in_array( get_post_status( $post ), $statuses, true ) ) {
/*
* If the post type support comments, or the post has comments,
* allow the Comments meta box.

View File

@ -556,7 +556,7 @@ function wp_print_plugin_file_tree( $tree, $label = '', $level = 2, $size = 1, $
}
/**
* Flushes rewrite rules if siteurl, home or page_on_front changed.
* Flushes rewrite rules if `siteurl`, `home` or `page_on_front` changed.
*
* @since 2.1.0
*
@ -575,13 +575,12 @@ function update_home_siteurl( $old_value, $value ) {
}
}
/**
* Resets global variables based on $_GET and $_POST.
* Resets global variables based on `$_GET` and `$_POST`.
*
* This function resets global variables based on the names passed
* in the $vars array to the value of $_POST[$var] or $_GET[$var] or ''
* if neither is defined.
* in the `$vars` array to the value of `$_POST[$var]` or `$_GET[$var]` or an
* empty string if neither is defined.
*
* @since 2.0.0
*
@ -755,7 +754,7 @@ function set_screen_options() {
/**
* Filters a screen option value before it is set.
*
* The filter can also be used to modify non-standard [items]_per_page
* The filter can also be used to modify non-standard `[items]_per_page`
* settings. See the parent function for a full list of standard options.
*
* Returning false from the filter will skip saving the current option.
@ -1305,7 +1304,7 @@ function wp_refresh_metabox_loader_nonces( $response, $data ) {
}
/**
* Adds the latest Heartbeat and REST-API nonce to the Heartbeat response.
* Adds the latest Heartbeat and REST API nonce to the Heartbeat response.
*
* @since 5.0.0
*
@ -1399,11 +1398,11 @@ function wp_admin_canonical_url() {
$filtered_url = remove_query_arg( $removable_query_args, $current_url );
/**
* Filters the admin canonical url value.
* Filters the admin canonical URL value.
*
* @since 6.5.0
*
* @param string $filtered_url The admin canonical url value.
* @param string $filtered_url The admin canonical URL value.
*/
$filtered_url = apply_filters( 'wp_admin_canonical_url', $filtered_url );
?>
@ -1647,8 +1646,8 @@ function wp_check_php_version() {
$response['is_lower_than_future_minimum'] = false;
// The minimum supported PHP version will be updated to 7.2. Check if the current version is lower.
if ( version_compare( $version, '7.2', '<' ) ) {
// The minimum supported PHP version will be updated to 7.4 in the future. Check if the current version is lower.
if ( version_compare( $version, '7.4', '<' ) ) {
$response['is_lower_than_future_minimum'] = true;
// Force showing of warnings.

View File

@ -1169,6 +1169,6 @@ function get_site_screen_help_tab_args() {
*/
function get_site_screen_help_sidebar_content() {
return '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://wordpress.org/documentation/article/network-admin-sites-screen/">Documentation on Site Management</a>' ) . '</p>' .
'<p>' . __( '<a href="https://developer.wordpress.org/advanced-administration/multisite/admin/#network-admin-sites-screen">Documentation on Site Management</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/forum/multisite/">Support forums</a>' ) . '</p>';
}

View File

@ -33,8 +33,9 @@ function network_domain_check() {
* @return bool Whether subdomain installation is allowed
*/
function allow_subdomain_install() {
$domain = preg_replace( '|https?://([^/]+)|', '$1', get_option( 'home' ) );
if ( parse_url( get_option( 'home' ), PHP_URL_PATH ) || 'localhost' === $domain || preg_match( '|^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$|', $domain ) ) {
$home = get_option( 'home' );
$domain = parse_url( $home, PHP_URL_HOST );
if ( parse_url( $home, PHP_URL_PATH ) || 'localhost' === $domain || preg_match( '|^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$|', $domain ) ) {
return false;
}
@ -148,26 +149,8 @@ function network_step1( $errors = false ) {
die();
}
$hostname = get_clean_basedomain();
$has_ports = strstr( $hostname, ':' );
if ( ( false !== $has_ports && ! in_array( $has_ports, array( ':80', ':443' ), true ) ) ) {
wp_admin_notice(
'<strong>' . __( 'Error:' ) . '</strong> ' . __( 'You cannot install a network of sites with your server address.' ),
array(
'additional_classes' => array( 'error' ),
)
);
echo '<p>' . sprintf(
/* translators: %s: Port number. */
__( 'You cannot use port numbers such as %s.' ),
'<code>' . $has_ports . '</code>'
) . '</p>';
echo '<a href="' . esc_url( admin_url() ) . '">' . __( 'Go to Dashboard' ) . '</a>';
echo '</div>';
require_once ABSPATH . 'wp-admin/admin-footer.php';
die();
}
// Strip standard port from hostname.
$hostname = preg_replace( '/(?::80|:443)$/', '', get_clean_basedomain() );
echo '<form method="post">';
@ -694,7 +677,7 @@ define( 'BLOG_ID_CURRENT_SITE', 1 );
printf(
/* translators: %s: Documentation URL. */
__( 'It seems your network is running with Nginx web server. <a href="%s">Learn more about further configuration</a>.' ),
__( 'https://wordpress.org/documentation/article/nginx/' )
__( 'https://developer.wordpress.org/advanced-administration/server/web-server/nginx/' )
);
echo '</p></li>';

View File

@ -320,6 +320,8 @@ function install_search_form( $deprecated = true ) {
?>
<form class="search-form search-plugins" method="get">
<input type="hidden" name="tab" value="search" />
<label for="search-plugins"><?php _e( 'Search Plugins' ); ?></label>
<input type="search" name="s" id="search-plugins" value="<?php echo esc_attr( $term ); ?>" class="wp-filter-search" />
<label class="screen-reader-text" for="typeselector">
<?php
/* translators: Hidden accessibility text. */
@ -331,13 +333,6 @@ function install_search_form( $deprecated = true ) {
<option value="author"<?php selected( 'author', $type ); ?>><?php _e( 'Author' ); ?></option>
<option value="tag"<?php selected( 'tag', $type ); ?>><?php _ex( 'Tag', 'Plugin Installer' ); ?></option>
</select>
<label class="screen-reader-text" for="search-plugins">
<?php
/* translators: Hidden accessibility text. */
_e( 'Search Plugins' );
?>
</label>
<input type="search" name="s" id="search-plugins" value="<?php echo esc_attr( $term ); ?>" class="wp-filter-search" placeholder="<?php esc_attr_e( 'Search plugins...' ); ?>" />
<?php submit_button( __( 'Search Plugins' ), 'hide-if-js', false, false, array( 'id' => 'search-submit' ) ); ?>
</form>
<?php
@ -917,7 +912,7 @@ function install_plugin_information() {
* }
* @param bool $compatible_php The result of a PHP compatibility check.
* @param bool $compatible_wp The result of a WP compatibility check.
* @return string $button The markup for the dependency row button.
* @return string The markup for the dependency row button.
*/
function wp_get_plugin_action_button( $name, $data, $compatible_php, $compatible_wp ) {
$button = '';
@ -948,7 +943,7 @@ function wp_get_plugin_action_button( $name, $data, $compatible_php, $compatible
$all_plugin_dependencies_active = $active_plugin_dependencies_count === $plugin_dependencies_count;
sprintf(
'<a class="install-now button" data-slug="%s" href="%s" aria-label="%s" data-name="%s">%s</a>',
'<a class="install-now button" data-slug="%s" href="%s" aria-label="%s" data-name="%s" role="button">%s</a>',
esc_attr( $data->slug ),
esc_url( $status['url'] ),
/* translators: %s: Plugin name and version. */
@ -963,7 +958,7 @@ function wp_get_plugin_action_button( $name, $data, $compatible_php, $compatible
if ( $status['url'] ) {
if ( $compatible_php && $compatible_wp && $all_plugin_dependencies_installed && ! empty( $data->download_link ) ) {
$button = sprintf(
'<a class="install-now button" data-slug="%s" href="%s" aria-label="%s" data-name="%s">%s</a>',
'<a class="install-now button" data-slug="%s" href="%s" aria-label="%s" data-name="%s" role="button">%s</a>',
esc_attr( $data->slug ),
esc_url( $status['url'] ),
/* translators: %s: Plugin name and version. */
@ -984,7 +979,7 @@ function wp_get_plugin_action_button( $name, $data, $compatible_php, $compatible
if ( $status['url'] ) {
if ( $compatible_php && $compatible_wp ) {
$button = sprintf(
'<a class="update-now button aria-button-if-js" data-plugin="%s" data-slug="%s" href="%s" aria-label="%s" data-name="%s">%s</a>',
'<a class="update-now button aria-button-if-js" data-plugin="%s" data-slug="%s" href="%s" aria-label="%s" data-name="%s" role="button">%s</a>',
esc_attr( $status['file'] ),
esc_attr( $data->slug ),
esc_url( $status['url'] ),
@ -1031,7 +1026,7 @@ function wp_get_plugin_action_button( $name, $data, $compatible_php, $compatible
}
$button = sprintf(
'<a href="%1$s" data-name="%2$s" data-slug="%3$s" data-plugin="%4$s" class="button button-primary activate-now" aria-label="%5$s">%6$s</a>',
'<a href="%1$s" data-name="%2$s" data-slug="%3$s" data-plugin="%4$s" class="button button-primary activate-now" aria-label="%5$s" role="button">%6$s</a>',
esc_url( $activate_url ),
esc_attr( $name ),
esc_attr( $data->slug ),

View File

@ -319,10 +319,8 @@ function get_plugins( $plugin_folder = '' ) {
closedir( $plugins_subdir );
}
} else {
if ( str_ends_with( $file, '.php' ) ) {
$plugin_files[] = $file;
}
} elseif ( str_ends_with( $file, '.php' ) ) {
$plugin_files[] = $file;
}
}

View File

@ -1084,7 +1084,7 @@ function get_post_meta_by_id( $mid ) {
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param int $postid A post ID.
* @param int $post_id A post ID.
* @return array[] {
* Array of meta data arrays for the given post ID.
*
@ -1098,7 +1098,7 @@ function get_post_meta_by_id( $mid ) {
* }
* }
*/
function has_meta( $postid ) {
function has_meta( $post_id ) {
global $wpdb;
return $wpdb->get_results(
@ -1106,7 +1106,7 @@ function has_meta( $postid ) {
"SELECT meta_key, meta_value, meta_id, post_id
FROM $wpdb->postmeta WHERE post_id = %d
ORDER BY meta_key,meta_id",
$postid
$post_id
),
ARRAY_A
);
@ -1199,9 +1199,9 @@ function _fix_attachment_links( $post ) {
* @return string[] An array of all the statuses for the supplied post type.
*/
function get_available_post_statuses( $type = 'post' ) {
$stati = wp_count_posts( $type );
$statuses = wp_count_posts( $type );
return array_keys( get_object_vars( $stati ) );
return array_keys( get_object_vars( $statuses ) );
}
/**
@ -1217,9 +1217,11 @@ function wp_edit_posts_query( $q = false ) {
if ( false === $q ) {
$q = $_GET;
}
$q['m'] = isset( $q['m'] ) ? (int) $q['m'] : 0;
$q['cat'] = isset( $q['cat'] ) ? (int) $q['cat'] : 0;
$post_stati = get_post_stati();
$q['m'] = isset( $q['m'] ) ? (int) $q['m'] : 0;
$q['cat'] = isset( $q['cat'] ) ? (int) $q['cat'] : 0;
$post_statuses = get_post_stati();
if ( isset( $q['post_type'] ) && in_array( $q['post_type'], get_post_types(), true ) ) {
$post_type = $q['post_type'];
@ -1231,7 +1233,7 @@ function wp_edit_posts_query( $q = false ) {
$post_status = '';
$perm = '';
if ( isset( $q['post_status'] ) && in_array( $q['post_status'], $post_stati, true ) ) {
if ( isset( $q['post_status'] ) && in_array( $q['post_status'], $post_statuses, true ) ) {
$post_status = $q['post_status'];
$perm = 'readable';
}

View File

@ -594,9 +594,9 @@ function populate_options( array $options = array() ) {
}
if ( in_array( $option, $fat_options, true ) ) {
$autoload = 'no';
$autoload = 'off';
} else {
$autoload = 'yes';
$autoload = 'on';
}
if ( ! empty( $insert ) ) {

View File

@ -753,6 +753,18 @@ $_old_files = array(
'wp-includes/navigation-fallback.php',
'wp-includes/blocks/navigation/view-modal.min.js',
'wp-includes/blocks/navigation/view-modal.js',
// 6.5
'wp-includes/ID3/license.commercial.txt',
'wp-includes/blocks/query/style-rtl.min.css',
'wp-includes/blocks/query/style.min.css',
'wp-includes/blocks/query/style-rtl.css',
'wp-includes/blocks/query/style.css',
'wp-admin/images/about-header-privacy.svg',
'wp-admin/images/about-header-about.svg',
'wp-admin/images/about-header-credits.svg',
'wp-admin/images/about-header-freedoms.svg',
'wp-admin/images/about-header-contribute.svg',
'wp-admin/images/about-header-background.svg',
);
/**

View File

@ -923,48 +923,14 @@ function wp_print_admin_notice_templates() {
<div <# if ( data.id ) { #>id="{{ data.id }}"<# } #> class="notice {{ data.className }}"><p>{{{ data.message }}}</p></div>
</script>
<script id="tmpl-wp-bulk-updates-admin-notice" type="text/html">
<div id="{{ data.id }}" class="{{ data.className }} notice <# if ( data.errors ) { #>notice-error<# } else { #>notice-success<# } #>">
<div id="{{ data.id }}" class="{{ data.className }} notice <# if ( data.errorMessage ) { #>notice-error<# } else { #>notice-success<# } #>">
<p>
<# if ( data.successes ) { #>
<# if ( 1 === data.successes ) { #>
<# if ( 'plugin' === data.type ) { #>
<?php
/* translators: %s: Number of plugins. */
printf( __( '%s plugin successfully updated.' ), '{{ data.successes }}' );
?>
<# } else { #>
<?php
/* translators: %s: Number of themes. */
printf( __( '%s theme successfully updated.' ), '{{ data.successes }}' );
?>
<# } #>
<# } else { #>
<# if ( 'plugin' === data.type ) { #>
<?php
/* translators: %s: Number of plugins. */
printf( __( '%s plugins successfully updated.' ), '{{ data.successes }}' );
?>
<# } else { #>
<?php
/* translators: %s: Number of themes. */
printf( __( '%s themes successfully updated.' ), '{{ data.successes }}' );
?>
<# } #>
<# } #>
<# if ( data.successMessage ) { #>
{{{ data.successMessage }}}
<# } #>
<# if ( data.errors ) { #>
<# if ( data.errorMessage ) { #>
<button class="button-link bulk-action-errors-collapsed" aria-expanded="false">
<# if ( 1 === data.errors ) { #>
<?php
/* translators: %s: Number of failed updates. */
printf( __( '%s update failed.' ), '{{ data.errors }}' );
?>
<# } else { #>
<?php
/* translators: %s: Number of failed updates. */
printf( __( '%s updates failed.' ), '{{ data.errors }}' );
?>
<# } #>
{{{ data.errorMessage }}}
<span class="screen-reader-text">
<?php
/* translators: Hidden accessibility text. */
@ -975,7 +941,7 @@ function wp_print_admin_notice_templates() {
</button>
<# } #>
</p>
<# if ( data.errors ) { #>
<# if ( data.errorMessages ) { #>
<ul class="bulk-action-errors hidden">
<# _.each( data.errorMessages, function( errorMessage ) { #>
<li>{{ errorMessage }}</li>

View File

@ -147,7 +147,7 @@ if ( ! function_exists( 'wp_install_defaults' ) ) :
*
* @global wpdb $wpdb WordPress database abstraction object.
* @global WP_Rewrite $wp_rewrite WordPress rewrite component.
* @global string $table_prefix
* @global string $table_prefix The database table prefix.
*
* @param int $user_id User ID.
*/

View File

@ -1799,7 +1799,7 @@
section.closeDetails();
} else {
// Escape from the inifinite scroll list.
// Escape from the infinite scroll list.
section.headerContainer.find( '.customize-themes-section-title' ).focus();
}
event.stopPropagation(); // Prevent section from being collapsed.
@ -1917,7 +1917,7 @@
section.contentContainer.on( 'click', '.feature-filter-toggle', function( e ) {
var $themeContainer = $( '.customize-themes-full-container' ),
$filterToggle = $( e.currentTarget );
section.filtersHeight = $filterToggle.parent().next( '.filter-drawer' ).height();
section.filtersHeight = $filterToggle.parents( '.themes-filter-bar' ).next( '.filter-drawer' ).height();
if ( 0 < $themeContainer.scrollTop() ) {
$themeContainer.animate( { scrollTop: 0 }, 400 );
@ -1932,7 +1932,7 @@
.attr( 'aria-expanded', function( i, attr ) {
return 'true' === attr ? 'false' : 'true';
})
.parent().next( '.filter-drawer' ).slideToggle( 180, 'linear' );
.parents( '.themes-filter-bar' ).next( '.filter-drawer' ).slideToggle( 180, 'linear' );
if ( $filterToggle.hasClass( 'open' ) ) {
var marginOffset = 1018 < window.innerWidth ? 50 : 76;
@ -3739,7 +3739,7 @@
ready: function() {
var control = this, newItem;
if ( 'dropdown-pages' === control.params.type && control.params.allow_addition ) {
newItem = control.container.find( '.new-content-item' );
newItem = control.container.find( '.new-content-item-wrapper' );
newItem.hide(); // Hide in JS to preserve flex display when showing.
control.container.on( 'click', '.add-new-toggle', function( e ) {
$( e.currentTarget ).slideUp( 180 );
@ -4085,7 +4085,7 @@
}
toggle = control.container.find( '.add-new-toggle' );
container = control.container.find( '.new-content-item' );
container = control.container.find( '.new-content-item-wrapper' );
input = control.container.find( '.create-item-input' );
title = input.val();
select = control.container.find( 'select' );
@ -7199,7 +7199,7 @@
} ) );
/**
* Return whether the pubish settings section should be active.
* Return whether the publish settings section should be active.
*
* @return {boolean} Is section active.
*/

File diff suppressed because one or more lines are too long

View File

@ -388,7 +388,7 @@
},
/**
* Adds keyboard accessiblity to the panel.
* Adds keyboard accessibility to the panel.
*/
keyboardAccessible: function( event ) {
var isEnter = ( event.which === 13 ),

View File

@ -92,7 +92,7 @@ jQuery( function($) {
setTimeout( function(){
// Request the widget content.
p.load( ajaxurl + '?action=dashboard-widgets&widget=' + id + '&pagenow=' + pagenow, '', function() {
// Hide the parent and slide it out for visual fancyness.
// Hide the parent and slide it out for visual fanciness.
p.hide().slideDown('normal', function(){
$(this).css('display', '');
});

View File

@ -1552,7 +1552,7 @@
// Bind and unbind based on the distraction free writing focus.
$document.on( 'dfw-on.focus', mceBind ).on( 'dfw-off.focus', mceUnbind );
// Focuse the editor when it is the target of the click event.
// Focus the editor when it is the target of the click event.
editor.on( 'click', function( event ) {
if ( event.target === editor.getDoc().documentElement ) {
editor.focus();

View File

@ -265,7 +265,7 @@ window.wp = window.wp || {};
}
/**
* Gets a list of unique shortcodes or shortcode-look-alikes in the content.
* Gets a list of unique shortcodes or shortcode-lookalikes in the content.
*
* @param {string} content The content we want to scan for shortcodes.
*/
@ -561,7 +561,7 @@ window.wp = window.wp || {};
* By default TinyMCE wraps loose inline tags in a `<p>`.
* When removing selection markers an empty `<p>` may be left behind, remove it.
*
* @param {Object} $marker The marker to be removed from the editor DOM, wrapped in an instnce of `editor.$`
* @param {Object} $marker The marker to be removed from the editor DOM, wrapped in an instance of `editor.$`
*/
function removeSelectionMarker( $marker ) {
var $markerParent = $marker.parent();

View File

@ -191,7 +191,7 @@ wp.themePluginEditor = (function( $ ) {
return;
}
// Scroll ot the line that has the error.
// Scroll to the line that has the error.
if ( component.lintErrors.length ) {
component.instance.codemirror.setCursor( component.lintErrors[0].from.line );
return;

View File

@ -926,7 +926,7 @@ themes.view.Preview = themes.view.Details.extend({
currentPreviewDevice = this.$el.data( 'current-preview-device' );
if ( currentPreviewDevice ) {
self.tooglePreviewDeviceButtons( currentPreviewDevice );
self.togglePreviewDeviceButtons( currentPreviewDevice );
}
themes.router.navigate( themes.router.baseUrl( themes.router.themePath + this.model.get( 'id' ) ), { replace: false } );
@ -988,10 +988,10 @@ themes.view.Preview = themes.view.Details.extend({
.addClass( 'preview-' + device )
.data( 'current-preview-device', device );
this.tooglePreviewDeviceButtons( device );
this.togglePreviewDeviceButtons( device );
},
tooglePreviewDeviceButtons: function( newDevice ) {
togglePreviewDeviceButtons: function( newDevice ) {
var $devices = $( '.wp-full-overlay-footer .devices' );
$devices.find( 'button' )

File diff suppressed because one or more lines are too long

View File

@ -1105,21 +1105,33 @@
*
* @since 6.5.0
*
* @param {Object} response Response from the server.
* @param {string} response.slug Slug of the activated plugin.
* @param {string} response.pluginName Name of the activated plugin.
* @param {string} response.plugin The plugin file, relative to the plugins directory.
* @param {Object} response Response from the server.
* @param {string} response.slug Slug of the activated plugin.
* @param {string} response.pluginName Name of the activated plugin.
* @param {string} response.plugin The plugin file, relative to the plugins directory.
*/
wp.updates.activatePluginSuccess = function( response ) {
var $message = $( '.plugin-card-' + response.slug + ', #plugin-information-footer' ).find( '.activating-message' ),
isInModal = 'plugin-information-footer' === $message.parent().attr( 'id' ),
buttonText = _x( 'Activated!', 'plugin' ),
ariaLabel = sprintf(
/* translators: %s: The plugin name. */
'%s activated successfully.',
response.pluginName
);
),
noticeData = {
id: 'plugin-activated-successfully',
className: 'notice-success',
message: sprintf(
/* translators: %s: The refresh link's attributes. */
__( 'Plugin activated. Some changes may not occur until you refresh the page. <a %s>Refresh Now</a>' ),
'href="#" class="button button-secondary refresh-page"'
),
slug: response.slug
},
noticeTarget;
wp.a11y.speak( __( 'Activation completed successfully.' ) );
wp.a11y.speak( __( 'Activation completed successfully. Some changes may not occur until you refresh the page.' ) );
$document.trigger( 'wp-plugin-activate-success', response );
$message
@ -1128,7 +1140,7 @@
.attr( 'aria-label', ariaLabel )
.text( buttonText );
if ( 'plugin-information-footer' === $message.parent().attr( 'id' ) ) {
if ( isInModal ) {
wp.updates.setCardButtonStatus(
{
status: 'activated-plugin',
@ -1139,13 +1151,26 @@
ariaLabel: ariaLabel
}
);
// Add a notice to the modal's footer.
$message.replaceWith( wp.updates.adminNotice( noticeData ) );
// Send notice information back to the parent screen.
noticeTarget = window.parent === window ? null : window.parent;
$.support.postMessage = !! window.postMessage;
if ( false !== $.support.postMessage && null !== noticeTarget && -1 === window.parent.location.pathname.indexOf( 'index.php' ) ) {
noticeTarget.postMessage(
JSON.stringify( noticeData ),
window.location.origin
);
}
} else {
// Add a notice to the top of the screen.
wp.updates.addAdminNotice( noticeData );
}
setTimeout( function() {
$message.removeClass( 'activated-message' )
.text( _x( 'Active', 'plugin' ) );
if ( 'plugin-information-footer' === $message.parent().attr( 'id' ) ) {
if ( isInModal ) {
wp.updates.setCardButtonStatus(
{
status: 'plugin-active',
@ -1159,6 +1184,8 @@
)
}
);
} else {
$message.removeClass( 'activated-message' ).text( _x( 'Active', 'plugin' ) );
}
}, 1000 );
};
@ -2938,13 +2965,41 @@
wp.updates.adminNotice = wp.template( 'wp-bulk-updates-admin-notice' );
var successMessage = null;
if ( success ) {
if ( 'plugin' === response.update ) {
successMessage = sprintf(
/* translators: %s: Number of plugins. */
_n( '%s plugin successfully updated.', '%s plugins successfully updated.', success ),
success
);
} else {
successMessage = sprintf(
/* translators: %s: Number of themes. */
_n( '%s theme successfully updated.', '%s themes successfully updated.', success ),
success
);
}
}
var errorMessage = null;
if ( error ) {
errorMessage = sprintf(
/* translators: %s: Number of failed updates. */
_n( '%s update failed.', '%s updates failed.', error ),
error
);
}
wp.updates.addAdminNotice( {
id: 'bulk-action-notice',
className: 'bulk-action-notice',
successes: success,
errors: error,
errorMessages: errorMessages,
type: response.update
successMessage: successMessage,
errorMessage: errorMessage,
errorMessages: errorMessages,
type: response.update
} );
$bulkActionNotice = $( '#bulk-action-notice' ).on( 'click', 'button', function() {
@ -3226,6 +3281,11 @@
return;
}
if ( 'undefined' !== typeof message.id && 'plugin-activated-successfully' === message.id ) {
wp.updates.addAdminNotice( message );
return;
}
if (
'undefined' !== typeof message.status &&
'undefined' !== typeof message.slug &&
@ -3458,5 +3518,22 @@
} );
}
);
/**
* Click handler for page refresh link.
*
* @since 6.5.3
*
* @param {Event} event Event interface.
*/
$document.on( 'click', '.refresh-page', function( event ) {
event.preventDefault();
if ( window.parent === window ) {
window.location.reload();
} else {
window.parent.location.reload();
}
} );
} );
})( jQuery, window.wp, window._wpUpdatesSettings );

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,7 @@
/* global ajaxurl, pwsL10n, userProfileL10n */
(function($) {
var updateLock = false,
isSubmitting = false,
__ = wp.i18n.__,
$pass1Row,
$pass1,
@ -15,6 +16,8 @@
$submitButtons,
$submitButton,
currentPass,
$form,
originalFormContent,
$passwordWrapper;
function generatePassword() {
@ -454,6 +457,12 @@
bindPasswordForm();
bindPasswordResetLink();
$submitButtons.on( 'click', function() {
isSubmitting = true;
});
$form = $( '#your-profile, #createuser' );
originalFormContent = $form.serialize();
});
$( '#destroy-sessions' ).on( 'click', function( e ) {
@ -481,7 +490,10 @@
if ( true === updateLock ) {
return __( 'Your new password has not been saved.' );
}
} );
if ( originalFormContent !== $form.serialize() && ! isSubmitting ) {
return __( 'The changes you made will be lost if you navigate away from this page.' );
}
});
/*
* We need to generate a password as soon as the Reset Password page is loaded,

File diff suppressed because one or more lines are too long

View File

@ -17,7 +17,9 @@ if ( ! current_user_can( 'manage_links' ) ) {
$title = __( 'Add New Link' );
$parent_file = 'link-manager.php';
wp_reset_vars( array( 'action', 'cat_id', 'link_id' ) );
$action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : '';
$cat_id = ! empty( $_REQUEST['cat_id'] ) ? absint( $_REQUEST['cat_id'] ) : 0;
$link_id = ! empty( $_REQUEST['link_id'] ) ? absint( $_REQUEST['link_id'] ) : 0;
wp_enqueue_script( 'link' );
wp_enqueue_script( 'xfn' );

View File

@ -12,7 +12,9 @@
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
wp_reset_vars( array( 'action', 'cat_id', 'link_id' ) );
$action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : '';
$cat_id = ! empty( $_REQUEST['cat_id'] ) ? absint( $_REQUEST['cat_id'] ) : 0;
$link_id = ! empty( $_REQUEST['link_id'] ) ? absint( $_REQUEST['link_id'] ) : 0;
if ( ! current_user_can( 'manage_links' ) ) {
wp_link_manager_disabled_message();

View File

@ -45,7 +45,26 @@ wp_default_scripts( $wp_scripts );
wp_default_packages_vendor( $wp_scripts );
wp_default_packages_scripts( $wp_scripts );
if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) && stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) === $wp_version ) {
$etag = "WP:{$wp_version};";
foreach ( $load as $handle ) {
if ( ! array_key_exists( $handle, $wp_scripts->registered ) ) {
continue;
}
$ver = $wp_scripts->registered[ $handle ]->ver ? $wp_scripts->registered[ $handle ]->ver : $wp_version;
$etag .= "{$handle}:{$ver};";
}
/*
* This is not intended to be cryptographically secure, just a fast way to get
* a fixed length string based on the script versions. As this file does not
* load the full WordPress environment, it is not possible to use the salted
* wp_hash() function.
*/
$etag = 'W/"' . md5( $etag ) . '"';
if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) && stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) === $etag ) {
header( "$protocol 304 Not Modified" );
exit;
}
@ -59,7 +78,7 @@ foreach ( $load as $handle ) {
$out .= get_file( $path ) . "\n";
}
header( "Etag: $wp_version" );
header( "Etag: $etag" );
header( 'Content-Type: application/javascript; charset=UTF-8' );
header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expires_offset ) . ' GMT' );
header( "Cache-Control: public, max-age=$expires_offset" );

View File

@ -48,7 +48,26 @@ $out = '';
$wp_styles = new WP_Styles();
wp_default_styles( $wp_styles );
if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) && stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) === $wp_version ) {
$etag = "WP:{$wp_version};";
foreach ( $load as $handle ) {
if ( ! array_key_exists( $handle, $wp_styles->registered ) ) {
continue;
}
$ver = $wp_styles->registered[ $handle ]->ver ? $wp_styles->registered[ $handle ]->ver : $wp_version;
$etag .= "{$handle}:{$ver};";
}
/*
* This is not intended to be cryptographically secure, just a fast way to get
* a fixed length string based on the script versions. As this file does not
* load the full WordPress environment, it is not possible to use the salted
* wp_hash() function.
*/
$etag = 'W/"' . md5( $etag ) . '"';
if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) && stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) === $etag ) {
header( "$protocol 304 Not Modified" );
exit;
}
@ -84,7 +103,7 @@ foreach ( $load as $handle ) {
}
}
header( "Etag: $wp_version" );
header( "Etag: $etag" );
header( 'Content-Type: text/css; charset=UTF-8' );
header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expires_offset ) . ' GMT' );
header( "Cache-Control: public, max-age=$expires_offset" );

View File

@ -15,7 +15,7 @@ require_once __DIR__ . '/admin.php';
$parent_file = 'upload.php';
$submenu_file = 'upload.php';
wp_reset_vars( array( 'action' ) );
$action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : '';
switch ( $action ) {
case 'editattachment':

View File

@ -206,7 +206,7 @@ if ( ! is_multisite() && current_user_can( 'update_themes' ) ) {
if ( wp_is_block_theme() ) {
$submenu['themes.php'][6] = array( _x( 'Editor', 'site editor menu item' ), 'edit_theme_options', 'site-editor.php' );
} else {
$submenu['themes.php'][6] = array( __( 'Patterns', 'site editor menu item' ), 'edit_theme_options', 'edit.php?post_type=wp_block' );
$submenu['themes.php'][6] = array( _x( 'Patterns', 'patterns menu item' ), 'edit_theme_options', 'edit.php?post_type=wp_block' );
}
if ( ! wp_is_block_theme() && current_theme_supports( 'block-template-parts' ) ) {

View File

@ -65,7 +65,7 @@ $network_help = '<p>' . __( 'This screen allows you to configure a network as ha
'<p>' . __( 'Once you add this code and refresh your browser, multisite should be enabled. This screen, now in the Network Admin navigation menu, will keep an archive of the added code. You can toggle between Network Admin and Site Admin by clicking on the Network Admin or an individual site name under the My Sites dropdown in the Toolbar.' ) . '</p>' .
'<p>' . __( 'The choice of subdirectory sites is disabled if this setup is more than a month old because of permalink problems with &#8220;/blog/&#8221; from the main site. This disabling will be addressed in a future version.' ) . '</p>' .
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://wordpress.org/documentation/article/create-a-network/">Documentation on Creating a Network</a>' ) . '</p>' .
'<p>' . __( '<a href="https://developer.wordpress.org/advanced-administration/multisite/create-network/">Documentation on Creating a Network</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/documentation/article/tools-network-screen/">Documentation on the Network Screen</a>' ) . '</p>';
get_current_screen()->add_help_tab(
@ -78,7 +78,7 @@ get_current_screen()->add_help_tab(
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://wordpress.org/documentation/article/create-a-network/">Documentation on Creating a Network</a>' ) . '</p>' .
'<p>' . __( '<a href="https://developer.wordpress.org/advanced-administration/multisite/create-network/">Documentation on Creating a Network</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/documentation/article/tools-network-screen/">Documentation on the Network Screen</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
);

View File

@ -53,7 +53,7 @@ get_current_screen()->add_help_tab(
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://wordpress.org/documentation/article/network-admin/">Documentation on the Network Admin</a>' ) . '</p>' .
'<p>' . __( '<a href="https://developer.wordpress.org/advanced-administration/multisite/admin/">Documentation on the Network Admin</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/forum/multisite/">Support forums</a>' ) . '</p>'
);

View File

@ -61,7 +61,7 @@ get_current_screen()->add_help_tab(
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://wordpress.org/documentation/article/network-admin-settings-screen/">Documentation on Network Settings</a>' ) . '</p>' .
'<p>' . __( '<a href="https://developer.wordpress.org/advanced-administration/multisite/admin/settings/">Documentation on Network Settings</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
);

View File

@ -66,8 +66,14 @@ if ( isset( $_REQUEST['action'] ) && 'update-site' === $_REQUEST['action'] ) {
}
$blog_data['scheme'] = $update_parsed_url['scheme'];
// Make sure to not lose the port if it was provided.
$blog_data['domain'] = $update_parsed_url['host'];
$blog_data['path'] = $update_parsed_url['path'];
if ( isset( $update_parsed_url['port'] ) ) {
$blog_data['domain'] .= ':' . $update_parsed_url['port'];
}
$blog_data['path'] = $update_parsed_url['path'];
}
$existing_details = get_site( $id );
@ -88,16 +94,18 @@ if ( isset( $_REQUEST['action'] ) && 'update-site' === $_REQUEST['action'] ) {
$old_home_url = trailingslashit( esc_url( get_option( 'home' ) ) );
$old_home_parsed = parse_url( $old_home_url );
$old_home_host = $old_home_parsed['host'] . ( isset( $old_home_parsed['port'] ) ? ':' . $old_home_parsed['port'] : '' );
if ( $old_home_parsed['host'] === $existing_details->domain && $old_home_parsed['path'] === $existing_details->path ) {
if ( $old_home_host === $existing_details->domain && $old_home_parsed['path'] === $existing_details->path ) {
$new_home_url = untrailingslashit( sanitize_url( $blog_data['scheme'] . '://' . $new_details->domain . $new_details->path ) );
update_option( 'home', $new_home_url );
}
$old_site_url = trailingslashit( esc_url( get_option( 'siteurl' ) ) );
$old_site_parsed = parse_url( $old_site_url );
$old_site_host = $old_site_parsed['host'] . ( isset( $old_site_parsed['port'] ) ? ':' . $old_site_parsed['port'] : '' );
if ( $old_site_parsed['host'] === $existing_details->domain && $old_site_parsed['path'] === $existing_details->path ) {
if ( $old_site_host === $existing_details->domain && $old_site_parsed['path'] === $existing_details->path ) {
$new_site_url = untrailingslashit( sanitize_url( $blog_data['scheme'] . '://' . $new_details->domain . $new_details->path ) );
update_option( 'siteurl', $new_site_url );
}

View File

@ -29,7 +29,7 @@ get_current_screen()->add_help_tab(
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://wordpress.org/documentation/article/network-admin-sites-screen/">Documentation on Site Management</a>' ) . '</p>' .
'<p>' . __( '<a href="https://developer.wordpress.org/advanced-administration/multisite/admin/#network-admin-sites-screen">Documentation on Site Management</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/forum/multisite/">Support forums</a>' ) . '</p>'
);

View File

@ -43,7 +43,7 @@ get_current_screen()->add_help_tab(
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://wordpress.org/documentation/article/network-admin-sites-screen/">Documentation on Site Management</a>' ) . '</p>' .
'<p>' . __( '<a href="https://developer.wordpress.org/advanced-administration/multisite/admin/#network-admin-sites-screen">Documentation on Site Management</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/forum/multisite/">Support forums</a>' ) . '</p>'
);
@ -118,8 +118,20 @@ if ( isset( $_GET['action'] ) ) {
<input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
<input type="hidden" name="_wp_http_referer" value="<?php echo esc_attr( wp_get_referer() ); ?>" />
<?php wp_nonce_field( $site_action . '_' . $id, '_wpnonce', false ); ?>
<p><?php printf( $manage_actions[ $site_action ], $site_address ); ?></p>
<?php submit_button( __( 'Confirm' ), 'primary' ); ?>
<?php
if ( 'deleteblog' === $site_action ) {
$submit = __( 'Delete this site permanently' );
?>
<div class="notice notice-warning inline">
<p><?php _e( 'Deleting a site is a permanent action that cannot be undone. This will delete the entire site and its uploads directory.' ); ?>
</div>
<?php
} else {
$submit = __( 'Confirm' );
}
?>
<p><?php printf( $manage_actions[ $site_action ], "<strong>{$site_address}</strong>" ); ?></p>
<?php submit_button( $submit, 'primary' ); ?>
</form>
</div>
<?php

View File

@ -29,7 +29,7 @@ get_current_screen()->add_help_tab(
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://wordpress.org/documentation/article/network-admin-updates-screen/">Documentation on Upgrade Network</a>' ) . '</p>' .
'<p>' . __( '<a href="https://developer.wordpress.org/advanced-administration/multisite/admin/#network-admin-updates-screen">Documentation on Upgrade Network</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
);

View File

@ -32,7 +32,7 @@ if ( ! is_multisite() ) {
'<p>' . sprintf(
/* translators: %s: Documentation URL. */
__( 'Though the terms refer to two different concepts, in practice, they can be the same address or different. For example, you can have the core WordPress installation files in the root directory (<code>https://example.com</code>), in which case the two URLs would be the same. Or the <a href="%s">WordPress files can be in a subdirectory</a> (<code>https://example.com/wordpress</code>). In that case, the WordPress URL and the site URL would be different.' ),
__( 'https://wordpress.org/documentation/article/giving-wordpress-its-own-directory/' )
__( 'https://developer.wordpress.org/advanced-administration/server/wordpress-in-directory/' )
) . '</p>' .
'<p>' . sprintf(
/* translators: 1: http://, 2: https:// */
@ -235,7 +235,7 @@ if ( ! is_multisite() ) {
printf(
/* translators: %s: Documentation URL. */
__( 'Enter the same address here unless you <a href="%s">want your site home page to be different from your WordPress installation directory</a>.' ),
__( 'https://wordpress.org/documentation/article/giving-wordpress-its-own-directory/' )
__( 'https://developer.wordpress.org/advanced-administration/server/wordpress-in-directory/' )
);
?>
</p>
@ -354,7 +354,7 @@ if ( str_contains( $tzstring, 'Etc/GMT' ) ) {
if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists.
$check_zone_info = false;
if ( 0 == $current_offset ) {
if ( 0 === (int) $current_offset ) {
$tzstring = 'UTC+0';
} elseif ( $current_offset < 0 ) {
$tzstring = 'UTC' . $current_offset;
@ -554,7 +554,7 @@ foreach ( $time_formats as $format ) {
global $wp_locale;
for ( $day_index = 0; $day_index <= 6; $day_index++ ) :
$selected = ( get_option( 'start_of_week' ) == $day_index ) ? 'selected="selected"' : '';
$selected = ( (int) get_option( 'start_of_week' ) === $day_index ) ? 'selected="selected"' : '';
echo "\n\t<option value='" . esc_attr( $day_index ) . "' $selected>" . $wp_locale->get_weekday( $day_index ) . '</option>';
endfor;
?>

View File

@ -8,7 +8,7 @@
* @subpackage Administration
*/
wp_reset_vars( array( 'action' ) );
$action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : '';
if ( isset( $_GET['updated'] ) && isset( $_GET['page'] ) ) {
// For back-compat with plugins that don't use the Settings API and just set updated=1 in the redirect.

View File

@ -61,7 +61,7 @@ $help_sidebar_content = '<p><strong>' . __( 'For more information:' ) . '</stron
'<p>' . __( '<a href="https://wordpress.org/documentation/article/customize-permalinks/">Documentation on Using Permalinks</a>' ) . '</p>';
if ( $is_nginx ) {
$help_sidebar_content .= '<p>' . __( '<a href="https://wordpress.org/documentation/article/nginx/">Documentation on Nginx configuration</a>.' ) . '</p>';
$help_sidebar_content .= '<p>' . __( '<a href="https://developer.wordpress.org/advanced-administration/server/web-server/nginx/">Documentation on Nginx configuration</a>.' ) . '</p>';
}
$help_sidebar_content .= '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>';
@ -465,7 +465,7 @@ printf(
/* translators: 1: web.config, 2: Documentation URL, 3: Ctrl + A, 4: ⌘ + A, 5: Element code. */
__( '<strong>Error:</strong> Your %1$s file is not <a href="%2$s">writable</a>, so updating it automatically was not possible. This is the URL rewrite rule you should have in your %1$s file. Click in the field and press %3$s (or %4$s on Mac) to select all. Then insert this rule inside of the %5$s element in %1$s file.' ),
'<code>web.config</code>',
__( 'https://wordpress.org/documentation/article/changing-file-permissions/' ),
__( 'https://developer.wordpress.org/advanced-administration/server/file-permissions/' ),
'<kbd>Ctrl + A</kbd>',
'<kbd>⌘ + A</kbd>',
'<code>/&lt;configuration&gt;/&lt;system.webServer&gt;/&lt;rewrite&gt;/&lt;rules&gt;</code>'
@ -497,7 +497,7 @@ printf(
printf(
/* translators: 1: Documentation URL, 2: web.config, 3: Ctrl + A, 4: ⌘ + A */
__( '<strong>Error:</strong> The root directory of your site is not <a href="%1$s">writable</a>, so creating a file automatically was not possible. This is the URL rewrite rule you should have in your %2$s file. Create a new file called %2$s in the root directory of your site. Click in the field and press %3$s (or %4$s on Mac) to select all. Then insert this code into the %2$s file.' ),
__( 'https://wordpress.org/documentation/article/changing-file-permissions/' ),
__( 'https://developer.wordpress.org/advanced-administration/server/file-permissions/' ),
'<code>web.config</code>',
'<kbd>Ctrl + A</kbd>',
'<kbd>⌘ + A</kbd>'
@ -533,7 +533,7 @@ printf(
/* translators: 1: .htaccess, 2: Documentation URL, 3: Ctrl + A, 4: ⌘ + A */
__( '<strong>Error:</strong> Your %1$s file is not <a href="%2$s">writable</a>, so updating it automatically was not possible. These are the mod_rewrite rules you should have in your %1$s file. Click in the field and press %3$s (or %4$s on Mac) to select all.' ),
'<code>.htaccess</code>',
__( 'https://wordpress.org/documentation/article/changing-file-permissions/' ),
__( 'https://developer.wordpress.org/advanced-administration/server/file-permissions/' ),
'<kbd>Ctrl + A</kbd>',
'<kbd>⌘ + A</kbd>'
);

View File

@ -32,7 +32,7 @@ get_current_screen()->add_help_tab(
'<p>' . sprintf(
/* translators: %s: Documentation URL. */
__( 'You can also control the display of your content in RSS feeds, including the maximum number of posts to display and whether to show full text or an excerpt. <a href="%s">Learn more about feeds</a>.' ),
__( 'https://wordpress.org/documentation/article/wordpress-feeds/' )
__( 'https://developer.wordpress.org/advanced-administration/wordpress/feeds/' )
) . '</p>' .
'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',
)
@ -64,7 +64,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
<?php
settings_fields( 'reading' );
if ( ! in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ), true ) ) {
if ( ! is_utf8_charset() ) {
add_settings_field( 'blog_charset', __( 'Encoding for pages and feeds' ), 'options_reading_blog_charset', 'reading', 'default', array( 'label_for' => 'blog_charset' ) );
}
?>
@ -197,7 +197,7 @@ else :
printf(
/* translators: %s: Documentation URL. */
__( 'Your theme determines how content is displayed in browsers. <a href="%s">Learn more about feeds</a>.' ),
__( 'https://wordpress.org/documentation/article/wordpress-feeds/' )
__( 'https://developer.wordpress.org/advanced-administration/wordpress/feeds/' )
);
?>
</p>

View File

@ -225,7 +225,7 @@ if ( apply_filters( 'enable_update_services_configuration', true ) ) {
printf(
/* translators: %s: Documentation URL. */
__( 'When you publish a new post, WordPress automatically notifies the following site update services. For more about this, see the <a href="%s">Update Services</a> documentation article. Separate multiple service URLs with line breaks.' ),
__( 'https://wordpress.org/documentation/article/update-services/' )
__( 'https://developer.wordpress.org/advanced-administration/wordpress/update-services/' )
);
?>
</label></p>
@ -239,7 +239,7 @@ if ( apply_filters( 'enable_update_services_configuration', true ) ) {
printf(
/* translators: 1: Documentation URL, 2: URL to Reading Settings screen. */
__( 'WordPress is not notifying any <a href="%1$s">Update Services</a> because of your site&#8217;s <a href="%2$s">visibility settings</a>.' ),
__( 'https://wordpress.org/documentation/article/update-services/' ),
__( 'https://developer.wordpress.org/advanced-administration/wordpress/update-services/' ),
'options-reading.php'
);
?>

Some files were not shown because too many files have changed in this diff Show More