Last active
September 28, 2022 09:43
-
-
Save nicmare/525bb742e3b67dba6d48711e0ddd206a to your computer and use it in GitHub Desktop.
use theme.json along with Blocksy Customizer Content Width settings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function blocksy_layout_update($editor_settings, $block_editor_context){ | |
// default values: | |
$editor_settings["__experimentalFeatures"]["layout"]["contentSize"] = "var(--has-wide, var(--block-max-width))"; | |
$editor_settings["__experimentalFeatures"]["layout"]["wideSize"] = "calc(var(--block-max-width) + 260px)"; | |
// maybe add offset values: | |
if($mods = get_theme_mods()) | |
if(isset($mods["wideOffset"])) | |
$editor_settings["__experimentalFeatures"]["layout"]["wideSize"] = "calc(var(--block-max-width) + ".($mods["wideOffset"]*2)."px)"; | |
return $editor_settings; | |
} | |
add_filter( 'block_editor_settings_all', 'blocksy_layout_update',10,2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment