As part of determining whether to perform automatic updates, WordPress checks if it is running within a version-controlled environment, recursively looking up the filesystem to the top of the drive, looking for a Subversion, Git, Mercurial, or Bazaar directory, erring on the side of detecting a VCS checkout somewhere.
This commit reuses `WP_Automatic_Updater::is_allowed_dir()` in the Site Health test to avoid a PHP warning if the `open_basedir` directive is in use and any of the directories checked in the process are not allowed:
{{{
is_dir(): open_basedir restriction in effect. File(/.git) is not within the allowed path(s)
}}}
Follow-up to [44986], [55425].
Props Keffr3n, narenin.
Fixes#61834.
Built from https://develop.svn.wordpress.org/trunk@58921
git-svn-id: http://core.svn.wordpress.org/trunk@58317 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Removes the assertion for 'errors' being empty when the instance is `WP_Term` and not `WP_Error`. This property exists on `WP_Error`.
This assertion always passed because it was checking a dynamic property on `WP_Term` that does not exist and is not added within Core. Thus, this assertion is not needed and fails with dynamic property deprecations.
Follow-up to [51403], [34646], [29830].
See #61890, #61530.
Built from https://develop.svn.wordpress.org/trunk@58920
git-svn-id: http://core.svn.wordpress.org/trunk@58316 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Removes the `unset()` of the `WP_Term::$filter` property within the term tests.
Why?
Prior to the introduction of WP_Term, the term was added to the cache when its filter property was empty. To test the cache, the tests unset this property to trigger `wp_cache_add()` in `get_term()`. [34997] changed that behavior to trigger `wp_cache_add()` when the term was not found after `wp_cache_get()` (i.e. happened in `WP_Term::get_instance()`).
Unsetting the filter property is and was not needed. Prior to `WP_Term`, the condition was an empty value. With `WP_Term`, the filter property is no longer part of the conditional logic for caching.
Follow-up to [34997], [30954], [34035].
See #61890, #61530.
Built from https://develop.svn.wordpress.org/trunk@58919
git-svn-id: http://core.svn.wordpress.org/trunk@58315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Instead of checking for a specific message, e.g. “Item not updated”, the `$_REQUEST['error']` variable is now checked. This allows for custom messages added via the `term_updated_messages` filter to be considered an error when appropriate, and displayed with the correct CSS class.
This also brings consistency with a similar check in `wp-admin/edit-tags.php`.
Follow-up to [31823], [44663].
Props xipasduarte.
Fixes#61896.
Built from https://develop.svn.wordpress.org/trunk@58918
git-svn-id: http://core.svn.wordpress.org/trunk@58314 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Adds a z-index to `.media-menu .media-menu-item:focus` to fix the "Upload files" tab's outline on the side next to the other tab.
Follow-up to [57553], [46363].
Props wildworks, antpb, huzaifaalmesbah, krupajnanda, nhrrob, oglekler, rajinsharwar, sabernhardt.
Fixes#60632.
Built from https://develop.svn.wordpress.org/trunk@58917
git-svn-id: http://core.svn.wordpress.org/trunk@58313 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The admin image editor crop function introduced rounding errors by using a scaled image to calculate values. Fix uses the image at 100% scale for calculations. Also avoid recalculating selection when the selection position is changed, and prevent incorrect values after scaling or restoration.
Previously committed in [58456] and reverted in [58571]. The revert was due to a misattributed test failure.
Props Jossnaz, johnillo, shailu25, rachelbaker, sudipatel007, joedolson, kevin940726 , andrewserong, hmbashar.
Fixes#32282.
Built from https://develop.svn.wordpress.org/trunk@58915
git-svn-id: http://core.svn.wordpress.org/trunk@58311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Attach the submit event to the parent search form in the installed and add new theme screen. Following [58405], the submit event was no longer attached to an object that was able to handle form submissions.
Props nithi22, nithins53, josklever, the-ank, debarghyabanerjee, sabernhardt, jeherve, hellofromtonya.
Fixes#61578.
Built from https://develop.svn.wordpress.org/trunk@58914
git-svn-id: http://core.svn.wordpress.org/trunk@58310 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `wp-content/upgrade` directory does not exist initially after installation, so the Site Health check could not determine the available disk space until the directory was subsequently created during an update.
By testing `WP_CONTENT_DIR` instead, the check can complete successfully.
This also brings consistency with similar checks in `_unzip_file_ziparchive()` and `_unzip_file_pclzip()`.
Follow-up to [55720], [56401].
Props wbdv, khokansardar, mi5t4n, SergeyBiryukov.
Fixes#61602.
Built from https://develop.svn.wordpress.org/trunk@58913
git-svn-id: http://core.svn.wordpress.org/trunk@58309 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Includes:
* Adding a test for `wp_privacy_send_personal_data_export_email()` to verify the `user_request` post type.
* Reordering some pre-existing tests to check the request ID and post type first.
Follow-up to [43291], [43499], [44535].
Props garrett-eclipse, berubenic.
See #46560.
Built from https://develop.svn.wordpress.org/trunk@58912
git-svn-id: http://core.svn.wordpress.org/trunk@58308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The image block caption was not being centered on mobile. This was set to start at 1000 pixels and wider. This might have been intended to prevent wrapping, but you can resolve this by unselecting alignment.
Props spanglishwebs, sabernhardt, sudipatel007, shailu25.
Fixes#50317.
Built from https://develop.svn.wordpress.org/trunk@58909
git-svn-id: http://core.svn.wordpress.org/trunk@58305 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The pullquote block was not reflecting the typography changes. This updated patch keeps the size and also fixes the line height.
Props pranitdugad, nidhidhandhukiya, jorbin, darshitrayaguru97, yurajsinj2211, ankit-k-gupta, poena, sabernhardt, shailu25.
Fixes#59919.
Built from https://develop.svn.wordpress.org/trunk@58907
git-svn-id: http://core.svn.wordpress.org/trunk@58303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This function is only utilized as a `shutdown` action callback, so the return value is not used anywhere.
`wp_trigger_error()` is now used instead under the same conditions.
Follow-up to [55720], [56342].
Props johnbillion, amitraj2203, narenin.
Fixes#61116.
Built from https://develop.svn.wordpress.org/trunk@58906
git-svn-id: http://core.svn.wordpress.org/trunk@58302 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This avoids a fatal error on PHP 8 if `error_reporting()` is disabled in `php.ini`.
On systems with this function disabled, it's best to add a dummy function to the `wp-config.php` file, as there are multiple other calls in core or plugins.
However, as this call to the function is run prior to `wp-config.php` loading, it is now wrapped in a `function_exists()` check.
Follow-up to [50447].
Props gansbrest, sabernhardt, jrf, martin.krcho, SergeyBiryukov.
Fixes#61873.
Built from https://develop.svn.wordpress.org/trunk@58905
git-svn-id: http://core.svn.wordpress.org/trunk@58301 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When providing an incorrect path to preload, the `rest_preload_api_request` will silently fail, and nothing will be preloaded.
* Fix typo for `wp_template_part` post type preload path for the Site Editor.
* Do not preload the `wp_block` post type for post editors. The endpoint doesn't support unbound queries, and the data is no longer needed during editor initialization.
Props kirasong, tyxla, mamaduka.
Fixes#61884.
Built from https://develop.svn.wordpress.org/trunk@58904
git-svn-id: http://core.svn.wordpress.org/trunk@58300 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Since removing the build steps for a gzipped version of TinyMCE, the check whether gzip is supported on the server is superfluous. It may also result in the uncompressed files being used when the compressed files are available and could be used.
Follow-up to [44114], [44651].
Props MattyRob, hbhalodia.
Fixes#61862.
Built from https://develop.svn.wordpress.org/trunk@58902
git-svn-id: http://core.svn.wordpress.org/trunk@58298 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Prevents the GitHub bot from posting a comment on pull requests requesting a trac ticket link if the ticket description includes a link via the Core- prefix, eg Core-61865.
The WordPress/WordPress-Develop repository is configured to automatically convert the text to a trac ticket link.
Props martinkrcho, peterwilsoncc.
Fixes#61865.
Built from https://develop.svn.wordpress.org/trunk@58901
git-svn-id: http://core.svn.wordpress.org/trunk@58297 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Updates the name mappings to sort display names ascii-alphabetically and to ascribe commits to updated usernames.
Accounts without a seperate display name remain listed in the footer of the file.
Props dmsnell, jorbin.
See #61864.
Built from https://develop.svn.wordpress.org/trunk@58900
git-svn-id: http://core.svn.wordpress.org/trunk@58296 1a063a9b-81f0-0310-95a4-ce76da25c4cd
From time to time a new commit will appear from an existing commit which has a different name or email address (or both) than an existing name or email address. This occurs because of changing names and changing emails and because of mistakes. Additionally, the `svg`-to-`git` process double-encodes names from `profiles.wordpress.org` causing corruption in names with non-US-ASCII characters.
This patch introduces a `.mailmap` file to alias committers so that:
- All contributions for a given person are shown for that person.
- Committers will be able to control or fix the display of their own name.
The `.mailmap` file is a standard `git` configuration.
Developed in https://github.com/wordpress/wordpress-develop/pull/7180
Discussed in https://core.trac.wordpress.org/ticket/61864Fixes#61864.
Built from https://develop.svn.wordpress.org/trunk@58899
git-svn-id: http://core.svn.wordpress.org/trunk@58295 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Fixes a regression introduced in [58241] where selectors with pseudo elements are wrapped within `:where()` causing malformed CSS and the CSS rule(s) not being applied.
When processing custom CSS for blocks, this changeset:
* Strips the pseudo-elements from the original nested selector, performs the required wrapping in `:root :where`, then re-appends the pseudo-element selector with its leading combinators if present.
* Removes empty CSS rules.
It includes the PHP changes.
Reference:
* PHP changes from [https://github.com/WordPress/gutenberg/pull/63980 Gutenberg PR 63980].
Follow-up to [58241], [56812], [55216].
Props aaronrobertshaw, wongjn, harlet7, dballari, ramonopoly, andrewserong, aristath, hellofromTonya.
Fixes#61769.
Built from https://develop.svn.wordpress.org/trunk@58896
git-svn-id: http://core.svn.wordpress.org/trunk@58292 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Removes duplicate IDs on the post list admin pages affecting various list items, selects and checkboxes:
* JavaScript duplication of the inline editing HTML for bulk editing renames various IDs to include the prefix `bulk-edit-`,
* IDs in the Category Checkbox Walker make use of `wp_unique_prefixed_id()` to avoid duplicates, resulting in a numeric suffix, and,
* the post parent dropdown for the bulk editor is given a custom ID `bulk_edit_post_parent`.
Props peterwilsoncc, sergeybiryukov, azaozz, joedolson, siliconforks, zodiac1978, rcreators.
Fixes#61014.
Built from https://develop.svn.wordpress.org/trunk@58894
git-svn-id: http://core.svn.wordpress.org/trunk@58290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Fixes a regression introduced in [58241] which inadvertently bumped the specificity in a non-iframed editor for `.editor-styles-wrapper .is-layout-flow > *` from (0,1,0) to (0,2,0). This fix restores theme.json spacing rules taking precedence over the implicit spacing rules in a non-iframed editor.
**The What**
When the block editor is not iframed (which can happen when Custom Fields are active, or blocks that use and older `apiVersion` are present), style rules are processed using post css to append the `.editor-styles-wrapper` class name. This has the effect of scoping the the style rules to ensure they don't affect the editor chrome or admin.
With [58241], one of the rules was changed to `.is-layout-flow > *`. In a iframed editor, the specificity of this rule is okay (0,1,0), but in a non-iframed editor it becomes `.editor-styles-wrapper .is-layout-flow > *`, a specificity of (0,2,0). Comparing this to before [58241], the same rule was `.editor-styles-wrapper :where(body .is-layout-flow) > *` (specificity 0,1,0). This is a regression in specificity that has caused some issues. Notably themes can no longer properly override the spacing for blocks using theme.json and have the results correctly shown in the non-iframed editor.
**The How**
This changeset modifies the selector to `:root :where(.is-layout-flow) > *` (still specificity 0,1,0). `transformStyles` handles 'root' selectors a little differently, it'll instead replace the `:root` part so it becomes `.editor-styles-wrapper where(.is-layout-flow) > *` (keeping the specificity at 0,1,0).
The other layout selector that this affects is the `:first-child` `:last-child` selectors that are responsible for resetting margin at the start and end of a block list. They traditionally have a 0,2,0 specificity so that they can override both the above rule and any rules in the theme.json. Those selectors are also maintained at 0,2,0 with this change, they become something like `:root :where(.is-layout-flow) > :first-child`.
**References:**
* PHP changes from [https://github.com/WordPress/gutenberg/pull/64076 Gutenberg PR 64076].
Follow-up to [58241], [58228], [55956], [54162].
Props talldanwp, aaronrobertshaw, andrewserong, markhowellsmead, ramonopoly, hellofromTonya.
Fixes#61829.
Built from https://develop.svn.wordpress.org/trunk@58890
git-svn-id: http://core.svn.wordpress.org/trunk@58286 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Only the translatable part not HTML, should appear for translators to avoid issues. This resolves one string that was not appearing. This only fixed for one theme although discussion on the ticket was for multiples. Other tickets should be open for those if desireable.
Props Presskopp, SergeyBiryukov, pratikkry, pento, mukesh27, laurelfulford, kjellr, desrosj, sabernhardt.
Fixes#45473.
Built from https://develop.svn.wordpress.org/trunk@58881
git-svn-id: http://core.svn.wordpress.org/trunk@58277 1a063a9b-81f0-0310-95a4-ce76da25c4cd
`wp_delete_user()` does not actually delete the entire user when using WordPress Multisite. Therefore tests should typically use the test helper method to fully delete the user, unless explicitly ignoring Multisite or testing the `wp_delete_user()` function while taking Multisite behavior into account.
Fixes#61851.
Built from https://develop.svn.wordpress.org/trunk@58876
git-svn-id: http://core.svn.wordpress.org/trunk@58272 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This brings the function in line with the similar `get_edit_post_link()` parameter. The 'get_edit_comment_link' filter now additionally receives the `$comment_id` and `$context` as parameters.
Additionally, as a minor enhancement, the capability check is now more defensive, as it will no longer cause an error if the given comment ID is invalid.
As part of the changeset, comprehensive test coverage for the `get_edit_comment_link()` including the new behavior is added.
Props deepakrohilla.
Fixes#61727.
Built from https://develop.svn.wordpress.org/trunk@58875
git-svn-id: http://core.svn.wordpress.org/trunk@58271 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When support was added for foreign content, an ambiguity in the HTML specification led to code that followed the wrong path when encountering a self-closing SCRIPT element in the SVG namespace. Further, a fallthrough was discovered during manual testing.
This patch adds a new test to assert the proper behaviors and fixes these issues. In the case of the SCRIPT element, the outcome was the same with the wrong code path, making the defect benign. In the case of the fallthrough, the wrong behavior would occur.
The updates in this patch also resolves a todo relating to the spec ambiguity.
Developed in https://github.com/wordpress/wordpress-develop/pull/7164
Discussed in https://core.trac.wordpress.org/ticket/61576
Follow-up to [58868].
Props: dmsnell, jonsurrell.
See #61576.
Built from https://develop.svn.wordpress.org/trunk@58871
git-svn-id: http://core.svn.wordpress.org/trunk@58267 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Previously, `WP_HTML_Processor::expects_closer()` would report `true` for self-closing foreign elements when called without supplying a node in question, but it should have been reporting `true` just as it does for HTML elements.
This patch adds a test case demonstrating the issue and a bugfix.
The `html5lib` test runner was relying on the incorrect behavior, accidentally working. This is also corrected and the `html5lib` test now relies on the correct behavior of `expects_closer()`.
Developed in https://github.com/wordpress/wordpress-develop/pull/7162
Discussed in https://core.trac.wordpress.org/ticket/61576
Follow-up to [58868].
Props: dmsnell.
See #61576.
Built from https://develop.svn.wordpress.org/trunk@58870
git-svn-id: http://core.svn.wordpress.org/trunk@58266 1a063a9b-81f0-0310-95a4-ce76da25c4cd