You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the useAllowSwitchingTemplates is used to disable template swapping and creating for static home and blog pages. This prevents users from accidentally creating or swapping templates but still gives them information about the connected template and a path to edit it from the post editor, which is a nice UX.
Other plugins can benefit from this hook. For example, WooCommerce has Product Catalog, Cart, and Checkout page that uses fixed templates like the blog page.
What problem does this address?
Currently, the
useAllowSwitchingTemplates
is used to disable template swapping and creating for static home and blog pages. This prevents users from accidentally creating or swapping templates but still gives them information about the connected template and a path to edit it from the post editor, which is a nice UX.Other plugins can benefit from this hook. For example, WooCommerce has Product Catalog, Cart, and Checkout page that uses fixed templates like the blog page.
gutenberg/packages/editor/src/components/post-template/hooks.js
Lines 22 to 42 in e1e4967
The current hook only supports static home and blog page.
What is your proposed solution?
It'd be awesome to have a mechanism enabling plugins to manipulate the template-switching ability of the current editing page.
The text was updated successfully, but these errors were encountered: