48651 Commits

Author SHA1 Message Date
Greg Ziółkowski
ea502c4570 Tests: Rename and improve the blocks/context.php file to follow handbook
Renames `context.php` and `Tests_Blocks_Context` to `renderBlock.php` and `Tests_Blocks_RenderBlock`. See https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#test-classes. 

Simplifies also the tear_down method by using the same convention as in [56759].

Props costdev, ockham.
Follow-up [48224].
See #49927.



git-svn-id: https://develop.svn.wordpress.org/trunk@56761 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-03 08:52:54 +00:00
Greg Ziółkowski
bd772d60eb Chore: Remove empty test file that was missed after renaming the file
Follow-up [56759].



git-svn-id: https://develop.svn.wordpress.org/trunk@56760 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-03 08:34:36 +00:00
Greg Ziółkowski
d7c3092054 Tests: Cover Block Hooks integration with a custom block theme
Adds a simplified version of Twenty Twenty-Three theme that helps testing Block Hooks integration. The theme contains:

- The required index.html template.
- The optional single.html template used with tests.
- 3 template parts where two of them reference patterns.
- 3 patterns referenced in the templates and the template parts.

New tests automatically register 4 custom blocks with the test theme where each of them hooks into another block using all four target relative positions: `before`, `after`, `firstChild`, `lastChild`.

The tests verify that the block gets hooked into the correct positions when targeting:

- template
- template part
- pattern

Props ockham, costdev.
See #59313, #59383.
Follow-up [56610].


git-svn-id: https://develop.svn.wordpress.org/trunk@56759 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-03 08:27:51 +00:00
Daniel Bachhuber
a1852bd49b Editor: Add function prefix to avoid conflicts.
Transforms `initialize_theme_preview_hooks` to `wp_initialize_theme_preview_hooks` to avoid conflicts with third-party code.

Follow up to [56529].

Props okat.
See #59000.


git-svn-id: https://develop.svn.wordpress.org/trunk@56757 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-02 22:40:36 +00:00
Felix Arntz
bc259ddd3f Media: Prevent PHP notice in get_avatar().
Follow up fix to [56690].

Props pereirinha, mukesh27, spacedmonkey.
Fixes #58892.


git-svn-id: https://develop.svn.wordpress.org/trunk@56756 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-02 20:12:13 +00:00
Tammie Lister
1d0876b676 Update npm packages to latest.
The npm packages needed a further update for beta 2 in preparation for 6.4.

Props @mmaattiiaass , @wildworks , @aaronrobertshaw, @bartkalisz, @mamaduka, @artemiosans, @youknowriad, @czapla, @richtabor, @glendaviesnz, @pbking, @cbravobernal, @madhudollu, @kevin940726, @adamsilverstein, @get_dave, @ntsekouras, @ramonopoly, @jffng, @swissspidy, @carlosgprim, @siobhyb, @mikachan.

See #59411.


git-svn-id: https://develop.svn.wordpress.org/trunk@56755 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-02 18:55:27 +00:00
Felix Arntz
e686e81122 Script Loader: Fix missing documentation for the $path argument of wp_enqueue_block_style().
See #59466.


git-svn-id: https://develop.svn.wordpress.org/trunk@56754 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-02 18:46:30 +00:00
Sergey Biryukov
f7d73158ac Coding Standards: Remove redundant ignore annotations, take 5.
The `VariableAnalysis` standard is not used by WP Core.

Follow-up to [50958], [51003], [52049], [52051], [52069], [53072], [54132], [55132], [56363], [56738], [56743], [56751], [56752].

Props jrf.
See #59161.

git-svn-id: https://develop.svn.wordpress.org/trunk@56753 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-02 11:25:35 +00:00
Sergey Biryukov
8bbeee43b6 Coding Standards: Remove redundant ignore annotations, take 4.
This removes ignore annotations related to sniffs which are not used by WP Core (like sniffs in the `WordPress-Extra` ruleset).

