add_action('admin_menu', 'tmm_theme_add_admin'); add_action('admin_enqueue_scripts', 'tmm_theme_admin_head'); add_action('admin_bar_menu', 'tmm_theme_admin_bar_menu', 89); //***** global $pagenow; if (is_admin() and 'themes.php' == $pagenow and isset($_GET['activated'])) { //***** set default options $theme_was_activated = TMM::get_option('theme_was_activated'); if (!$theme_was_activated) { //***** $menu_id = wp_update_nav_menu_object(0, array('menu-name' => 'Primary Menu')); $theme_mods = get_option('theme_mods_' . 'almera'); $theme_mods['nav_menu_locations']['primary'] = $menu_id; update_option('theme_mods_' . 'almera', $theme_mods); if (class_exists('TMM_Ext_Shortcodes')) { $shortcodes = TMM_Ext_Shortcodes::get_shortcodes_array(); if (!empty($shortcodes)) { foreach ($shortcodes as $shortcode) { TMM::update_option('show_shortcode_' . $shortcode, 1); } } } TMM::update_option('theme_was_activated', 1); //***** TMM::update_option('saved_google_fonts', 'a:1:{i:0;s:83:"Open Sans:300,300italic,400regular,italic,600,600italic,700,700italic,800,800italic";}'); TMM::update_option('sidebar_position', 'sbr'); TMM::update_option('copyright_text', 'Copyright © 2013. <a target="_blank" href="http://webtemplatemasters.com">ThemeMakers</a>. All rights reserved'); } } //******************** add_action('admin_notices', 'tmm_print_admin_notice');