Created
February 23, 2021 07:26
-
-
Save yongkiagustinus/f379d022f73e02e88efe1db573dbdeeb to your computer and use it in GitHub Desktop.
Use this script to copy customization from parent theme
This file contains 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
<?php | |
/** | |
* This script just need to run once | |
* You can remove this script after the copy completed | |
*/ | |
function copy_parent_mods(){ | |
$parent_mods = get_option( 'theme_mods_' . get_template() ); | |
foreach ( (array) $parent_mods as $parent_mod => $parent_mod_value ) { | |
set_theme_mod( $parent_mod, $parent_mod_value ); | |
} | |
} | |
add_action( 'init', 'copy_parent_mods' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment