Closed axlright closed 1 year ago
Yes! The child theme uses the 'thememod' filter to hard-code those values. And it includes a warning in the Customizer that some values are hard-coded. It doesn't disable the settings but they can't really be edited: https://github.com/understrap/understrap-child/blob/main/functions.php#L73
Thanks! Is there a relatively easy way to fully disable / remove those customization settings? I'd feel much more comfortable building websites for clients that don't have those customizations. Showing a warning that they don't work isn't ideal - it actually feels worse to have something that shouldn't be there that then shows a message that it may not work. I get that these customizations work for people making websites for themselves, but it doesn't fly for me for client work.
You can overwrite any function in the parent theme by declaring it in the child theme. So if you didn't want to register the customizer settings, you could overwrite that function and just leave it empty, something like this (untested):
function understrap_theme_customize_register() {}
Oh wow, okay thanks so much. Really appreciate the speedy replies!
Let us know if we're OK to close this issue
Yes! Thank you @bacoords the below totally works for me:
function understrap_default_bootstrap_version( $current_mod ) {
return 'bootstrap5';
}
add_filter( 'theme_mod_understrap_bootstrap_version', 'understrap_default_bootstrap_version', 20 );
function understrap_default_navbar_type( $current_mod ) {
return 'offcanvas';
}
add_filter( 'theme_mod_understrap_navbar_type', 'understrap_default_navbar_type', 20 );
function understrap_default_container_type( $current_mod ) {
return 'container';
}
add_filter( 'theme_mod_understrap_container_type', 'understrap_default_container_type', 20 );
function understrap_theme_customize_register() {}
Hello friends!
Does anyone know an easy way to turn off the customizations that show up in Appearance > Customize > Theme Layout Settings ( /wp-admin/customize.php )? I really don't want or need my clients changing the Bootstrap version, or anything like that. I'd like to set these customizations in functions.php then turn off these user controllable settings which would break the website if changed.
Thanks!
-Alex