44947 Commits

Author SHA1 Message Date
Sergey Biryukov
56741a3047 Editor: Add an editor settings flag to enable the new gallery for mobile apps for 5.9.
Currently the WordPress mobile apps rely on the `__unstableGalleryWithImageBlocks` flag being set in order to enable the new gallery block format.

This commit includes the value in the `get_default_block_editor_settings()` function in order to ensure that versions of the mobile app >= 18.2 will be able to add and edit gallery blocks in the new format.

Props glendaviesnz, ocean90, hellofromTonya, noisysocks.
Fixes #54583.

git-svn-id: https://develop.svn.wordpress.org/trunk@52349 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-09 15:23:23 +00:00
Sergey Biryukov
61296a7bad Coding Standards: Simplify or wrap some long conditions in wp-includes/theme.php for better readability.
Includes adjusting some DocBlocks per the documentation standards.

Follow-up to [35595], [41937], [52256].

See #53359, #53399.

git-svn-id: https://develop.svn.wordpress.org/trunk@52348 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-09 15:11:17 +00:00
Riad Benguella
f7d2a2ee9d Themes: Auto-enable block-templates support for all block themes.
Block themes without theme.json file used to have block-templates support disabled.
This commit brings this in sync with the behavior in the gutenberg plugin.

See #54335.


git-svn-id: https://develop.svn.wordpress.org/trunk@52347 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-09 09:54:13 +00:00
Sergey Biryukov
59633f8198 Coding Standards: Use camel case with a lowercase first letter for the blockTheme array key.
This matches the WordPress JS naming conventions and the naming of other keys in the `$prepared_themes` array.

Follow-up to [52341].

See #54578, #53359.

git-svn-id: https://develop.svn.wordpress.org/trunk@52346 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-08 10:14:52 +00:00
Jb Audras
7c8bed0be2 Coding Standards: Correct alignment in blocks.php and class-wp-rest-templates-controller.
See #53359.


git-svn-id: https://develop.svn.wordpress.org/trunk@52345 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-07 22:48:54 +00:00
Sergey Biryukov
be006b0c55 Post WordPress 5.9 Beta 2 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@52344 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-07 21:56:28 +00:00
Sergey Biryukov
0e13a6add1 WordPress 5.9 Beta 2.
git-svn-id: https://develop.svn.wordpress.org/trunk@52343 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-07 21:19:26 +00:00
Jonny Harris
9f0d8fdf01 REST API: Improve permission handling in global style endpoint.
The new wp_global_styles post type is registered to use edit_theme_options in the capability settings. The WP_REST_Global_Styles_Controller class's permission checks methods use the capability in a hard coded form rather than looking up the capability via the post type object. Changing the permission callbacks to lookup capabilities via the post type object, allows theme and plugin developers to modify the capability used for editing global styles via a filter and these values to be respected via the Global Styles REST API.

Props Spacedmonkey, peterwilsoncc, hellofromTonya , antonvlasenko, TimothyBlynJacobs, costdev, zieladam.
Fixes #54516.



git-svn-id: https://develop.svn.wordpress.org/trunk@52342 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-07 20:56:18 +00:00
Tonya Mork
f33c456925 Themes: Hide "Live Preview" button for FSE block themes.
Currently, the Site Editor does not have a live preview feature for non-activated block themes.

This commit is a stop-gate to remove the "Live Preview" button for those themes. It avoids confusing users and avoiding a notification message that doesn't make sense.

Props antonvlasenko, costdev, hellofromTonya, kafleg, paaljoachim.
Fixes #54578.

git-svn-id: https://develop.svn.wordpress.org/trunk@52341 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-07 20:05:27 +00:00
Jonny Harris
8697aee5f9 REST API: Ensure that the export template endpoint returns a valid WP_Error object.
Ensure that the export template endpoint returns a WP_Error object, including code and message, so that the site editor can display an error message. 
Add some basic unit tests to ensure that permission checks are working as expected. 

Follow-up to [52286].

