• Resolved bigvibes

    (@bigvibes)


    I use patterns a lot. The WP 7.0 update to patterns has been driving me nuts. It feels like the site is broken. I just keep having to click “Edit Pattern” every time or “Detach Pattern” sometimes and then I have to remember which to do or both. Doing this multiple times for every post is time consuming and annoying.

    I looked into ways to disable this with code but the code I added didn’t work.

    I’d like to revert back to how patterns were before the update. Simple. Click the pattern and edit it. The general direction WP was going was to seamlessly edit everything on the page just as you see it by clicking on what you want to edit. Now I see this as a step backwards.

    If there’s no way to abandon this with a code override, does anyone have any workarounds for this?

    thank you

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hello @bigvibes

    There is not an easy way to revert this change. I suggest you to bring your suggestion in the Request and Feedback forum:
    https://wordpress.org/support/forum/requests-and-feedback/

    I think it may be a good User Experience improvement.

    Kind regards,
    Jair.

    Abdul Wahab Taqi

    (@abdulwahabtaqi)

    Unfortunately, there is no simple setting to fully revert patterns back to the old behavior.

    A practical workaround is to detach the pattern immediately after inserting it. That converts it into normal editable blocks, so later edits will not affect other places where the same pattern was used.

    For existing synced patterns, open the page, select the pattern, use the pattern/block options, and choose Detach or Detach pattern. After that, edit it normally.

    If you want this behavior changed globally, the best place is the Requests and Feedback forum, as Jiar mentioned, because this is now part of how WordPress handles synced patterns.

    Hi @bigvibes,

    This is the new content-only editing for patterns in WordPress 7.0, and there’s an official opt-out for unsynced patterns (dev note). Add this in a small mu-plugin, a child theme’s functions.php, or a snippets plugin:

    add_filter( 'block_editor_settings_all', function ( $settings ) {
    	$settings['disableContentOnlyForUnsyncedPatterns'] = true;
    	return $settings;
    } );

    The editor checks this every time it loads, so it also works for patterns already placed in existing posts. You don’t need to re-insert them.

    Two notes:

    • Synced patterns will still show “Edit original”, because editing them changes every page that uses them. Detach is still the way to change just one copy.
    • Without code, double-clicking inside a pattern also opens it for editing, which is quicker than the button.

    There’s also an open Gutenberg issue asking for an on/off switch in the editor.

    Thread Starter bigvibes

    (@bigvibes)

    @jahirulwp thanks for this message and the code. I’ve input the code and while I can edit some parts within the pattern (eg H2), some parts I cannot (eg separator). For those that I cannot I still have to click “edit pattern” in order to get inside the block’s controls. Is that the intended behaviour or is something wrong?

    Hi @bigvibes ,

    That’s not the intended behaviour. With the filter active, an unsynced pattern should act like a normal group of blocks, so the separator should be clickable directly.

    What you’re describing (text editable, separator locked) is exactly how content-only mode works: text and images stay editable, design blocks like separators and spacers are locked. So content-only is still active for that pattern. Two usual reasons:

    1. The snippet isn’t loading in the editor

    Open a post, press F12 → Console, paste this and press Enter:

    wp.data.select( 'core/block-editor' ).getSettings().disableContentOnlyForUnsyncedPatterns

    If it returns undefined, the code isn’t running in wp-admin. Common causes: the snippet plugin is set to “Frontend only” (it needs “Run everywhere”), the snippet isn’t activated, or the mu-plugin file is inside a subfolder (WordPress only loads files placed directly in wp-content/mu-plugins/). Reload the editor after fixing it.

    2. It returns true, but the pattern is still locked

    Then the lock comes from the pattern itself, which this setting doesn’t override:

    • The pattern’s wrapper block has "templateLock":"contentOnly" saved in its markup (common in theme and plugin patterns). Open â‹® → Code editor and look at the first wp:group line. Remove "templateLock":"contentOnly" along with the comma next to it, then switch back to the Visual editor. To stop it coming back on new inserts, remove it from the original pattern too.
    • Or it’s a synced pattern (toolbar shows “Edit original”) or it sits inside a template part like the header/footer. Those stay locked by design; Detach is the way for synced patterns.

    If you share what the console check returns and where the pattern comes from (your own saved pattern, the theme, or a plugin), I can narrow it down further.

    Thread Starter bigvibes

    (@bigvibes)

    Thanks so much @jahirulwp! It works now. I was injecting the code through a front-end editor by mistake. I’ve entered it via child theme now and it works just fine.

    This capability should be made standard on WP for people to just click a button to revert. It makes life so much easier and quicker!!

    Thread Starter bigvibes

    (@bigvibes)

    @wpmudevsupport15 good idea, I’m doing that now

    Glad it’s working now @bigvibes , that’s an easy mix-up. Snippets like this need to go in PHP (a child theme’s functions.php or a small plugin), not through a front-end editor, so moving it to your child theme was the right call.

    One tip: if you ever switch themes, the snippet goes with the child theme. To keep it no matter which theme you use, you can put the same code in a small custom plugin or a mu-plugin (a file in wp-content/mu-plugins/).

    I agree it would be great to have this built into core. If you’d like to push for it, you can open or upvote a feature request on the Gutenberg GitHub repo (github.com/WordPress/gutenberg/issues). Requests with clear use cases like yours do get noticed.

    If everything’s sorted, please mark this topic as resolved so others with the same question can find the fix. Happy building! 🙂

Viewing 8 replies - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.