SHARE
TWEET

Untitled

a guest Aug 19th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top