get_theme_mode & set_theme_mode in block editor
-
Background:
I’m transitioning from a traditional theme to a block theme.
Previously, I usedcustomize_register
to store theme data like footer credits, social links, etc. and retrieve them usingget_theme_mod
.Challenge:
In block themes, I need common attributes across all instances of a block (e.g., footer logo, copyright text).
Changing an attribute in one instance should update it globally.
What’s the recommended approach to managing these shared attributes in block themes?Key Points:
Theme Mods:
Are they still suitable for this purpose in block themes?
How can they be effectively accessed and updated within blocks using JSX?Alternative Solutions:
Are there better options for managing shared block attributes?
What are the pros and cons of different approaches?Best Practices:
What are the recommended practices for handling shared data in block themes?
How can I ensure a consistent user experience and avoid potential conflicts?
- The topic ‘get_theme_mode & set_theme_mode in block editor’ is closed to new replies.