Props Spacedmonkey, dlh, hellofromTonya , Mamaduka, TimothyBlynJacobs.
Fixes #54448.



git-svn-id: https://develop.svn.wordpress.org/trunk@52340 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-07 18:36:29 +00:00
Jb Audras
6fa3ac1b1e Coding Standards: Replace else if with elseif after [52338].
Follow-up to [52338].


git-svn-id: https://develop.svn.wordpress.org/trunk@52339 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-07 17:47:28 +00:00
Jb Audras
6f546a023c Script Loader: Allow for wp_register_script() to be called after wp_enqueue_script().
When a plugin registers styles/scripts on `wp_enqueue_scripts` (as plugin authors are encouraged to do), and conditionally enqueues their script/style on `the_content` filter, things "just work". In block themes, `the_content` is run prior to the header being processed, which results in the above scenario failing.

This change makes a `wp_enqueue_script( 'example' ); wp_register_script( 'example' );` work, where as currently the enqueue silently fails (no "doing it wrong" message) and the following register has no impact. Scripts can therefore be enqueued and dequeued (by "handle") before they are registered.

Fixes #54529.


git-svn-id: https://develop.svn.wordpress.org/trunk@52338 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-07 17:44:46 +00:00
Tonya Mork
39d6d8c03c Upgrade/Install: Fix moving plugins folder in WP_Upgrader:: move_to_temp_backup_dir().
[51815] introduced the creation of a temporary backup of plugins before updating.

The `move()` (and later, `move_dir()`) call) uses a `$src` parameter.
For Hello Dolly, this is `<path>/wp-contents/plugins/.` (note the period at the end).

For users on Linux and Mac, this doesn't appear to cause any problems.
However, on Windows, the move causes the plugins folder to be moved which then causes a failure when attempting to call `mkdir()`.

This commit skips any plugin whose slug is `'.'` as this slug results in the `$src` value ending in a period. 

Follow-up to [51815].

Props costdev, boniu91, hellofromTonya.
Fixes #54543.

git-svn-id: https://develop.svn.wordpress.org/trunk@52337 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-07 16:49:22 +00:00
Riad Benguella
eb1763d2af Site Editor: Render the template descriptions properly.
The initializaion of the editor was a bit different between Gutenberg and Core.
This brings them in sync which solves the missing descriptions from the template header
in the site editor.

See #54337.


git-svn-id: https://develop.svn.wordpress.org/trunk@52336 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-07 16:38:47 +00:00
Jeff Ong
e205409fb3 Twenty Twenty-Two: Sync updates from GitHub.
This commit syncs minor changes for the default theme from its active development repository to core. 

This is a follow up to [52081], [52107], [52164], [52222], and [52283]. It reduces the size of a video asset, renames the templates and template parts directories, and adds CSS for button hover states. To view the full set of changes, visit 1a121e0224...da994d1fe5.

Props kjellr, mburridge, sabernhardt, hellofromtonya, scruffian.
See #54318.


git-svn-id: https://develop.svn.wordpress.org/trunk@52335 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-07 16:36:48 +00:00
Riad Benguella
3dada8377b Block Editor: Only list custom block templates in the template selector.
Previously all block templates including the hierarchy templates were being shown in the CPT template selector.

Props mamaduka.
See #54335.


git-svn-id: https://develop.svn.wordpress.org/trunk@52334 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-07 16:31:59 +00:00
Tonya Mork
cc0ec8e72a REST API: Pass post type name to rest_get_route_for_post_type_items().
The new `rest_get_route_for_post_type_items()` function accepts a string, not an object. This commit passes the post type name instead of the object to resolve a notice in the site editor page.

Follow-up to [52281].

Props walbo.
Fixes #54536.

git-svn-id: https://develop.svn.wordpress.org/trunk@52333 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-07 16:13:54 +00:00
John Blackbourn
ba518c2d86 Docs: Various inline documentation corrections and improvements.
See #53399


