function wpex_active_skin_class_file() { // Get active skin $active_skin = wpex_active_skin(); // Lets bail if the active skin is the base skin if ('base' == $active_skin || !$active_skin) { return; } // Get currect skin class to load later $skins = wpex_skins(); $active_skin_array = wp_array_slice_assoc($skins, array($active_skin)); if (is_array($active_skin_array)) { $is_core = !empty($active_skin_array[$active_skin]['core']) ? true : false; $class_file = !empty($active_skin_array[$active_skin]['class']) ? $active_skin_array[$active_skin]['class'] : false; } // Return class file if one exists if ($is_core && $class_file) { return $class_file; } }
/** * Settings page output */ function create_admin_page() { ?> <div class="wrap wpex-skins-admin"> <h2><?php _e('Theme Skins', 'wpex'); ?> </h2> <?php // Current skin from site_theme option $option = get_theme_mod('theme_skin', 'base'); // Get fallback from redux if (!$option) { $data = get_option('wpex_options'); $option = isset($data['site_theme']) ? $data['site_theme'] : 'base'; } ?> <form method="post" action="options.php"> <?php settings_fields('wpex_skins_options'); ?> <div class="wpex-skins-select theme-browser" id="theme_skin"> <?php // Get and loop through skins $skins = wpex_skins(); foreach ($skins as $key => $optionue) { $checked = $active = ''; if ('' != $option && $option == $key) { $checked = 'checked'; $active = 'active'; } ?> <div class="wpex-skin <?php echo $active; ?> theme"> <input type="radio" id="wpex-skin-<?php echo $key; ?> " name="theme_skin" value="<?php echo $key; ?> " <?php echo $checked; ?> class="wpex-skin-radio" /> <div class="theme-screenshot"> <img src="<?php echo $optionue['screenshot']; ?> " alt="<?php _e('Screenshot', 'wpex'); ?> " /> </div> <h3 class="theme-name"> <?php if ('active' == $active) { echo '<strong>' . __('Active', 'wpex') . ':</strong> '; } ?> <?php echo $optionue['name']; ?> </h3> </div> <?php } ?> </div> <p style="margin: 0 0 30px;display:none;"> <input type="hidden" name="wpex_set_theme_defaults[skin]" id="wpex-hidden-skin-val" value="<?php echo $option; ?> "> <label> <input type="checkbox" name="wpex_set_theme_defaults[toggle]" style="margin-right:10px;" id="wpex-delete-mods"><?php _e('Delete all theme options and load recommended settings for this skin?', 'wpex'); ?> </label> <label id="wpex-delete-mods-confirm" style="display:none;margin-top:20px;margin-left:20px;"> <input type="checkbox" name="wpex_set_theme_defaults[confirm]"style="margin-right:10px"><?php _e('Please Confirm', 'wpex'); ?> </label> </p> <?php submit_button(); ?> </form> </div> <?php }