Follow-up to [48072], [51003], [55204], [56714].

Props jrf.
See #59161.

git-svn-id: https://develop.svn.wordpress.org/trunk@56752 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-01 00:20:53 +00:00
Sergey Biryukov
00ed25e2c9 Coding Standards: Remove redundant ignore annotations, take 3.
This removes ignore annotations about invalid function names for deprecated functions. Those are ignored by design in WPCS since version 2.2.0.

Follow-up to [45580], [47612], [47927].

Props jrf.
See #59161.

git-svn-id: https://develop.svn.wordpress.org/trunk@56751 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-30 07:37:34 +00:00
Weston Ruter
1092ac0ea7 Script Loader: Remove erroneous type attribute from script tag wrapper on login screen.
This was causing a `_doing_it_wrong()` notice from `wp_remove_surrounding_empty_script_tags()`. In fact, the `type` attribute was added in [56748] to test this incorrect usage notice. This commit reverts that change.

Follow-up to [56748].
Unprops westonruter.
See #58664.


git-svn-id: https://develop.svn.wordpress.org/trunk@56750 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-29 21:59:14 +00:00
Weston Ruter
1427d84abc Customize: Harden and modernize URL manipulation in WP_Customize_Manager::remove_frameless_preview_messenger_channel().
Since IE11 is no longer supported, the `URL` and `URLSearchParams` APIs can now be leveraged for simpler and more robust URL manipulation. This was done similarly in [56383] for `embed.js`.

Props nicolefurlan, dmsnell, westonruter.
Fixes #59480.


git-svn-id: https://develop.svn.wordpress.org/trunk@56749 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-29 21:37:06 +00:00
Weston Ruter
8c0adc93df Script Loader: Harden removal of script tag wrappers.
* Add `wp_remove_surrounding_empty_script_tags()` to more precisely remove script tag wrappers and warn when doing it wrong.
* Add clarifying comments for XML escaping logic in `wp_get_inline_script_tag()`.
* Leverage `WP_HTML_Tag_Processor` in `test_remove_frameless_preview_messenger_channel`.
* Reuse `assertEqualMarkup` in `test_blocking_dependent_with_delayed_dependency`.
* Normalize whitespace in `parse_markup_fragment` for `assertEqualMarkup`.

Follow-up to [56687].
Props dmsnell, westonruter, flixos90.
See #58664.


git-svn-id: https://develop.svn.wordpress.org/trunk@56748 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-29 19:45:53 +00:00
Jonny Harris
4baf0a1eda Comments: Improve WP_Comment_Query count query performance by setting 'order by' to 'none'.
In cases where `WP_Comment_Query` or `get_comments` is employed with the 'count' parameter set to true, specify 'order by' as 'none'. Since these queries serve solely to determine the count of comments matching specific query parameters, the 'order by' clause becomes redundant and places unnecessary strain on the database server, resulting in slower query execution. Given that count queries are executed on every admin request to retrieve comment counts, this change enhances the performance of the wp-admin interface.

Props guss77, davidbaumwald, SergeyBiryukov, westonruter, peterwilsoncc, foliovision, hareesh-pillai, spacedmonkey.
Fixes #58368

git-svn-id: https://develop.svn.wordpress.org/trunk@56747 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-29 17:11:21 +00:00
Aaron Jorbin
702e2c76a6 Tests: Reduce usage of assertEquals
Replaces assertSame with assertCount in a number of tests.

Props ayeshrajans, jorbin.
See #58956.


git-svn-id: https://develop.svn.wordpress.org/trunk@56746 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-29 15:22:12 +00:00
Adam Silverstein
1f914ecb2f Revisions: slash meta values for autosave (preview) revisions.
Correct an issue where meta values containing characters like quote `”` could not be previewed on published posts. The function `update_metadata` expects data to be slashed.

Also, add a test to confirm that storing JSON data which requires slashing in autosave meta works as expected, and improve naming for a data provider added in [56714].

Follow up to [56714].