git-svn-id: https://develop.svn.wordpress.org/trunk@52332 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-07 12:18:50 +00:00
Riad Benguella
bccb23ca03 Site Editor: Update the block template descriptions.
Align the template descriptions with the latest changes from the Gutenberg plugin.

Props jameskoster, SergeyBiryukov.
See #54335.


git-svn-id: https://develop.svn.wordpress.org/trunk@52331 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-07 12:10:36 +00:00
Tonya Mork
9cc20468ef Themes: Better names for WP_Theme::is_block_theme() and wp_is_block_theme() and make wp_is_block_theme() a wrapper.
This commit renames the following method and function to better represent block theme terminology:

* `WP_Theme::is_block_based()` to `WP_Theme::is_block_theme()`
* `wp_is_block_template_theme()` to `wp_is_block_theme()`

It also changes `wp_is_block_theme()` to be a helper wrapper (sugar syntax) for `wp_get_theme()->is_block_theme();`. Why? To ensure both the method and function behave the same, to help Gutenberg maintain WordPress cross-version compatibility, and to make it less cumbersome to port changes from Gutenberg to Core.

Follow-up to [52069], [52247], [52279].

Props antonvlasenko, costdev, hellofromTonya, noisysocks.
Fixes #54550.

git-svn-id: https://develop.svn.wordpress.org/trunk@52330 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-07 00:00:45 +00:00
Tonya Mork
f322c1ef3f Editor: Allow theme.json to take precedence in setting the root level element's reset margin value.
Any margin added to the root element via `theme.json` is overwritten by a CSS reset margin value provided by the Gutenberg Plugin.

This commit makes `theme.json` setting take precedence by generating the global styles body reset prior to processing the theme.json.

Follow-up to [52049].

Props get_dave, hellofromTonya.
Fixes #54550.

git-svn-id: https://develop.svn.wordpress.org/trunk@52329 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-06 22:40:45 +00:00
Sergey Biryukov
071e80695d HTTP API: Revert changeset [52244].
Reverting Requests 2.0.0 changes and moving to WordPress 6.0 cycle. Why? The namespace and file case renaming revealed 2 issues in Core's upgrader process.

See https://core.trac.wordpress.org/ticket/54504#comment:22 for more information.

Follow-up to [52327].

See #54562, #54504.

git-svn-id: https://develop.svn.wordpress.org/trunk@52328 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-06 21:29:00 +00:00
Tonya Mork
e601e72628 HTTP API: Revert changeset [52315].
Reverting Requests 2.0.0 changes and moving to WordPress 6.0 cycle. Why? The namespace and file case renaming revealed 2 issues in Core's upgrader process.

See https://core.trac.wordpress.org/ticket/54504#comment:22 for more information.

See #54562, #54504.

git-svn-id: https://develop.svn.wordpress.org/trunk@52327 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-06 18:29:24 +00:00
Sergey Biryukov
5eede7436a KSES: Use the polyfilled PHP 8 string functions in _wp_kses_allow_pdf_objects():
* `str_contains()`
* `str_ends_with()`
* `str_starts_with()`

Additionally, include a test for a PDF file in an `<object>` tag with an unsupported protocol.

Follow-up to [51963], [52039], [52040], [52304], [52309].

Props TobiasBg, ramonopoly.
See #54261.

git-svn-id: https://develop.svn.wordpress.org/trunk@52326 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-06 11:06:40 +00:00
Sergey Biryukov
8bfdd80f46 Build/Test Tools: Remove the replace:emoji-banner-text Grunt task.
The task was previously used to ensure that `/*! This file is auto-generated */` comment is not included on front end as part of the inline emoji detection script.

As the `wp-emoji-loader.js` script is now included via `file_get_contents()` and `wp_print_inline_script_tag()` instead of `grunt-include` to simplify the logic, the task does not find anything to replace and is no longer necessary.

Additionally, include a line break before the `wp-emoji-loader.js` script content for better line wrapping.

Follow-up to [48096], [50651], [52132].

