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
When switching to a block theme, classic sidebars were orphaned and their widgets remapping to the `'wp_inactive_widgets'` sidebar . This changeset preserves the sidebars and their widgets, providing a migration path to a block theme without losing the widgets.
Classic sidebars are now:
* Stored in a new theme mod called `'wp_classic_sidebars'`;
* Restored to the `$wp_registered_sidebars` global variable when the `'widgets_init'` action fires (via a new internal function called `_wp_block_theme_register_classic_sidebars()`);
* And marked as `'inactive'` when interacting with sidebars REST API endpoint.
References:
* [https://github.com/WordPress/gutenberg/pull/45509 Gutenberg PR 45509] which adds an option for importing widgets from sidebars into template parts.
Follow-up to [50995], [6334].
Props mamaduka, audrasjb, hellofromTonya, ironprogrammer, jameskoster, joen, matveb, mukesh27, noisysocks, poena, youknowriad.
Fixes#57531.
git-svn-id: https://develop.svn.wordpress.org/trunk@55200 602fd350-edb4-49c9-b593-d223f7449a82
Add a `$size` argument to `get_attached_file()` to simplify getting the path to an intermediate image size.
Props paulschreiber, audrasjb, Mista-Flo.
Fixes#51780.
git-svn-id: https://develop.svn.wordpress.org/trunk@55199 602fd350-edb4-49c9-b593-d223f7449a82
This changeset makes it easier for users to download their uploaded media by providing a Download row action to the Media List Table. It also rephrases the Copy URL row action for better consistency and to give room for the new Download action.
Follow-up to [55156].
Props pbiron, joedolson, kebbet, Mista-Flo, costdev, amin7, mukesh27.
Fixes#57574.
git-svn-id: https://develop.svn.wordpress.org/trunk@55198 602fd350-edb4-49c9-b593-d223f7449a82
This changeset rephrases the Add Plugins screen description to clarify the purpose of the two available options for installing plugins.
Props tahmidulkarim, audrasjb, costdev, ryokuhi, krupalpanchal, SergeyBiryukov.
Fixes#57155.
git-svn-id: https://develop.svn.wordpress.org/trunk@55197 602fd350-edb4-49c9-b593-d223f7449a82
In [53874] the `$locale` parameter was added to `load_textdomain()` so it can be used to properly fill `WP_Textdomain_Registry`. Since `$locale` may not be the same value as `determine_locale()` returns (e.g. when filtered by `plugin_locale` in `load_plugin_textdomain()`) this changeset also passes the `$locale` parameter to the filter so custom file loading implementations are using the same locale as `load_textdomain()` got.
Follow-up to [53874].
Props ocean90, cadic, SergeyBiryukov, swissspidy, costdev.
Fixes#57056.
git-svn-id: https://develop.svn.wordpress.org/trunk@55196 602fd350-edb4-49c9-b593-d223f7449a82
This changeset ensures help tab texts consistently refer to the related button labels.
Props kebbet, costdev.
Fixes#57608.
git-svn-id: https://develop.svn.wordpress.org/trunk@55195 602fd350-edb4-49c9-b593-d223f7449a82
This commit removes the need to pass a template prefix in get_template_hierarchy.
This is required because, in some block editor usages, the template prefix is not known.
Props youknowriad, davidbaumwald, jorgefilipecosta.
Fixes#57614.
git-svn-id: https://develop.svn.wordpress.org/trunk@55194 602fd350-edb4-49c9-b593-d223f7449a82
This changeset introduces functions `wp_get_global_styles_custom_css()` and `wp_enqueue_global_styles_custom_css()`, which allow accessing and enqueuing custom CSS added via global styles.
Custom CSS via global styles is handled separately from custom CSS via the Customizer. If a site uses both features, the custom CSS from both sources will be loaded. The global styles custom CSS is then loaded after the Customizer custom CSS, so if there are any conflicts between the rules, the global styles take precedence.
Similarly to e.g. [55185], the result is cached in a non-persistent cache, except when `WP_DEBUG` is on to avoid interrupting the theme developer's workflow.
Props glendaviesnz, oandregal, ntsekouras, mamaduka, davidbaumwald, hellofromtonya, flixos90.
Fixes#57536.
git-svn-id: https://develop.svn.wordpress.org/trunk@55192 602fd350-edb4-49c9-b593-d223f7449a82
This updates the following npm dependencies to their latest versions:
- `chalk` from `5.1.0` to `5.2.0`.
- `dotenv-expand` from `9.0.0` to `10.0.0`.
- `grunt-contrib-qunit` from `6.2.0` to `6.2.1`.
- `prettier` from `2.0.5` to `2.6.2`.
- `qunit` from `2.19.1` to `2.19.4`.
- `sass` from `1.55.0` to `1.58.0`.
- `sinon` from `14.0.1` to `15.0.1`.
- `sinon-test` from `3.1.4` to `3.1.5`.
- `source-map-loader` from `4.0.0` to `4.0.1`.
- `uglify-js` from `3.17.3` to `3.17.4`.
- `wait-on` from `6.0.1` to `7.0.1`.
- `webpack` from `5.74.0` to `5.75.0`.
Additionally, `npm audit fix` has been run to further update packages that may contain vulnerabilities.
Props naeemhaque, mukesh27, desrosj.
See #57535.
git-svn-id: https://develop.svn.wordpress.org/trunk@55191 602fd350-edb4-49c9-b593-d223f7449a82
This resolves a few WPCS warnings:
{{{
Variable "$cat_ID" is not in valid snake_case format, try "$cat_i_d"
}}}
Follow-up to [2695], [4490], [52958].
Props hilayt24, viralsampat, desrosj, robinwpdeveloper, tanazmasaba, costdev, SergeyBiryukov.
See #56754.
git-svn-id: https://develop.svn.wordpress.org/trunk@55190 602fd350-edb4-49c9-b593-d223f7449a82
This changeset adds margins to improve spacing in the legacy Post Comments block. This change only affects users who have not updated to the new Comments block.
Props patelhitesh, audrasjb, poena, miguelaxcar.
Fixes#57560.
git-svn-id: https://develop.svn.wordpress.org/trunk@55189 602fd350-edb4-49c9-b593-d223f7449a82
This changeset modifies the HTTP request in `themes_api()` to use the same HTTP request timeout as in `plugins_api()`, which is 15 seconds, instead of a default value of 5 seconds.
Props ahortin, peterwilsoncc, dd32, costdev.
Fixes#57315.
git-svn-id: https://develop.svn.wordpress.org/trunk@55188 602fd350-edb4-49c9-b593-d223f7449a82
Make font weight consistent between different screens and different parts of media views.
Props szaqal21, sabernhardt.
Fixes#54509.
git-svn-id: https://develop.svn.wordpress.org/trunk@55187 602fd350-edb4-49c9-b593-d223f7449a82
Patches twemoji.js to add support for a `doNotParse()` callback. Uses that callback to always exclude emojis in HTML elements with the above class.
Props: dd32, peterwilsoncc, azaozz.
Fixes#52219.
git-svn-id: https://develop.svn.wordpress.org/trunk@55186 602fd350-edb4-49c9-b593-d223f7449a82
This changeset is part of a greater effort to enhance the caching strategy for theme.json based data. Similar to [55138], [55148], and [55155], the cache is currently ignored when `WP_DEBUG` is on to avoid interrupting the theme developer's workflow.
Props spacedmonkey, oandregal, flixos90, ajlende, hellofromtonya.
Fixes#57568.
git-svn-id: https://develop.svn.wordpress.org/trunk@55185 602fd350-edb4-49c9-b593-d223f7449a82
Cast all array values to integers using `array_map` so functions like `wp_delete_attachment` receiving the expected variable type.
Props eherman24, joedolson.
Fixes#56170.
git-svn-id: https://develop.svn.wordpress.org/trunk@55183 602fd350-edb4-49c9-b593-d223f7449a82
Crowdsignal has a block-editor powered survey/project editor. Surveys created using this editor appear on `*.crowdsignal.net` when published. This changeset adds oEmbed support for these URLs to embed Crowdsignal surveys.
Props donncha, audrasjb, Mamaduka, ntsekouras.
Fixes#57543.
git-svn-id: https://develop.svn.wordpress.org/trunk@55182 602fd350-edb4-49c9-b593-d223f7449a82
Adds the polyfill script to the iframe to make the `inert` attribute work correctly in Firefox. This solves the problem that the site editor can operate on the block editor in Firefox even in browse mode.
Why?
The inert attribute is intended to render the element and its sub-tree elements `inert`, but Firefox doesn't support this attribute. For the `inert` attribute to work as intended in Firefox, even within an iframe, the script needs to be injected into the iframe as well as the global document.
References:
* [https://github.com/WordPress/gutenberg/pull/47398 Gutenberg PR 47398].
Follow-up to [53160].
Props wildworks, mamaduka, youknowriad.
Fixes#57552.
git-svn-id: https://develop.svn.wordpress.org/trunk@55181 602fd350-edb4-49c9-b593-d223f7449a82
When IMAGE_EDIT_OVERWRITE is defined as true the meta field `_wp_attachment_backup_sizes` is deleted after an image is restored.
Props mitogh, jeawhanlee, robinwpdeveloper, iapial.
Fixes#55150.
git-svn-id: https://develop.svn.wordpress.org/trunk@55180 602fd350-edb4-49c9-b593-d223f7449a82
This changeset:
* Removes the `'wp-block-editor'` and `'wp-block-library'` from the iframe's stylesheet collection (i.e. `_wp_get_iframed_editor_assets()`).
* Adds the new `'wp-block-editor-content'` for the separate stylesheet to the list of editor (`'wp-edit-blocks'`) dependencies.
Why?
These PHP changes are part of the initiative to:
* Separate the content styles contained in the block editor package into a separate stylesheet.
* Avoid loading all block editor styles into the iframe.
References:
* [https://github.com/WordPress/gutenberg/pull/44298 Gutenberg PR 44298].
Follow-up to [53160], [50761].
Props ellatrix, youknowriad.
Fixes#57550.
git-svn-id: https://develop.svn.wordpress.org/trunk@55179 602fd350-edb4-49c9-b593-d223f7449a82
Unset GET parameters in the media library so they don't suppress error notifications and messages. Fix an issue where uploading an image after being redirected from deleting media did not show the new upload in the gallery.
Props rnitinb, Mista-Flo, desrosj, zebaafiashama, joedolson, antpb.
Fixes#49178.
git-svn-id: https://develop.svn.wordpress.org/trunk@55178 602fd350-edb4-49c9-b593-d223f7449a82
Updates the Global Styles endpoint to expose the `'edit_css'` capability via action links.
References:
* [https://github.com/WordPress/gutenberg/pull/46815 Gutenberg PR 46815] Part of an effort to hide custom CSS setting for users without `'edit_css'` capability.
Follow-up to [52342], [52051].
Props mamaduka, dsas, glendaviesnz, mmtr86, talldanwp, timothyblynjacobs.
Fixes#57526.
git-svn-id: https://develop.svn.wordpress.org/trunk@55177 602fd350-edb4-49c9-b593-d223f7449a82
This changeset adds the new dimension feature's PHP code for supporting minimum height in the block editor inspector and in global styles. Minimum height is quite useful for defining the minimum vertical dimensions of a block, while allowing it to expand beyond that size.
In this changeset:
* Adds support in `theme.json`.
* Adds support in the style engine.
* Adds support in `wp_apply_dimensions_support()`.
* Renames the setting from `'__experimentalDimensions'` to `dimensions` in `wp_register_dimensions_support()`.
* Adds PHPUnit tests.
Is renaming `'__experimentalDimensions'` a backwards-compatibility (BC) break?
Though the setting has been in the code since 5.9.0, it was never wired to anything, ie it did not expose any controls or styles. Notice in `wp_register_dimensions_support()` and `wp_apply_dimensions_support()` prior to this changeset, there are inline comments as placeholders for height and width support, but no code.
If a developer opted in to use it, it had no effect.
A search in wp.org's plugin and themes repo showed no instances of this experimental setting.
Given there was no functionality attached to it (until this changeset), no change in behavior or effect from removing it, and no usage found in the plugins and themes repository, it does appear to be a BC break.
References:
* [https://github.com/WordPress/gutenberg/pull/45300 Gutenberg PR 45300]
* [https://github.com/WordPress/gutenberg/pull/45334 Gutenberg PR 45334]
Follow-up to [53076], [52069].
Props andrewserong, aaronrobertshaw , costdev, hellofromTonya, isabel_brison, joen, paaljoachim, mukesh27, ntsekouras, oandregal, ramonopoly.
Fixes#57582.
git-svn-id: https://develop.svn.wordpress.org/trunk@55175 602fd350-edb4-49c9-b593-d223f7449a82
Includes:
* Adding the `templateTypes` property to the `WP_Block_Patterns_Registry::register()` DocBlock.
* Adding `@since` notes for the `postTypes` and `templateTypes` properties to:
* `_register_theme_block_patterns()`
* `WP_Block_Patterns_Registry::register()`
* Bringing some consistency to the order of properties between:
* `_register_theme_block_patterns()`
* `WP_Block_Patterns_Registry::register()`
* `WP_REST_Block_Patterns_Controller::prepare_item_for_response()`
* `WP_REST_Block_Patterns_Controller::get_item_schema()`
Follow-up to [52943], [53152], [54263], [55168].
See #56792.
git-svn-id: https://develop.svn.wordpress.org/trunk@55173 602fd350-edb4-49c9-b593-d223f7449a82
To allow editing of block style variations in global styles, this changeset adds the following for server side support:
* building of block style schema into `WP_Theme_JSON::sanitize()`.
* appending of style variation selectors to block metadata in `WP_Theme_JSON::get_blocks_metadata()`.
* building of selectors and variations for nodes in `WP_Theme_JSON::get_block_nodes()`.
Tests for happy and unhappy paths are included.
Reference:
* [https://github.com/WordPress/gutenberg/pull/46343 Gutenberg PR 46343]
Follow-up to [54118], [50973], [50959].
Props isabel_brison,
Fixes#57583.
git-svn-id: https://develop.svn.wordpress.org/trunk@55172 602fd350-edb4-49c9-b593-d223f7449a82
When adding `decoding="async"` to images was introduced in [53480], it did not provide the ability to customize that behavior specifically for image tags returned from `wp_get_attachment_image()`.
With this changeset it is now possible to explicitly provide a `decoding` value of e.g. boolean `false` in the `$attr` parameter of the function, to ensure the attribute is omitted.
Props maximej, adamsilverstein, flixos90, costdev, peterwilsoncc, mukesh27.
Fixes#57086.
git-svn-id: https://develop.svn.wordpress.org/trunk@55171 602fd350-edb4-49c9-b593-d223f7449a82
Replace raw database queries in `get_page_by_path` with a call to `WP_Query` class. This has a number of benefits, including improved caching and priming of post caches. To maintain backwards compatibility, this function calls `WP_Query` to gets all matching posts of all post statuses.
Props spacedmonkey, peterwilsoncc, costdev,
Fixes#56689.
git-svn-id: https://develop.svn.wordpress.org/trunk@55169 602fd350-edb4-49c9-b593-d223f7449a82