Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove pattern override experiment completely #58105

Merged
merged 6 commits into from Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions lib/experimental/block-bindings/index.php
Expand Up @@ -10,10 +10,8 @@
// Register the sources.
$gutenberg_experiments = get_option( 'gutenberg-experiments' );
if ( $gutenberg_experiments ) {
if ( array_key_exists( 'gutenberg-pattern-partial-syncing', $gutenberg_experiments ) ) {
require_once __DIR__ . '/sources/pattern.php';
}
if ( array_key_exists( 'gutenberg-block-bindings', $gutenberg_experiments ) ) {
require_once __DIR__ . '/sources/pattern.php';
require_once __DIR__ . '/sources/post-meta.php';
}
}
6 changes: 1 addition & 5 deletions lib/experimental/blocks.php
Expand Up @@ -78,13 +78,9 @@ function wp_enqueue_block_view_script( $block_name, $args ) {
}
}




$gutenberg_experiments = get_option( 'gutenberg-experiments' );
if ( $gutenberg_experiments && (
array_key_exists( 'gutenberg-block-bindings', $gutenberg_experiments ) ||
array_key_exists( 'gutenberg-pattern-partial-syncing', $gutenberg_experiments )
array_key_exists( 'gutenberg-block-bindings', $gutenberg_experiments )
) ) {

require_once __DIR__ . '/block-bindings/index.php';
Expand Down
4 changes: 0 additions & 4 deletions lib/experimental/editor-settings.php
Expand Up @@ -33,10 +33,6 @@ function gutenberg_enable_experiments() {
if ( gutenberg_is_experiment_enabled( 'gutenberg-no-tinymce' ) ) {
wp_add_inline_script( 'wp-block-library', 'window.__experimentalDisableTinymce = true', 'before' );
}

if ( $gutenberg_experiments && array_key_exists( 'gutenberg-pattern-partial-syncing', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalPatternPartialSyncing = true', 'before' );
}
}

add_action( 'admin_init', 'gutenberg_enable_experiments' );
Expand Down
12 changes: 0 additions & 12 deletions lib/experiments-page.php
Expand Up @@ -138,18 +138,6 @@ function gutenberg_initialize_experiments_settings() {
)
);

add_settings_field(
'gutenberg-pattern-partial-syncing',
__( 'Pattern overrides', 'gutenberg' ),
'gutenberg_display_experiment_field',
'gutenberg-experiments',
'gutenberg_experiments_section',
array(
'label' => __( 'Test overrides in synced patterns', 'gutenberg' ),
'id' => 'gutenberg-pattern-partial-syncing',
)
);

register_setting(
'gutenberg-experiments',
'gutenberg-experiments'
Expand Down
Expand Up @@ -93,8 +93,7 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
topLevelLockedBlock:
__unstableGetContentLockingParent( _selectedBlockClientId ) ||
( getTemplateLock( _selectedBlockClientId ) === 'contentOnly' ||
( _selectedBlockName === 'core/block' &&
window.__experimentalPatternPartialSyncing )
_selectedBlockName === 'core/block'
? _selectedBlockClientId
: undefined ),
};
Expand Down
Expand Up @@ -77,8 +77,7 @@ export function useInBetweenInserter() {
if (
getTemplateLock( rootClientId ) ||
getBlockEditingMode( rootClientId ) === 'disabled' ||
( getBlockName( rootClientId ) === 'core/block' &&
window.__experimentalPatternPartialSyncing )
getBlockName( rootClientId ) === 'core/block'
) {
return;
}
Expand Down
3 changes: 1 addition & 2 deletions packages/block-editor/src/store/selectors.js
Expand Up @@ -2721,8 +2721,7 @@ export const __unstableGetContentLockingParent = createSelector(
current = state.blocks.parents.get( current );
if (
( current &&
getBlockName( state, current ) === 'core/block' &&
window.__experimentalPatternPartialSyncing ) ||
getBlockName( state, current ) === 'core/block' ) ||
( current &&
getTemplateLock( state, current ) === 'contentOnly' )
) {
Expand Down
Expand Up @@ -42,8 +42,8 @@ import { store as noticesStore } from '@wordpress/notices';
/**
* Internal dependencies
*/
import styles from '../editor.scss';
import EditTitle from '../edit-title';
import styles from './editor.scss';
import EditTitle from './edit-title';

export default function ReusableBlockEdit( {
attributes: { ref },
Expand Down
5 changes: 2 additions & 3 deletions packages/block-library/src/block/index.js
Expand Up @@ -8,15 +8,14 @@ import { symbol as icon } from '@wordpress/icons';
*/
import initBlock from '../utils/init-block';
import metadata from './block.json';
import editV1 from './v1/edit';
import editV2 from './edit';
import edit from './edit';

const { name } = metadata;

export { metadata, name };

export const settings = {
edit: window.__experimentalPatternPartialSyncing ? editV2 : editV1,
edit,
icon,
};

Expand Down
163 changes: 0 additions & 163 deletions packages/block-library/src/block/v1/edit.js

This file was deleted.

Expand Up @@ -2,7 +2,7 @@

exports[`Pattern blocks allows conversion back to blocks when the reusable block has unsaved edits 1`] = `
"<!-- wp:paragraph -->
<p>12</p>
<p>1</p>
<!-- /wp:paragraph -->"
`;

Expand Down