Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. // make child theme inherit all of Tempera's external WP options (header/bg/menus/widgets)
  2. if ( get_stylesheet() !== get_template() ) {
  3. add_filter(
  4. 'pre_update_option_theme_mods_' . get_stylesheet(),
  5. function ( $value, $old_value ) {
  6. update_option( 'theme_mods_' . get_template(), $value );
  7. return $old_value; // prevent update to child theme mods
  8. },
  9. 10,
  10. 2 );
  11. add_filter( 'pre_option_theme_mods_' . get_stylesheet(), function ( $default ) {
  12. return get_option( 'theme_mods_' . get_template(), $default );
  13. } );
  14. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement