Created
May 23, 2014 00:46
-
-
Save proframework/a37e928462f72d674fd2 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
add_action('admin_notices','themeslug_import_settings'); | |
function themeslug_import_settings() | |
{ | |
global $pagenow; | |
if ( is_admin() && $pagenow == "themes.php" && isset( $_GET['activated'] ) ) { | |
?> | |
<div class="updated below-h2"> | |
<p style="font-size: 18px;"> | |
<?php _e('<strong>You\'re almost done!</strong> To import settings for this theme,');?> <a href="<?php echo admin_url('themes.php');?>?slug=installchild"><?php _e('click here','generate');?></a>. | |
</p> | |
</div> | |
<?php | |
} | |
if ( is_admin() && $pagenow == 'themes.php' && isset( $_GET['slug'] ) ) { | |
if ($_GET['slug'] == 'installchild') { | |
?> | |
<div class="updated below-h2"> | |
<p> | |
<?php _e('Child theme successfully installed.','generate'); ?> | |
</p> | |
</div> | |
<?php | |
$rawdata = file_get_contents(esc_url( 'http://url-to/settings.dat' )); | |
$import = unserialize($rawdata); | |
foreach ($import as $key => $item) { | |
update_option($key, $item); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment