Editor: Reinstate old persistence system configuration for the block editor usage data.

In [54182], the configuration for the old preference persistence system was removed. This system is still used for block usage data (to show the most frequently used blocks in the inserter). Furthermore some plugins may use this persistence system.

This changeset reinstates the previous persistence system used by the "Most used blocks" feature in the block inserter.

Follow-up to [54182].

Props talldanwp.
Fixes #56778.

Built from https://develop.svn.wordpress.org/trunk@54485


git-svn-id: http://core.svn.wordpress.org/trunk@54044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
audrasjb 2022-10-11 15:30:11 +00:00
parent 08dd56a8b1
commit 2ddc837e83
2 changed files with 17 additions and 1 deletions

View File

@ -383,6 +383,22 @@ function wp_default_packages_inline_scripts( $scripts ) {
) )
); );
// Backwards compatibility - configure the old wp-data persistence system.
$scripts->add_inline_script(
'wp-data',
implode(
"\n",
array(
'( function() {',
' var userId = ' . get_current_user_ID() . ';',
' var storageKey = "WP_DATA_USER_" + userId;',
' wp.data',
' .use( wp.data.plugins.persistence, { storageKey: storageKey } );',
'} )();',
)
)
);
// Calculate the timezone abbr (EDT, PST) if possible. // Calculate the timezone abbr (EDT, PST) if possible.
$timezone_string = get_option( 'timezone_string', 'UTC' ); $timezone_string = get_option( 'timezone_string', 'UTC' );
$timezone_abbr = ''; $timezone_abbr = '';

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.1-beta3-54484'; $wp_version = '6.1-beta3-54485';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.