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

Preferences: Adding a toggle to hide Patterns. #36470

Closed
paaljoachim opened this issue Nov 13, 2021 · 4 comments
Closed

Preferences: Adding a toggle to hide Patterns. #36470

paaljoachim opened this issue Nov 13, 2021 · 4 comments
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced Needs Design Needs design efforts. [Type] Enhancement A suggestion for improvement.

Comments

@paaljoachim
Copy link
Contributor

paaljoachim commented Nov 13, 2021

What problem does this address?

Clients might insert patterns the web site designer/developer do not want the client to insert.

Screenshot 2021-11-13 at 23 56 41

What is your proposed solution?

For a web site designer/developer to have more control over a web site they might want to hide specific aspects such as inserting patterns. My suggestion is to add a toggle into the Preferences modal to hide Patterns from appearing inside the block inserter.

I am not sure where such a toggle would be inserted.

Screenshot 2021-11-13 at 23 58 13

We could probably followup and do the same treatment for the block Inserter Reusable tab.

@ntsekouras

This issue was influenced by Justin's article here and the comments seen below.
https://wptavern.com/block-pattern-modal-explorer-coming-to-wordpress-5-9

Associated:
[Patterns]: Add a flag to hide patterns from UI
#36108

@paaljoachim paaljoachim added [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Enhancement A suggestion for improvement. Needs Design Needs design efforts. labels Nov 13, 2021
@ntsekouras
Copy link
Contributor

There is should_load_remote_block_patterns filter that themes can use to hide the core patterns. I think having a flag in the preferences doesn't actually solves the issue described.

@ndiego
Copy link
Member

ndiego commented Nov 19, 2021

Yeah, also you can use the following to hide all core patterns.

remove_theme_support( 'core-block-patterns' );

If you combine this with #36108, you can hide all core patterns plus make any theme registered patterns hidden from the insertion UI. In doing so, the Pattern panel is hidden in the inserter.

This got me thinking though. I believe this info should be included in the Patterns doc. I don't mind writing it if everyone agrees.

@paaljoachim
Copy link
Contributor Author

@ndiego Nick do please add the info into the Patterns doc.
@mkaz can help if you need any help getting the information into the document.

@mtias
Copy link
Member

mtias commented May 27, 2022

Closing this as the presence of the patterns tab should be a reflection of whether there are registered patterns, not a separate preference.

@mtias mtias closed this as not planned Won't fix, can't repro, duplicate, stale May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced Needs Design Needs design efforts. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants