Skip to content

Instantly share code, notes, and snippets.

@proframework
Last active August 29, 2015 14:01
Show Gist options
  • Save proframework/2100e308050c3aa00a94 to your computer and use it in GitHub Desktop.
Save proframework/2100e308050c3aa00a94 to your computer and use it in GitHub Desktop.
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['gen'] == 'installchild') {
?>
<div class="updated below-h2">
<p>
<?php _e('Child theme successfully installed.','generate'); ?>
</p>
</div>
<?php
$new_defaults = array(
'container_width' => '700',
'header_layout_setting' => 'fluid-header',
'nav_layout_setting' => 'fluid-nav',
'nav_position_setting' => 'nav-below-header',
'content_layout_setting' => 'separate-containers',
'layout_setting' => 'left-sidebar'
);
update_option( 'generate_settings', $new_defaults );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment