Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // make child theme inherit all of Tempera's external WP options (header/bg/menus/widgets)
- if ( get_stylesheet() !== get_template() ) {
- add_filter(
- 'pre_update_option_theme_mods_' . get_stylesheet(),
- function ( $value, $old_value ) {
- update_option( 'theme_mods_' . get_template(), $value );
- return $old_value; // prevent update to child theme mods
- },
- 10,
- 2 );
- add_filter( 'pre_option_theme_mods_' . get_stylesheet(), function ( $default ) {
- return get_option( 'theme_mods_' . get_template(), $default );
- } );
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement