Previously, the `s` argument of the `WP_Query::parse_query()` method searched the `post_title`, `post_excerpt`, and `post_content` fields, with no way of controlling this apart from using the `posts_search` filter and adjusting the SQL manually. This changeset adds the ability to specify which fields are searched when performing a query, using the `search_columns` argument.
Props johnbillion, birgire, petitphp, audrasjb, costdev, mukesh27.
Fixes#43867.
git-svn-id: https://develop.svn.wordpress.org/trunk@55248 602fd350-edb4-49c9-b593-d223f7449a82
The site editor has been updated to not require the "home template" setting.
This removes the key from the settings passed to the frontend.
Props flixos90, hellofromtonya, ntsekouras.
Fixes#57480.
git-svn-id: https://develop.svn.wordpress.org/trunk@55247 602fd350-edb4-49c9-b593-d223f7449a82
In addition to all the packages being updated to the latest versions,
this commit also includes some mandatory changes to avoid editor breakage:
- Update React to to 18.2.0.
- Add the right stylesheets to support iframed block editors.
Props ntsekouras, mamaduka, flixos90, desrosj, peterwilsoncc.
See #57471.
git-svn-id: https://develop.svn.wordpress.org/trunk@55246 602fd350-edb4-49c9-b593-d223f7449a82
Check the input of `wp_strip_all_tags()` before passing it to `strip_tags()`. This protects against fatal errors introduced in PHP 8, retaining the `E_USER_WARNING` from PHP 7, and prevents a PHP 8.1 deprecation notice when passing null.
Props chocofc1, costdev, jrf, dd32, audrasjb, peterwilsoncc.
Fixes#56434.
git-svn-id: https://develop.svn.wordpress.org/trunk@55245 602fd350-edb4-49c9-b593-d223f7449a82
Introduces a test for the `WP_Error` object `destination_not_deleted_move_dir` in the `move_dir()` function.
Follow up to [55226].
Props costdev, mukesh27.
Fixes#57375.
git-svn-id: https://develop.svn.wordpress.org/trunk@55244 602fd350-edb4-49c9-b593-d223f7449a82
Adds a trailing slash to the mixcloud.com oembed endpoint to match the documented version.
Follow up to [55068].
Props jeherve, matclayton.
Fixes#57376.
git-svn-id: https://develop.svn.wordpress.org/trunk@55243 602fd350-edb4-49c9-b593-d223f7449a82
YouTube Live stream URLs can take the form of `youtube.com/live/videocode`. This registers the URL format for the oembed provider.
Props slieschke, costdev.
Fixes#57632.
git-svn-id: https://develop.svn.wordpress.org/trunk@55242 602fd350-edb4-49c9-b593-d223f7449a82
The emoji feature detection that occurs on every page load by default has been broken at least since [45769], causing the feature detection to fail for browsers that in fact support emoji correctly. This has led to the `wp-emoji-release.min.js` file being loaded unnecessarily even in modern browsers, which accounts for roughly 4.7 KB of extra JavaScript on every page load.
This changeset fixes the feature detection, by using the correct sequences of char codes.
Props sergiomdgomes, dmsnell, peterwilsoncc.
Fixes#57301.
git-svn-id: https://develop.svn.wordpress.org/trunk@55241 602fd350-edb4-49c9-b593-d223f7449a82
This changeset adds a `block_theme` entry in the theme cache data, similar to the existing entries `headers`, `errors`, `stylesheet`, and `template`.
Props spacedmonkey, costdev, joemcgill, flixos90, mukesh27, adamsilverstein.
Fixes#57114.
git-svn-id: https://develop.svn.wordpress.org/trunk@55236 602fd350-edb4-49c9-b593-d223f7449a82
This applies several dependency version updates to Twenty Nineteen, Twenty Twenty, and Twenty Twenty-One.
`npm audit fix` has also been run to automatically fix any packages with reported vulnerabilities.
See #57535.
git-svn-id: https://develop.svn.wordpress.org/trunk@55233 602fd350-edb4-49c9-b593-d223f7449a82
This commit includes the latest updates WP_Theme_JSON_Resolver class made in the block editor. Some of these updates improve the performance of the class.
Props Mamaduka, hellofromTonya, flixos90, jorgefilipecosta, oandregal, spacedmonkey, audrasjb, costdev, scruffian.
Closes#57545.
git-svn-id: https://develop.svn.wordpress.org/trunk@55231 602fd350-edb4-49c9-b593-d223f7449a82
This commit adds support for the ID attribute for dynamically rendered blocks.
Props Soean, flixos90, poena, costdev, Mamaduka.
Closes#56852.
git-svn-id: https://develop.svn.wordpress.org/trunk@55230 602fd350-edb4-49c9-b593-d223f7449a82
If the `clear_working` flag in `WP_Upgrader::install_package()` is false, the source should not be removed, so `copy_dir()` should be used instead.
Partial updates, like language packs, may want to retain the destination. If the destination exists or has contents, this may be a partial update, and the destination should not be removed, so `copy_dir()` should be used instead.
Follow-up to [55204], [55219], [55220], [55223], [55226].
Props afragen, costdev, swissspidy.
See #57557.
git-svn-id: https://develop.svn.wordpress.org/trunk@55229 602fd350-edb4-49c9-b593-d223f7449a82
This changeset ensures text color changes on Pullquote block are reflected on both front-end and in the editor.
Props umesh84, audrasjb, sabernhardt, bgoewert, ruchirj, amitbarai013, robinwpdeveloper, shamayel007.
Fixes#56006.
git-svn-id: https://develop.svn.wordpress.org/trunk@55228 602fd350-edb4-49c9-b593-d223f7449a82
This changeset fixes an alignment issue that has been present since the gallery block markup was changed in WordPress 6.0.
Props silicium23, zoonini, sabernhardt, bgoewert, ira2910, tahminar27.
Fixes#56412.
git-svn-id: https://develop.svn.wordpress.org/trunk@55227 602fd350-edb4-49c9-b593-d223f7449a82
Correctly instantiate `WP_Error()` within `move_dir()` to prevent a fatal error when unable to delete an existing directory that is intended to be replaced.
Follow-up to [55204], [55219], [55220], [55223].
Props swissspidy, costdev, afragen.
Fixes#57375.
git-svn-id: https://develop.svn.wordpress.org/trunk@55226 602fd350-edb4-49c9-b593-d223f7449a82
Intentional preloading of Requests 2.x classes and interfaces using their old (Requests 1.x) names should not produce deprecation notices.
This commit defines `REQUESTS_SILENCE_PSR0_DEPRECATIONS` as `true` in `_preload_old_requests_classes_and_interfaces()`.
Follow-up to [54997], [55007], [55046].
Props costdev, afragen, jrf.
Fixes#54504.
git-svn-id: https://develop.svn.wordpress.org/trunk@55225 602fd350-edb4-49c9-b593-d223f7449a82
This is a follow-up to [55161] to rename `::get_current_locale()` to `::get_switched_locale()` and `::get_current_user_id()` to `::get_switched_user_id()` for improved clarity.
Also:
* Fix docblock for `switch_locale` filter. The User ID is `false` if missing, not `null`.
* Add additional test involving `restore_previous_locale()` and improve test cleanup.
And most importantly: happy birthday ocean90! 🎂
Props johnjamesjacoby, ocean90.
See #57123.
git-svn-id: https://develop.svn.wordpress.org/trunk@55224 602fd350-edb4-49c9-b593-d223f7449a82
This updates the check whether the destination directory already exists to only call `$wp_filesystem->exists()` once.
Follow-up to [55204], [55219], [55220].
Props azaozz, afragen, SergeyBiryukov.
Fixes#57375.
git-svn-id: https://develop.svn.wordpress.org/trunk@55223 602fd350-edb4-49c9-b593-d223f7449a82
Changes `move_dir()` to attempt to delete the destination when overwriting, before calling `WP_Filesystem::move()`.
Props: afragen, costdev, azaozz.
Fixes: #57375.
git-svn-id: https://develop.svn.wordpress.org/trunk@55219 602fd350-edb4-49c9-b593-d223f7449a82
Fix empty href attribute on 'View' link when the `attachment_link` filter is used to hide attachment pages.
Props oh_hello, iqbalrony.
Fixes#54824.
git-svn-id: https://develop.svn.wordpress.org/trunk@55218 602fd350-edb4-49c9-b593-d223f7449a82
Pass the new `$size` argument on `get_attached_file()` to `get_attached_file` filter. Follow up to [55199].
Props SergeyBiryukov, joedolson.
Fixes#51780.
git-svn-id: https://develop.svn.wordpress.org/trunk@55217 602fd350-edb4-49c9-b593-d223f7449a82
Revert [55169] and mark #56689 as wontfix. `get_page_by_path` can not use `WP_Query`, as is results in fatel errors for those using `get_page_by_path` in the `pre_get_posts` action or `posts_pre_query` filter. This sadly means that `WP_Query` can never be used in `get_page_by_path`.
Props spacedmonkey, iandunn, mukesh27, joemcgill, adamsilverstein, otto42.
See #56689.
git-svn-id: https://develop.svn.wordpress.org/trunk@55215 602fd350-edb4-49c9-b593-d223f7449a82
This changeset improves the consistency in capitalization of fetching and outputting of request headers. It also updates occurrences found in some docblocks.
Props johnjamesjacoby, costdev, audrasjb, petitphp, mhkuu, SergeyBiryukov.
Fixes#54225.
git-svn-id: https://develop.svn.wordpress.org/trunk@55210 602fd350-edb4-49c9-b593-d223f7449a82
On some servers, consecutive periods in a filename can cause a 403 Forbidden response.
This changeset replaces consecutive periods with a single period, and adds related unit tests.
Props ArtZ91, costdev, SergeyBiryukov, arthurshlain, mukesh27.
Fixes#57242.
git-svn-id: https://develop.svn.wordpress.org/trunk@55209 602fd350-edb4-49c9-b593-d223f7449a82
Formally deprecate `get_page_by_title()`. In its current form the function is unpredictable in that it may return a result that leads to a 404 error and will return different results depending on the database version/engine combination used.
It is recommended developers use `WP_Query` instead:
{{{
$query = new WP_Query(
array(
'post_type' => 'page',
'title' => 'Sample Page',
)
);
}}}
Props TimothyBlynJacobs, costdev, mukesh27, spacedmonkey, peterwilsoncc.
Fixes#57041.
git-svn-id: https://develop.svn.wordpress.org/trunk@55207 602fd350-edb4-49c9-b593-d223f7449a82
Introduces:
- New function: `wp_opcache_invalidate_directory()`, to recursively call `wp_opcache_invalidate()` after overwriting .php files.
- New function: `move_dir()`, similar to `copy_dir()` that uses `WP_Filesystem::move()` followed by `wp_opcache_invalidate_directory()`, and has a fallback to `copy_dir()`.
Props: costdev, afragen, peterwilsoncc, sergeybiryukov, ironprogrammer, flixos90, bronsonquick, mukesh27, azaozz.
Fixes#57375.
git-svn-id: https://develop.svn.wordpress.org/trunk@55204 602fd350-edb4-49c9-b593-d223f7449a82
This commit pulls in the HTML Tag Processor from the Gutenbeg repository.
The Tag Processor attempts to be an HTML5-spec-compliant parser that provides the ability in PHP to find specific HTML tags and then add, remove, or update attributes on that tag. It provides a safe and reliable way to modify the attribute on HTML tags.
More information: https://github.com/WordPress/wordpress-develop/pull/3920.
Props: antonvlasenko, bernhard-reiter, costdev, dmsnell, felixarntz, gziolo, hellofromtonya, zieladam, flixos90, ntsekouras, peterwilsoncc, swissspidy, andrewserong, onemaggie, get_dave, aristath, scruffian, justlevine, andraganescu, noisysocks, dlh, soean, cbirdsong, revgeorge, azaozz.
Fixes#57575.
git-svn-id: https://develop.svn.wordpress.org/trunk@55203 602fd350-edb4-49c9-b593-d223f7449a82
Includes:
* Using 3-digit format for the `@since` tag.
* Minor wording updates and formatting corrections.
Follow-up to [3203], [4612], [6379], [8203], [24983], [29090], [55199].
See #51780, #56792.
git-svn-id: https://develop.svn.wordpress.org/trunk@55202 602fd350-edb4-49c9-b593-d223f7449a82