• e-lab innovations

    (@elabinnovations)


    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 using get_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?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi
    It depends on if you are creating themes, or building a website.
    Synced patterns, which are stored in the database, are the best option for the second.

    Facing a similar challenge on my website , I recommend leveraging Theme Mods for shared attributes in block themes. Utilize the wp.customize API for seamless access and updates in JSX. Alternatively, explore the Global Styles and Settings API for standardized management. For consistency, define a structured approach and consider incorporating shared data directly into block attributes. Ensure a smooth user experience by adhering to best practices and avoiding potential conflicts.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘get_theme_mode & set_theme_mode in block editor’ is closed to new replies.