Jahirul Islam
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Workaround Needed to Make Patterns Editable and DetachedGlad 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! 🙂
Forum: Fixing WordPress
In reply to: Workaround Needed to Make Patterns Editable and DetachedHi @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().disableContentOnlyForUnsyncedPatternsIf 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 inwp-content/mu-plugins/). Reload the editor after fixing it.2. It returns
true, but the pattern is still lockedThen 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 firstwp:groupline. 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.
Forum: Fixing WordPress
In reply to: Workaround Needed to Make Patterns Editable and DetachedHi @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.
Hi @genepine,
I checked your sample page and found the cause. The Breadcrumbs block draws the separator with this CSS:
.wp-block-breadcrumbs li:not(:last-child)::after { content: var(--separator, "/") / ""; }The
/ ""part tells screen readers to skip the separator. Safari only understands it from version 17.4, and iOS 16.7 has an older Safari engine, so the whole rule is ignored. Every browser on an iPhone uses Safari’s engine, which is why Chrome and Firefox there fail too, while iOS 26 and Android work.iOS 16 is outside WordPress’s supported browsers, but a small CSS fallback fixes it. Add this under Appearance → Editor → Styles → ⋮ → Additional CSS:
@supports not (content: "a" / "") { :root .wp-block-breadcrumbs li:not(:last-child)::after { content: var(--separator, "/"); } }It only kicks in on browsers that don’t support that syntax, so newer browsers keep the default behaviour. The
:rootmakes sure it overrides the core rule.Forum: Fixing WordPress
In reply to: Custom HTML block is brokenHi @aegirr,
WordPress 7.1 changed the Custom HTML block. You no longer edit the code in the sidebar. Once the block is selected, there’s an Edit code button in the block toolbar and in the block’s Settings sidebar. It opens an “Edit HTML” window with HTML, CSS and JavaScript tabs; click Update to save.
The catch is that the block now shows your HTML live in the editor, so clicking on it hits the video or the link instead of selecting the block. To select it without clicking the content:
- Open List View (the three-lines icon in the top toolbar, or Shift+Alt+O; Ctrl+Option+O on Mac).
- Click the Custom HTML block in the list.
- Click Edit code.
For YouTube, pasting the video URL on its own line creates an Embed block, which avoids the problem entirely. If clicking a link actually takes you out of the editor, that looks like a bug worth reporting on Gutenberg GitHub with these steps.
- The pattern’s wrapper block has