Guest User

Untitled

a guest
Mar 12th, 2020
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  1. <?php
  2.      add_action( 'wp_enqueue_scripts', 'enigma_child_enqueue_styles' );
  3.      function enigma_child_enqueue_styles() {
  4.           wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
  5.           }
  6.  
  7. if ( get_stylesheet() !== get_template() ) {
  8. add_filter( 'pre_update_option_theme_mods_' . get_stylesheet(), function ( $value, $old_value ) {
  9. update_option( 'theme_mods_' . get_template(), $value );
  10. return $old_value; // prevent update to child theme mods
  11. }, 10, 2 );
  12. add_filter( 'pre_option_theme_mods_' . get_stylesheet(), function ( $default ) {
  13. return get_option( 'theme_mods_' . get_template(), $default );
  14. } );
  15. }        
  16.  ?>
Add Comment
Please, Sign In to add comment