Last active
November 7, 2019 18:58
-
-
Save skorasaurus/6231a717c89c69cb98f82abc2abf1583 to your computer and use it in GitHub Desktop.
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
| this is 7.0 ok. | |
| // 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 ); | |
| } ); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment