This matches the parameter name in `wp_trash_post()` and all the other functions receiving post ID as a parameter.
See #60700.
git-svn-id: https://develop.svn.wordpress.org/trunk@57857 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@57853 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@57849 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@57845 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@57842 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@57841 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@57840 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@57839 602fd350-edb4-49c9-b593-d223f7449a82
Adds new tests and improves existing ones by using `assertSame` to do type comparison as well.
Props jonsurrell, cbravobernal, swissspidy, gziolo.
Fixes#60758.
git-svn-id: https://develop.svn.wordpress.org/trunk@57835 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@57832 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@57831 602fd350-edb4-49c9-b593-d223f7449a82
Includes alphabetizing the third party library exclusions section.
Follow-up to [50810], [51658], [57524].
See #60700.
git-svn-id: https://develop.svn.wordpress.org/trunk@57829 602fd350-edb4-49c9-b593-d223f7449a82
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
git-svn-id: https://develop.svn.wordpress.org/trunk@57827 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@57826 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@57824 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@57822 602fd350-edb4-49c9-b593-d223f7449a82
Updates a translatable string to use a placeholder for the “Requires Plugins” string used in it.
Props swissspidy, sergeybiryukov, presskopp.
See #60303.
git-svn-id: https://develop.svn.wordpress.org/trunk@57817 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@57809 602fd350-edb4-49c9-b593-d223f7449a82
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].
git-svn-id: https://develop.svn.wordpress.org/trunk@57806 602fd350-edb4-49c9-b593-d223f7449a82
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].
git-svn-id: https://develop.svn.wordpress.org/trunk@57805 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@57804 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@57799 602fd350-edb4-49c9-b593-d223f7449a82
This is a micro-optimization to reduce unnecessary memory allocation.
Follow-up to [28682].
Props mujuonly, swissspidy, mukesh27.
Fixes#60683.
git-svn-id: https://develop.svn.wordpress.org/trunk@57796 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@57795 602fd350-edb4-49c9-b593-d223f7449a82
This updates various WP-Admin related links that have been redirected to new HelpHub pages, to avoid unnecessary redirections.
Props mkismy.
See #60732, #60699.
git-svn-id: https://develop.svn.wordpress.org/trunk@57793 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@57792 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@57790 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@57789 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@57786 602fd350-edb4-49c9-b593-d223f7449a82