See #44632, #44306, #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@52325 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-06 10:12:28 +00:00
Robert Anderson
0cab817ba4 Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- Gallery block: turn on auto-migration of v1 Gallery blocks to v2 format when edited
- Add accessible labelling to submenu buttons.
- Improve performance of wp_navigation lookup. 
- Various inline docblock corrections
- Use core version of template and template part post types and REST endpoints for WP 5.9, with back compat for 5.8
- Gradients: Enable adding custom gradient when gradients are disabled
- Custom color palette: add default color name
- Color Picker: Re-instate debounce and controlled value to fix issue with gradient picker
- Add aria-current="page" to active navigation item
- Site Editor: Templat list fallback to slug
- Fix: Custom color picker popover position
- Fix: php 5.6 error in theme JSON class.
- Update the WP_Theme_JSON_Gutenberg class to be like the core one
- Update the WP_Theme_JSON_Resolver_Gutenberg class to be like the core one
- Move Global Styles code to lib/compat/wordpress-5.9 folder
- E2E Tests: Fix failing image e2e test by waiting for required element
- Navigation: Try removing absorb toolbar prop.
- Navigation: Fix navigation justifications.
- Fix wordbreak for URLs
- Polish unset color indicator.
- Template revert flow: Make label description source agnostic
- [Block Library - Navigation]: Fix vertical layout
- Add: Corners to custom color picker popover
- Add: Missing margin to the color picker clear button
- Gradient: Fix clearing a custom gradient from throwing a React warning
- [Block Library]: Rename Query Pagination blocks
- PHP Unit Tests: Use global transients 
- Remove CSS that causes conflict with theme.json
- Add actions which fire during the loading process of block template parts
- Fix usage of useSetting('color.palette')
- Update micromodal, include click-through fix
- Site Editor: Remove unused PHP code
- Don't try and render unstable location if Nav block has ID
- Fix gutenberg prefixed function references in core
- Card: support the extraSmall option for the size prop
- Gallery block: enable the new gallery block by default if running in core 
- Block fixtures: Change port to 8889 to placate KSES
- Full Site Editing: Remove block template resolution unit tests
- Site Editor: Sync export API

See #54487.


git-svn-id: https://develop.svn.wordpress.org/trunk@52324 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-06 06:18:27 +00:00
Sergey Biryukov
7f1166c891 Docs: Add missing summary for WP_Theme_JSON_Resolver::get_merged_data().
Follow-up to [50959].

See #53399.

git-svn-id: https://develop.svn.wordpress.org/trunk@52323 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-05 18:01:00 +00:00
Sergey Biryukov
76357a2936 Coding Standards: Break the $path reference after a foreach loop in block_editor_rest_api_preload().
When using a `foreach` loop with a value assigned by reference, the variable continues to point to the last array element even after the loop, so it is recommended to destroy it by `unset()` to avoid unexpected behavior later on.