Props mukesh27, spacedmonkey.
Fixes #20564.



git-svn-id: https://develop.svn.wordpress.org/trunk@56745 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-29 15:05:40 +00:00
Jonny Harris
345fb48865 Editor: Avoid Deferring Loading for Empty Block Script URI
In the context of register_block_script_handle, the get_block_asset_url function may return false when an empty string is provided as the input. This behavior is intended to prevent the generation of invalid URLs. However, when the script loading strategy is set to "defer" while passing false, it triggers a "doing it wrong" message.

This situation becomes problematic, especially for scenarios where the scripts haven't been built yet. In such cases, the realpath call returns an empty string because the file doesn't exist. To address this issue, we now perform a simple check to ensure that the script URI is not empty before applying the "defer" loading strategy. This adjustment prevents unnecessary deferral of loading for scripts with empty URIs.

Follow on from [56683] and [56033].

Props kebbet, mukesh27, swissspidy, westonruter, spacedmonkey.
Fixes #59475

git-svn-id: https://develop.svn.wordpress.org/trunk@56744 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-29 13:13:54 +00:00
Sergey Biryukov
0f0d34ed55 Coding Standards: Remove redundant ignore annotations, take 2.
This removes ignore annotations which are unnecessary due to the configuration in the `phpcs.xml.dist` ruleset already taking care of this.

Follow-up to [45611], [50146], [50148], [50586], [50822], [56738].

Props jrf.
See #59161.

git-svn-id: https://develop.svn.wordpress.org/trunk@56743 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-29 12:19:29 +00:00
Jonny Harris
71080fa580 Editor: Replace property_exists calls in block related functions with instanceof
Replace calls to `property_exists` with `instanceof WP_Block_Type` in block related functions. This change not only improves type safety but also enhances performance.

Follow on from [56678] and [56677].

Props gziolo, aristath, aaronrobertshaw, spacedmonkey.
Fixes #59453

git-svn-id: https://develop.svn.wordpress.org/trunk@56742 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-29 10:18:05 +00:00
Sergey Biryukov
a80165b78f Coding Standards: Remove temporary exclusion from the PHPCS ruleset.
Now that the `block-library` package is updated for WP 6.4, this is no longer necessary.