See [https://www.php.net/manual/en/control-structures.foreach.php PHP Manual: foreach].

Follow-up to [52312], [52313].

Props TobiasBg.
See #54558.

git-svn-id: https://develop.svn.wordpress.org/trunk@52322 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-04 17:18:48 +00:00
Sergey Biryukov
4eee8105c8 Docs: Further update some @since notes in WP_Theme_JSON methods for clarity.
Follow-up to [52049], [52306], [52320].

See #53399, #54336.

git-svn-id: https://develop.svn.wordpress.org/trunk@52321 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-04 15:55:03 +00:00
Sergey Biryukov
df167a8a40 Docs: Some documentation improvements for WP_Theme_JSON and WP_Theme_JSON_Resolver classes:
* Make the `@since 5.9.0` notes more specific. When mentioning that parameters or values have been added or changed, it is generally also helpful to include their exact names and the nature of changes for future reference.
* Update some DocBlocks per the documentation standards.

Follow-up to [52049], [52306].

See #53399, #54336.

git-svn-id: https://develop.svn.wordpress.org/trunk@52320 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-04 12:56:29 +00:00
Jb Audras
096168d207 General: Add MariaDB in the readme.html requirements.
This change updates the WordPress `readme.html` file to reflect WordPress.org requirements: as of WordPress 5.9, MariaDB 10.1 and higher versions are supported by WP. See https://wordpress.org/about/requirements/. 

Fixes #41490.


git-svn-id: https://develop.svn.wordpress.org/trunk@52319 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-03 23:08:31 +00:00
Jb Audras
e97c828322 Docs: Replace @since 5.9 with @since 5.9.0 in block-template-utils.php.
Follow-up to [52317], [52275], [52062].

See #53399.


git-svn-id: https://develop.svn.wordpress.org/trunk@52318 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-03 22:25:42 +00:00
Jb Audras
12dc923fa5 Docs: Miscellaneous Docblock corrections for block-template-utils.php file.
Follow-up to [52275], [52062].

See #53399.


git-svn-id: https://develop.svn.wordpress.org/trunk@52317 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-03 22:08:31 +00:00
Tonya Mork
fae50f56f2 Editor: Resolve template request ?_wp-find-template=true for new posts and pages.
The template resolution system makes a request like `/?page_id=1234&_wp-find-template=true`, depending on `WP_Query` to resolve a page or post using the page_id or p (post_id) in the query string. With new posts/pages, a placeholder post with the status auto-draft is created. But by default `WP_Query` will not resolve these posts, unless the query is specifically set to look for them.

This commit handles the query string to properly resolve a page or post. It adds 2 private callbacks for the processing.

Props poena, noisysocks, bernhard-reiter, costdev, hellofromTonya.
Fixes #54553.

git-svn-id: https://develop.svn.wordpress.org/trunk@52316 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-03 19:37:32 +00:00
Tonya Mork
c5bd6215ba HTTP API: Fix classname WpOrg\Requests\Proxy\Http in WP_Http::request().
Renaming the classname was missed in [52244] when updating changes in `WP_Http::request()` for the Requests 2.0.0 external library upgrade. `HTTP` class no longer exists and caused a fatal error `Fatal error: Uncaught Error: Class 'WpOrg\Requests\Proxy\HTTP' not found`.

This commit renames the class to `Http` and resolves the fatal error.

Follow-up to [52244].

Props alexeydemidov, costdev, mukesh27.
Fixes #54562.

git-svn-id: https://develop.svn.wordpress.org/trunk@52315 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-03 18:02:40 +00:00
Tonya Mork
4e6823d17c Editor: Enable incomplete unit tests in Tests_Block_Template_Utils:: test_get_block_template_from_file().
At the time tests were backported from Gutenberg, a block template theme was not available in the test suite; thus, the test was marked as `markTestIncomplete()`.

Now that `block-theme` and `block-theme-child` test fixture block template themes are available, this commit removes the `markTestIncomplete()` and adjusts the test to run by switching to the `block-theme` test fixture.

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

Props bernhard-reiter.
Fixes #54551.

git-svn-id: https://develop.svn.wordpress.org/trunk@52314 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-03 16:57:19 +00:00
Jb Audras
281142bfb4 Coding standards: Address a few coding standards issues after [52312].
Follow-up to [52312].

See #54558.


git-svn-id: https://develop.svn.wordpress.org/trunk@52313 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-03 15:34:51 +00:00
Jb Audras
108e65819a Editor: Avoid undefined index notices in the Template Parts Editor.
This changes adds a leading slash when needed in the `?context=edit` path to avoid an `undefined index` notice in the Template Parts Editor.

Follow-up to [52275].

Props kafleg, costdev, mukesh27, Boniu91.
Fixes #54558.


git-svn-id: https://develop.svn.wordpress.org/trunk@52312 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-03 15:28:21 +00:00
Jb Audras
1270c897a9 REST API: Use global transients for URL details endpoint.
Follow-up to [51973].

Props peterwilsoncc, costdev.
Fixes #54499.


git-svn-id: https://develop.svn.wordpress.org/trunk@52311 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-03 11:34:55 +00:00
Sergey Biryukov
9484989819 Tests: Fix typo in a WP_Test_REST_Posts_Controller test method name.
Follow-up to [42423].

See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@52310 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-03 05:57:04 +00:00
Peter Wilson
cbea717875 KSES: Accept port number in PDF upload paths.
Improves the URL validation in `_wp_kses_allow_pdf_objects()` to account for sites using an upload path that contains a port, for example wp.org:8080.

Follow up to [51963], [52304].

Props ocean90, ramonopoly, talldanwp.
See #54261.



git-svn-id: https://develop.svn.wordpress.org/trunk@52309 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-03 02:42:17 +00:00
Jb Audras
d2b043b468 Editor: Allow child theme PHP templates to take precedence over parent theme block templates.
This change fixes template resolution to give precedence to child theme PHP templates over parent theme block templates with equal specificity.

Before this change, when a theme was using a PHP template of a certain specificity (e.g. `page-home.php`), and it happened to be a child theme of another theme which had a block template for the same specificity (e.g. `page-home.html`), WordPress was picking the parent theme’s block template over the child theme’s PHP template to render the page. If the PHP and block template have equal specificity, the child theme's template should be used.

The issue was fixed before in Gutenberg so the fix now needs to happen in Core.

This change also re-enables the preexisting template resolution unit tests.

Follow-up to [51003].

Props bernhard-reiter, youknowriad.
Fixes #54515.


git-svn-id: https://develop.svn.wordpress.org/trunk@52308 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-02 23:35:20 +00:00
Jb Audras
30ed9e8a8c Docs: Docblock typo correction in WP_Theme_JSON_Schema.
Follow-up to [52306].

See #53399.


git-svn-id: https://develop.svn.wordpress.org/trunk@52307 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-02 20:43:09 +00:00
Jb Audras
80ea6dbd6a Docs: Add missing @since tag to WP_Theme_JSON_Schema functions.
Follow-up to [52049].

See #53399, #54336.


git-svn-id: https://develop.svn.wordpress.org/trunk@52306 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-02 20:25:35 +00:00
Sergey Biryukov
8bd1509ea8 Docs: Fix typo in some get_edit_term_link() test DocBlocks.
Follow-up to [52180], [52255].

See #50225, #53399.

git-svn-id: https://develop.svn.wordpress.org/trunk@52305 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-02 05:39:57 +00:00
Peter Wilson
5fa8d73b1b KSES: Allow attributes to be restricted via callbacks.
Add callback validation to HTML tag attributes for increased flexibility over an array of values only.

In `object` tags, validate the `data` attribute via a callback to ensure it is a PDF and matches the `type` attribute. This prevents mime type mismatches in browsers.

Follow up to [51963].

Props Pento, dd32, swissspidy, xknown, peterwilsoncc.
Fixes #54261.



git-svn-id: https://develop.svn.wordpress.org/trunk@52304 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-02 00:54:03 +00:00
Jb Audras
77059b1723 Docs: Add missing @param to wp_set_unique_slug_on_create_template_part().
Follow-up to [52062].

See #53399.


git-svn-id: https://develop.svn.wordpress.org/trunk@52303 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-01 23:59:55 +00:00
Jb Audras
2eed880735 Docs: Miscellaneous Docblock corrections in several /block-supports files.
See #53399.


git-svn-id: https://develop.svn.wordpress.org/trunk@52302 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-01 23:14:22 +00:00
Jb Audras
0e478d258b Docs: Misc Docblock corrections in duotone.php file.
Follow-up to [50929].

See #53399.


git-svn-id: https://develop.svn.wordpress.org/trunk@52301 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-01 14:06:10 +00:00
John Blackbourn
7819ca4e3e Plugins: Correct the documented allowable types for to the $callback parameter of various hook related functions.
These functions don't require the callback to be a valid callable, therefore `array` and `string` are also valid types for this parameter.

Props malthert

Fixes #54440


git-svn-id: https://develop.svn.wordpress.org/trunk@52300 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-01 13:20:36 +00:00