Related PR from Gutenberg repository:
* [https://github.com/WordPress/gutenberg/pull/53866 #53866 Update WPCS to v3.0, and fix all reported Coding Standards issues]

Follow-up to [56695], [56710].

See #59161.

git-svn-id: https://develop.svn.wordpress.org/trunk@56741 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-28 22:30:20 +00:00
Tonya Mork
f0a1369441 Code Modernization: Fix "passing null to non-nullable" deprecation from next_posts().
The `esc_url()` function expects to a string for `$url` parameter. There is no input validation within that function. The function contains a `ltrim()` which also expects a string. Passing `null` to this parameter results in `Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated` notice on PHP 8.1+.

Tracing the stack back, a `null` is being passed to it within `next_posts()` when `get_next_posts_page_link()` returns `null` (it can return a string or `null`).

On PHP 7.0 to PHP 8.x, an empty string is returned from `esc_url()` when `null` is passed to it. The change in this changeset avoids the deprecation notice by not invoking `esc_url()` when `get_next_posts_page_link()` returns `null` and instead sets the `$output` to an empty string, thus maintain the same behavior as before (minus the deprecation notice).

Adds a test to validate an empty string is returned and the absence of the deprecation (when running on PHP 8.1+).

Follow-up to [11383], [9632].

Props codersantosh, nihar007, hellofromTonya, mukesh27, oglekler, rajinsharwar.
Fixes #59154.

git-svn-id: https://develop.svn.wordpress.org/trunk@56740 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-28 21:24:35 +00:00
Greg Ziółkowski
e3a612a97c General: Set the correct script version for regenerator-runtime
Follow-up for [56710]. Brings back the version specified in the `package.json` file.

Props ockham.
See #59411.



git-svn-id: https://develop.svn.wordpress.org/trunk@56739 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-28 08:33:25 +00:00
Sergey Biryukov
ea5856efe8 Coding Standards: Remove redundant ignore annotations.
This removes ignore annotations which are ignoring an error which would not be thrown for that code.

Includes tidying up the format of the ignore annotation:
* Customary one space between the `//` and the start of the comment.
* There should be no spaces in the comma-separated sniff list.

Follow-up to [45607], [47185], [49200], [53152].

Props jrf.
See #59161.

git-svn-id: https://develop.svn.wordpress.org/trunk@56738 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-28 00:02:47 +00:00
Tonya Mork
6fa2ce424f Editor: Remove 'wp-edit-site' stylesheet enqueue from iframe.
Removes enqueuing the `'wp-edit-site'` stylesheet from the iframed assets in `_wp_get_iframed_editor_assets()`.

The global `$pagenow` is also removed as it is no longer used within the function.

References:
* [https://github.com/WordPress/gutenberg/pull/54254 Gutenberg PR 54254]

Props ellatrix, jorgefilipecosta, Mamaduka, mukesh27.

Follow-up to [56047], [53160].
Fixes #59456.

git-svn-id: https://develop.svn.wordpress.org/trunk@56736 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-27 17:38:38 +00:00
Colin Stewart
e34c8b7fbc Filesystem API: Free the archive in _unzip_file_ziparchive().
There are several early returns in `_unzip_file_ziparchive()` which don't close the archive prior to returning.

As this function is used in installation and upgrade processes which are memory-intensive, this calls `ZipArchive::close()` to free the archive prior to each early return. This excludes the first return which is a result of a failure to open the archive, which is [https://github.com/nih-at/libzip/blob/main/lib/zip_open.c#L62-L73 freed internally] when the failure occurs.

References:
- PHP.net: [https://www.php.net/manual/en/ziparchive.open.php ZipArchive::open()] and [https://www.php.net/manual/en/ziparchive.close.php ZipArchive::close()]
- libzip: [https://libzip.org/documentation/zip_open.html zip_open()] and [https://libzip.org/documentation/zip_close.html zip_close()]

Follow-up to: [13005], [13006], [13015], [13221], [14346] [25779].

Props azaozz, afragen, joemcgill, costdev.
Fixes #59467

git-svn-id: https://develop.svn.wordpress.org/trunk@56735 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-27 16:29:37 +00:00
Tonya Mork
d740727ea8 Text Changes: Remove empty space in Erase Personal Data help tab.
Improves the text by removing an empty space at the end of a string within the "Default Data" help tab of the "Erase Personal Data".

Props azharckra, kebbet, krupalpanchal, mukesh27.

Follow-up to [53182].
Fixes #59473.

git-svn-id: https://develop.svn.wordpress.org/trunk@56734 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-27 15:42:29 +00:00
Bernie Reiter
b52cd85390 Blocks: Add unit test coverage for Patterns registry.
Prior to this changeset, we did not seem to have any unit test coverage for the Patterns registry (`WP_Block_Patterns_Registry`).

With Block Hooks logic recently added ([56649]), it is particularly advisable to add some unit tests to the `get_registered()` and `get_all_registered()` methods to guard hooked block insertion against regressions.

Fixes #59476.

git-svn-id: https://develop.svn.wordpress.org/trunk@56733 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-27 13:08:35 +00:00
Sergey Biryukov
711e4b9b97 Bootstrap/Load: Remove a redundant continue statement in add_magic_quotes().
Follow-up to [48205], [48440].

Props Cybr.
See #58831.

git-svn-id: https://develop.svn.wordpress.org/trunk@56732 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-27 09:40:43 +00:00
Isabel Brison
972632085f Editor: fix undefined array key warning.
Checks if `attrs` array key exists before using its value.

Props mukesh27, kafleg.
Fixes #59468.


git-svn-id: https://develop.svn.wordpress.org/trunk@56731 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-27 05:10:28 +00:00
Tammie Lister
7cf8998e46 Post WordPress 6.4 Beta 1 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@56730 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-26 20:16:38 +00:00
Tammie Lister
6b35688b82 WordPress 6.4 Beta 1.
git-svn-id: https://develop.svn.wordpress.org/trunk@56729 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-26 19:52:42 +00:00
Tonya Mork
df17fdbd05 Editor: 2nd package updates for 6.4 Beta 1.
Round 2 of package updates for 6.4. Beta 1 which includes disabling the rendering of the Font Library in Core.

The full list of changes are found here 641b696cd6.

Follow-up to [56710], [56713].

Props mikachan, mmaattiiaass, mamaduka, desrosj, ockham, hellofromTonya.
See #59411.

git-svn-id: https://develop.svn.wordpress.org/trunk@56728 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-26 19:08:58 +00:00
Tammie Lister
1b1c6afd46 Bundled Themes: Twenty Twenty-Four is now the default theme.
Follow up to [56716].
Props desrosj.

See #59447.


git-svn-id: https://develop.svn.wordpress.org/trunk@56727 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-26 17:31:28 +00:00
Jonathan Desrosiers
0b3e704899 Twenty Twenty-Four: Fix issue with theme screenshot.
Follow up to [56716] and [56725].

Props karmatosed.
Fixes #59447.

git-svn-id: https://develop.svn.wordpress.org/trunk@56726 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-26 17:13:44 +00:00
Jonathan Desrosiers
eb5e39db69 General: Define the desired mime-type for WebP files.
Fixes #59463.

git-svn-id: https://develop.svn.wordpress.org/trunk@56725 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-26 17:05:24 +00:00
Bernie Reiter
76c6b57867 Templates: Introduce _remove_theme_attribute_from_template_part_block.
Introduce a `_remove_theme_attribute_from_template_part_block()` function that can be used as a callback argument for `traverse_and_serialize_block(s)` on a parsed block tree in order to remove the `theme` attribute from all Template Part blocks found therein, and deprecate `_remove_theme_attribute_in_block_template_content()`.

Counterpart to `_inject_theme_attribute_in_template_part_block` from #59338 (which superseded `_inject_theme_attribute_in_block_template_content`, deprecated in #59452).

Props mukesh27.
Fixes #59460.

git-svn-id: https://develop.svn.wordpress.org/trunk@56724 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-26 16:59:11 +00:00
Sergey Biryukov
0ed8dcda72 HTTP API: Deprecate the http_api_transports filter.
The filter is only used within the `WP_Http::_get_first_available_transport()` method, which has been marked as deprecated in favor of `\WpOrg\Requests\Requests::get_transport_class()`.

Follow-up to [56655]

Props desrosj, hellofromTonya.
Fixes #58705.

git-svn-id: https://develop.svn.wordpress.org/trunk@56723 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-26 16:53:20 +00:00
Bernie Reiter
166e042683 Templates: Move old theme attr injection function to deprecated.php.
Move the now-deprecated function `_inject_theme_attribute_in_block_template_content` from `wp-includes/block-template-utils.php` to `wp-includes/deprecated.php`.

Follow-up [56719].
Props spacedmonkey, davidbaumwald, mukesh27.
See #59452.

git-svn-id: https://develop.svn.wordpress.org/trunk@56722 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-26 16:47:24 +00:00
Jonathan Desrosiers
b5cb86a482 Twenty Twenty-Four: Fix font and image assets.
This updates the font and image files to include the correct file contents.

Follow up to [56716].

Props onemaggie, karmatosed.
See #59447.

git-svn-id: https://develop.svn.wordpress.org/trunk@56721 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-26 16:44:05 +00:00
Colin Stewart
a5c6a766a3 Toolbar: Link to Learn WordPress in the WordPress Logo menu.
This aims to make the various resources on learn.wordpress.org more easily available.

Props jeherve, mikinc860, audrasjb, sabernhardt, courane01, devmuhib, dhrumilk, estelaris, hellofromTonya.
Fixes #58820.

git-svn-id: https://develop.svn.wordpress.org/trunk@56720 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-26 16:27:58 +00:00
Bernie Reiter
5e09e5e18e Templates: Deprecate _inject_theme_attribute_in_block_template_content.
It can be replaced by passing `_inject_theme_attribute_in_template_part_block` as second argument to `traverse_and_serialize_blocks()`.

Per WordPress 6.4 Beta 1, there aren't going to be any more calls in Core to `_inject_theme_attribute_in_block_template_content()`.

Note that `_inject_theme_attribute_in_block_template_content` has always had `@access private` set in its PHPDoc.

Props gziolo.
Fixes #59452.

git-svn-id: https://develop.svn.wordpress.org/trunk@56719 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-26 16:17:18 +00:00
Sergey Biryukov
2e863375a1 Login and Registration: Add /login.php as an alias for the login page.
This aims to make the login process more user-friendly.

Follow-up to [19875], [19880].

Props lancewillett, subrataemfluence, tejwanihemant, ankit-k-gupta, devmuhib, audrasjb, hellofromTonya, joemcgill.
Fixes #40762.

git-svn-id: https://develop.svn.wordpress.org/trunk@56718 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-26 16:09:38 +00:00
Felix Arntz
319e6b8857 Options, Meta APIs: Fix follow up bug when comparing values for options using the pre_option_{$option} filter.
This fix is relevant for options such as `gmt_offset` that use a filter to force a specific value regardless of what is stored in the database.

Props mamaduka, flixos90, mukesh27, spacedmonkey.
See #22192.


git-svn-id: https://develop.svn.wordpress.org/trunk@56717 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-26 15:53:39 +00:00
Tammie Lister
6e635242ec Bundled Themes: Import Twenty Twenty-Four, the new default theme for WordPress 6.4.
Twenty Twenty-Four is designed to be flexible, versatile and applicable to any website. Its collection of templates and patterns tailor to different needs, such as presenting a business, blogging and writing or showcasing work. A multitude of possibilities open up with just a few adjustments to color and typography.

Twenty Twenty-Four comes with style variations and full page designs to help speed up the site building process, is fully compatible with the site editor, and takes advantage of new design tools introduced in WordPress 6.4. 

Twenty-Four karat magic in the air!

Props onemaggie, luminuu, beafialho, chrisdesrochers, amedv, melchoyce, kafleg, jeffikus, poena, robpetrin, hiyascout, audrasjb, huzaifaalmesbah, fabiankaegy, jordesign, vcanales, shailu25, jessplease, juanfra, maneshtimilsina, sabernhardt, richtabor, travel_girl, kishanjasani, sofiashendi, nudge, gnanasekaran, marcelle42, bosskhj, oncecoupled, bijayyadav, barbmiller, devmuhib, lyndauwp, kraftbj, alaminfirdows, littlebigthing, dhamibirendra, jeffpaul, kopila47, rabmalin, aplauche, colorful-tones, khleomix, pbking, esratpopy, scruffian, alexandrebuffet, gpotter, pbwebd, anphira, suprsam, damonsharp, maurodf, soean, kawsaralameven, mhimon, rajinsharwar, labunchemjong, bonkerz, karmacharya50, aristath, mukesh27, mikachan, joedolson, aurooba, afercia, jffng, benimub, joen, tanvirul, jeryj, thelovekesh, mrwweb, nielslange, sergiomdgomes, binsaifullah, hanneslsm, masoudnkh, dhrumilk, dianeco, webmandesign, desrosj.
See #59447.


git-svn-id: https://develop.svn.wordpress.org/trunk@56716 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-26 15:48:05 +00:00
Adam Silverstein
5ee043bb33 Revisions: avoid double call to wp_restore_post_revision_meta when restoring post.
Remove an extra call to `wp_restore_post_revision_meta` - the meta restore action is already hooked to `wp_restore_post_revision`.

Follow up to [56714].

Props: spacedmonkey.
Fixes #20564.



git-svn-id: https://develop.svn.wordpress.org/trunk@56715 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-26 15:42:56 +00:00
Adam Silverstein
4f56c3d18a Revisions: framework for storing post meta revisions.
Enable the storing of post meta in revisions including autosaves and previews:

Add a new argument `revisions_enabled` to the `register_meta` function which enables storing meta in revisions.

Add a new `wp_post_revision_meta_keys` filter which developers can use to control which meta is revisioned - it passes an array of the meta keys with revisions enabled as well as the post type.

Meta keys with revisions enabled are also stored for autosaves, and are restored when a revision or autosave is restored. In addition, meta values are now stored with the autosave revision used for previews. Changes to meta can now be previewed correctly without overwriting the published meta (see #20299) or passing data as a query variable, as the editor currently does to preview changes to the featured image.

Changes to meta with revisions enabled are considered when determining if a new revision should be created. A new revision is created if the meta value has changed since the last revision.

Revisions are now saved on the `wp_after_insert_post` hook instead of `post_updated`. The `wp_after_insert_post` action is fired after post meta has been saved by the REST API which enables attaching meta to the revision. To ensure backwards compatibility with existing action uses, `wp_save_post_revision_on_insert` function exits early if plugins have removed the previous `do_action( 'post_updated', 'wp_save_post_revision' )` call.

Props: alexkingorg, johnbillion, markjaquith, WraithKenny, kovshenin, azaozz, tv-productions, p51labs, mattheu, mikeschroder, Mamaduka, ellatrix, timothyblynjacobs, jakemgold, bookwyrm, ryanduff, mintindeed, wonderboymusic, sanchothefat, westonruter, spacedmonkey, hellofromTonya, drewapicture, adamsilverstein, swisspiddy.
Fixes #20564, #20299.




git-svn-id: https://develop.svn.wordpress.org/trunk@56714 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-26 15:30:34 +00:00
Tammie Lister
f84d5c2249 Update regenerated build files.
This adds in missed generated build files from commit for [56710].

Props desrosj.
See #59411.


git-svn-id: https://develop.svn.wordpress.org/trunk@56713 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-26 15:25:50 +00:00
Colin Stewart
332304a1be Quick/Bulk Edit: Pre-fill category fields with their status.
This pre-fills category fields in the Quick/Bulk Edit form with their current status.

When bulk editing, if only some of the selected items are in a given category, the category's checkbox will display a line to indicate an indeterminate status.

Props pavelevap, scribu, chasedsiedu, helen, joshcanhelp, ubernaut, Cyberchicken, laumindproductscomau, SergeyBiryukov, Marcoevich, tomybyte, thinkluke, virtality-marketing-solutions, Michalooki, dmsnell, itecrs, pannelars, WHSajid, samba45, Mte90, johnbillion, tomluckies, soulseekah, francina, oglekler, ajmcfadyen, mukesh27, costdev.
Fixes #11302.

git-svn-id: https://develop.svn.wordpress.org/trunk@56712 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-26 15:03:19 +00:00
Tonya Mork
dc31cf0624 Media: Change link text when attachment pages disabled.
When attachment pages are disabled, change the links from "View Attachment Page" to "View Media File".

Follow-up to [56657], [56658].

Props joedolson, ironprogrammer, oglekler.
Fixes #57913.

git-svn-id: https://develop.svn.wordpress.org/trunk@56711 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-26 14:43:25 +00:00
Tammie Lister
ae1484cbb6 Update editor related npm packages
The npm packages needed updating for 6.4 to the latest.

Props mikachan, mukesdpanchal27, luisherranz, youknowriad, tellthemachines, gziolo, ockham, michalczaplinski

Fixes #59411



git-svn-id: https://develop.svn.wordpress.org/trunk@56710 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-26 14:20:18 +00:00