/** * Register widgetized areas * * To override graphene_widgets_init() in a child theme, remove the action hook and add your own * function tied to the init hook. * * @since Graphene 1.0 * @uses register_sidebar */ function graphene_widgets_init() { if (function_exists('register_sidebar')) { global $graphene_settings; register_sidebar(array('name' => __('Sidebar Widget Area', 'graphene'), 'id' => 'sidebar-widget-area', 'description' => __('The first sidebar widget area (will always be displayed on the right hand side).', 'graphene'), 'before_widget' => '<div id="%1$s" class="sidebar-wrap clearfix %2$s">', 'after_widget' => '</div>', 'before_title' => "<h3>", 'after_title' => "</h3>")); register_sidebar(array('name' => __('Sidebar Two Widget Area', 'graphene'), 'id' => 'sidebar-two-widget-area', 'description' => __('The second sidebar widget area (will always be displayed on the left hand side).', 'graphene'), 'before_widget' => '<div id="%1$s" class="sidebar-wrap clearfix %2$s">', 'after_widget' => '</div>', 'before_title' => "<h3>", 'after_title' => "</h3>")); register_sidebar(array('name' => __('Footer Widget Area', 'graphene'), 'id' => 'footer-widget-area', 'description' => __("The footer widget area. Leave empty to disable. Set the number of columns to display at the theme's Display Options page.", 'graphene'), 'before_widget' => '<div id="%1$s" class="sidebar-wrap clearfix %2$s">', 'after_widget' => '</div>', 'before_title' => "<h3>", 'after_title' => "</h3>")); /** * Register alternate widget areas to be displayed on the front page, if enabled * * @package Graphene * @subpackage Graphene * @since Graphene 1.0.8 */ if ($graphene_settings['alt_home_sidebar']) { register_sidebar(array('name' => __('Front Page Sidebar Widget Area', 'graphene'), 'id' => 'home-sidebar-widget-area', 'description' => __('The first sidebar widget area that will only be displayed on the front page.', 'graphene'), 'before_widget' => '<div id="%1$s" class="sidebar-wrap clearfix %2$s">', 'after_widget' => '</div>', 'before_title' => "<h3>", 'after_title' => "</h3>")); register_sidebar(array('name' => __('Front Page Sidebar Two Widget Area', 'graphene'), 'id' => 'home-sidebar-two-widget-area', 'description' => __('The second sidebar widget area that will only be displayed on the front page.', 'graphene'), 'before_widget' => '<div id="%1$s" class="sidebar-wrap clearfix %2$s">', 'after_widget' => '</div>', 'before_title' => "<h3>", 'after_title' => "</h3>")); } if ($graphene_settings['alt_home_footerwidget']) { register_sidebar(array('name' => __('Front Page Footer Widget Area', 'graphene'), 'id' => 'home-footer-widget-area', 'description' => __("The footer widget area that will only be displayed on the front page. Leave empty to disable. Set the number of columns to display at the theme's Display Options page.", 'graphene'), 'before_widget' => '<div id="%1$s" class="sidebar-wrap clearfix %2$s">', 'after_widget' => '</div>', 'before_title' => "<h3>", 'after_title' => "</h3>")); } /* Header widget area */ if ($graphene_settings['enable_header_widget']) { register_sidebar(array('name' => __('Header Widget Area', 'graphene'), 'id' => 'header-widget-area', 'description' => __("The header widget area.", 'graphene'), 'before_widget' => '<div id="%1$s" class="sidebar-wrap clearfix %2$s">', 'after_widget' => '</div>', 'before_title' => "<h3>", 'after_title' => "</h3>")); } /* Action hooks widget areas */ if (count($graphene_settings['widget_hooks']) > 0) { $available_hooks = graphene_get_action_hooks(true); foreach ($graphene_settings['widget_hooks'] as $hook) { if (in_array($hook, $available_hooks)) { register_sidebar(array('name' => ucwords(str_replace('_', ' ', $hook)), 'id' => $hook, 'description' => sprintf(__("Dynamically added widget area. This widget area is attached to the %s action hook.", 'graphene'), "'{$hook}'"), 'before_widget' => '<div id="%1$s" class="sidebar-wrap clearfix %2$s">', 'after_widget' => '</div>', 'before_title' => "<h3>", 'after_title' => "</h3>")); // to display the widget dynamically attach the dynamic method add_action($hook, 'graphene_display_dynamic_widget_hooks'); } } } } do_action('graphene_widgets_init'); }
/** * Settings Validator * * This file defines the function that validates the theme's options * upon submission. */ function graphene_settings_validator($input) { global $graphene_options_validated; if ($graphene_options_validated == true) { return $input; } if (!isset($_POST['graphene_uninstall'])) { global $graphene_defaults, $allowedposttags; // Add <script> tag to the allowed tags in code $allowedposttags = array_merge($allowedposttags, array('script' => array('type' => array(), 'src' => array()))); if (isset($_POST['graphene_general'])) { /* =Slider Options --------------------------------------------------------------------------------------*/ // Slider category if (isset($input['slider_type']) && !in_array($input['slider_type'], array('latest_posts', 'random', 'posts_pages', 'categories'))) { unset($input['slider_type']); add_settings_error('graphene_options', 2, __('ERROR: Invalid category to show in slider.', 'graphene')); } elseif ($input['slider_type'] == 'posts_pages' && empty($input['slider_specific_posts'])) { unset($input['slider_type']); add_settings_error('graphene_options', 2, __('ERROR: You must specify the posts/pages to be displayed when you have "Show specific posts/pages" selected for the slider.', 'graphene')); } elseif ($input['slider_type'] == 'categories' && empty($input['slider_specific_categories'])) { unset($input['slider_type']); add_settings_error('graphene_options', 2, __('ERROR: You must have selected at least one category when you have "Show posts from categories" selected for the slider.', 'graphene')); } // Posts and/or pages to display if (isset($input['slider_type']) && $input['slider_type'] == 'posts_pages' && isset($input['slider_specific_posts'])) { $input['slider_specific_posts'] = str_replace(' ', '', $input['slider_specific_posts']); } // Categories to display posts from if (isset($input['slider_type']) && $input['slider_type'] == 'categories' && isset($input['slider_specific_categories']) && is_array($input['slider_specific_categories'])) { if (in_array(false, array_map('ctype_digit', (array) $input['slider_specific_categories']))) { unset($input['slider_specific_categories']); add_settings_error('graphene_options', 2, __('ERROR: Invalid category selected for the slider categories.', 'graphene')); } } // Exclude categories from posts listing $input = graphene_validate_dropdown($input, 'slider_exclude_categories', array('disabled', 'homepage', 'everywhere'), __('ERROR: Invalid option for the slider categories exclusion from posts listing is specified.', 'graphene')); // Display posts from categories in random order $input['slider_random_category_posts'] = isset($input['slider_random_category_posts']) ? true : false; // Number of posts to display if (!empty($input['slider_postcount']) && !ctype_digit($input['slider_postcount'])) { unset($input['slider_postcount']); add_settings_error('graphene_options', 2, __('ERROR: The number of posts to displayed in the slider must be a an integer value.', 'graphene')); } // Slider image $input = graphene_validate_dropdown($input, 'slider_img', array('disabled', 'featured_image', 'post_image', 'custom_url'), __('ERROR: Invalid option for the slider image is specified.', 'graphene')); // Custom slider image URL $input = graphene_validate_url($input, 'slider_imgurl', __('ERROR: Bad URL entered for the custom slider image URL.', 'graphene')); // Slider display style $input = graphene_validate_dropdown($input, 'slider_display_style', array('thumbnail-excerpt', 'bgimage-excerpt', 'full-post'), __('ERROR: Invalid option for the slider display style is specified.', 'graphene')); // Slider height $input = graphene_validate_digits($input, 'slider_height', __('ERROR: The value for slider height must be an integer.', 'graphene')); // Slider speed $input = graphene_validate_digits($input, 'slider_speed', __('ERROR: The value for slider speed must be an integer.', 'graphene')); // Slider transition speed $input = graphene_validate_digits($input, 'slider_trans_speed', __('ERROR: The value for slider transition speed must be an integer.', 'graphene')); // Slider animation $input = graphene_validate_dropdown($input, 'slider_animation', array('horizontal-slide', 'vertical-slide', 'fade', 'none'), __('ERROR: Invalid slider animation.', 'graphene')); // Slider position $input['slider_position'] = isset($input['slider_position']) ? true : false; // Slider disable switch $input['slider_disable'] = isset($input['slider_disable']) ? true : false; // Slider full width $input['slider_full_width'] = isset($input['slider_full_width']) ? true : false; /* =Infinite Scroll Options --------------------------------------------------------------------------------------*/ $input['inf_scroll_enable'] = isset($input['inf_scroll_enable']) ? true : false; $input['inf_scroll_click'] = isset($input['inf_scroll_click']) ? true : false; $input['inf_scroll_comments'] = isset($input['inf_scroll_comments']) ? true : false; /* =Front Page Options --------------------------------------------------------------------------------------*/ if (!empty($input['frontpage_posts_cats'])) { if (in_array(false, array_map('ctype_digit', (array) $input['frontpage_posts_cats']))) { unset($input['frontpage_posts_cats']); add_settings_error('graphene_options', 2, __('ERROR: Invalid category selected for the front page posts categories.', 'graphene')); } } else { $input['frontpage_posts_cats'] = $graphene_defaults['frontpage_posts_cats']; } /* =Homepage Panes --------------------------------------------------------------------------------------*/ // Type of content to show $input = graphene_validate_dropdown($input, 'show_post_type', array('latest-posts', 'cat-latest-posts', 'posts'), __('ERROR: Invalid option for the type of content to show in homepage panes.', 'graphene')); // Number of latest posts to display $input = graphene_validate_digits($input, 'homepage_panes_count', __('ERROR: The value for the number of latest posts to display in homepage panes must be an integer.', 'graphene')); if (isset($input['show_post_type'])) { // Categories to show latest posts from if ($input['show_post_type'] == 'cat-latest-posts' && isset($input['homepage_panes_cat']) && is_array($input['homepage_panes_cat'])) { if (in_array(false, array_map('ctype_digit', (array) $input['homepage_panes_cat']))) { unset($input['slider_specific_categories']); add_settings_error('graphene_options', 2, __('ERROR: Invalid category selected for the latest posts to show from in the homepage panes.', 'graphene')); } } // Posts and/or pages to display if ($input['show_post_type'] == 'posts' && isset($input['homepage_panes_posts'])) { $input['homepage_panes_posts'] = str_replace(' ', '', $input['homepage_panes_posts']); } } // Disable switch $input['disable_homepage_panes'] = isset($input['disable_homepage_panes']) ? true : false; /* =Comments Options --------------------------------------------------------------------------------------*/ $input = graphene_validate_dropdown($input, 'comments_setting', array('wordpress', 'disabled_pages', 'disabled_completely'), __('ERROR: Invalid option for the comments option.', 'graphene')); /* =Child Page Options --------------------------------------------------------------------------------------*/ // Hide parent box if content is empty $input['hide_parent_content_if_empty'] = isset($input['hide_parent_content_if_empty']) ? true : false; // Child page listing $input = graphene_validate_dropdown($input, 'child_page_listing', array('hide', 'show_always', 'show_if_parent_empty'), __('ERROR: Invalid option for the child page listings.', 'graphene')); /* = RSS Feed Options --------------------------------------------------------------------------------------*/ // Use a custom RSS feed $input['use_custom_rss_feed'] = isset($input['use_custom_rss_feed']) ? true : false; // Child page listing if ($input['use_custom_rss_feed'] && empty($input['custom_rss_feed_url'])) { unset($input['slider_type']); add_settings_error('graphene_options', 2, __('ERROR: You must supply an URL for the custom RSS Feed.', 'graphene')); } else { $input = graphene_validate_url($input, 'custom_rss_feed_url', __('ERROR: Bad URL entered for the custom RSS Feed URL.', 'graphene')); } /* =Widget Area Options --------------------------------------------------------------------------------------*/ $input['enable_header_widget'] = isset($input['enable_header_widget']) ? true : false; $input['alt_home_sidebar'] = isset($input['alt_home_sidebar']) ? true : false; $input['alt_home_footerwidget'] = isset($input['alt_home_footerwidget']) ? true : false; /* =Top Bar Options --------------------------------------------------------------------------------------*/ // Hide top bar $input['hide_top_bar'] = isset($input['hide_top_bar']) ? true : false; // Open in new window $input['social_media_new_window'] = isset($input['social_media_new_window']) ? true : false; /* Social profiles */ $social_profiles = !empty($input['social_profiles']) ? $input['social_profiles'] : array(); if (!empty($social_profiles)) { $ix = 0; unset($input['social_profiles']); foreach ($social_profiles as $social_icon) { if (!empty($social_icon['type'])) { $input['social_profiles'][$ix]['type'] = $social_icon['type']; $input['social_profiles'][$ix]['name'] = $social_icon['name']; $input['social_profiles'][$ix]['title'] = esc_attr($social_icon['title']); $social_icon['url'] = esc_url_raw($social_icon['url']); if (empty($social_icon['url']) && $social_icon['type'] != 'rss') { add_settings_error('graphene_options', 2, sprintf(__('ERROR: Bad URL entered for the %s URL.', 'graphene'), $social_icon['name'])); } else { $input['social_profiles'][$ix]['url'] = $social_icon['url']; } if ($social_icon['type'] == 'custom') { $input['social_profiles'][$ix]['icon_url'] = $social_icon['icon_url']; } $ix++; } } } else { $input['social_profiles'] = array(0 => false); } /* =Social Sharing Options --------------------------------------------------------------------------------------*/ // Show social sharing button switch $input['show_addthis'] = isset($input['show_addthis']) ? true : false; // Show buttons in pages switch $input['show_addthis_page'] = isset($input['show_addthis_page']) ? true : false; // Show buttons in home and archive pages $input['show_addthis_archive'] = isset($input['show_addthis_archive']) ? true : false; // Social sharing buttons location $input = graphene_validate_dropdown($input, 'addthis_location', array('post-bottom', 'post-top', 'top-bottom'), __('ERROR: Invalid option for the social sharing buttons location.', 'graphene')); // Social sharing buttons code $input['addthis_code'] = trim(stripslashes($input['addthis_code'])); /* =Adsense Options --------------------------------------------------------------------------------------*/ // Show Adsense ads switch $input['show_adsense'] = isset($input['show_adsense']) ? true : false; // Show ads on front page switch $input['adsense_show_frontpage'] = isset($input['adsense_show_frontpage']) ? true : false; // Adsense code $input['adsense_code'] = wp_kses_post($input['adsense_code']); /* =Google Analytics Options --------------------------------------------------------------------------------------*/ // Enable tracking switch $input['show_ga'] = isset($input['show_ga']) ? true : false; // Tracking code $input['ga_code'] = wp_kses_post($input['ga_code']); /* =Footer Options --------------------------------------------------------------------------------------*/ // Show creative common logo switch $input['show_cc'] = isset($input['show_cc']) ? true : false; // Copyright HTML $input['copy_text'] = wp_kses_post($input['copy_text']); // Hide copyright switch $input['hide_copyright'] = isset($input['hide_copyright']) ? true : false; // Hide "Return to top" link switch $input['hide_return_top'] = isset($input['hide_return_top']) ? true : false; /* =Print Options --------------------------------------------------------------------------------------*/ // Enable print CSS switch $input['print_css'] = isset($input['print_css']) ? true : false; // Show print button switch $input['print_button'] = isset($input['print_button']) ? true : false; } // Ends the General options if (isset($_POST['graphene_display'])) { /* =Header Display Options --------------------------------------------------------------------------------------*/ $input['light_header'] = isset($input['light_header']) ? true : false; $input['link_header_img'] = isset($input['link_header_img']) ? true : false; $input['featured_img_header'] = isset($input['featured_img_header']) ? true : false; $input = graphene_validate_digits($input, 'header_img_height', __('ERROR: The value for the header image height must be an integer.', 'graphene')); $input = graphene_validate_dropdown($input, 'search_box_location', array('top_bar', 'nav_bar', 'disabled'), __('ERROR: Invalid option for the Search box location.', 'graphene')); /* =Column Options --------------------------------------------------------------------------------------*/ $input = graphene_validate_dropdown($input, 'column_mode', array('one_column', 'two_col_left', 'two_col_right', 'three_col_left', 'three_col_right', 'three_col_center'), __('ERROR: Invalid option for the column mode.', 'graphene')); $input = graphene_validate_dropdown($input, 'bbp_column_mode', array('one_column', 'two_col_left', 'two_col_right', 'three_col_left', 'three_col_right', 'three_col_center'), __('ERROR: Invalid option for the bbPress column mode.', 'graphene')); /* =Column Width Options --------------------------------------------------------------------------------------*/ foreach ($input['column_width'] as $column_mode => $columns) { foreach ($columns as $column => $width) { $input = graphene_validate_column_width($input, $column_mode, $column, sprintf(__('ERROR: Invalid width for %s. Width value must be positive number without units.', 'graphene'), $column_mode . ' ' . $column)); } } /* =Post Display Options --------------------------------------------------------------------------------------*/ $input['hide_post_author'] = isset($input['hide_post_author']) ? true : false; $input = graphene_validate_dropdown($input, 'post_date_display', array('hidden', 'icon_no_year', 'icon_plus_year', 'text'), __('ERROR: Invalid option for the post date display.', 'graphene')); $input['hide_post_cat'] = isset($input['hide_post_cat']) ? true : false; $input['hide_post_tags'] = isset($input['hide_post_tags']) ? true : false; $input['hide_post_commentcount'] = isset($input['hide_post_commentcount']) ? true : false; $input['show_post_avatar'] = isset($input['show_post_avatar']) ? true : false; $input['show_post_author'] = isset($input['show_post_author']) ? true : false; /* =Excerpts Display Options --------------------------------------------------------------------------------------*/ $input['posts_show_excerpt'] = isset($input['posts_show_excerpt']) ? true : false; $input['archive_full_content'] = isset($input['archive_full_content']) ? true : false; $input['show_excerpt_more'] = isset($input['show_excerpt_more']) ? true : false; /* =Comments Display Options --------------------------------------------------------------------------------------*/ $input['hide_allowedtags'] = isset($input['hide_allowedtags']) ? true : false; /* =Text style options --------------------------------------------------------------------------------------*/ $input['webfont_families'] = trim(str_replace("'", '', strip_tags($input['webfont_families']))); /* =Footer Widget Display Options --------------------------------------------------------------------------------------*/ // Number of columns to display $input = graphene_validate_digits($input, 'footerwidget_column', __('ERROR: The number of columns to be displayed in the footer widget must be a an integer value.', 'graphene')); /* =Navigation Menu Display Options --------------------------------------------------------------------------------------*/ $input = graphene_validate_digits($input, 'navmenu_child_width', __('ERROR: The width of the submenu must be a an integer value.', 'graphene')); $input['navmenu_home_desc'] = wp_kses_post($input['navmenu_home_desc']); $input['disable_menu_desc'] = isset($input['disable_menu_desc']) ? true : false; /* =Miscellaneous Display Options --------------------------------------------------------------------------------------*/ $input['custom_site_title_frontpage'] = strip_tags($input['custom_site_title_frontpage']); $input['custom_site_title_content'] = strip_tags($input['custom_site_title_content']); $input = graphene_validate_url($input, 'favicon_url', __('ERROR: Bad URL entered for the favicon URL.', 'graphene')); $input['disable_editor_style'] = isset($input['disable_editor_style']) ? true : false; /* =Custom CSS Options --------------------------------------------------------------------------------------*/ $input['custom_css'] = strip_tags($input['custom_css']); } // Ends the Display options if (isset($_POST['graphene_colours'])) { /* =Colour Options --------------------------------------------------------------------------------------*/ $input = graphene_validate_colours($input); } // Ends the Colours options if (isset($_POST['graphene_advanced'])) { $input['enable_preview'] = isset($input['enable_preview']) ? true : false; $input['head_tags'] = trim($input['head_tags']); if (isset($input['widget_hooks']) && is_array($input['widget_hooks'])) { if (!(array_intersect($input['widget_hooks'], graphene_get_action_hooks(true)) === $input['widget_hooks'])) { unset($input['widget_hooks']); add_settings_error('graphene_options', 2, __('ERROR: Invalid action hook selected widget action hooks.', 'graphene')); } } else { $input['widget_hooks'] = $graphene_defaults['widget_hooks']; } $input['disable_css_generate'] = isset($input['disable_css_generate']) ? true : false; } // Ends the Advanced options $graphene_options_validated = true; // Merge the new settings with the previous one (if exists) before saving $input = array_merge(get_option('graphene_settings', array()), (array) $input); /* Only save options that have different values than the default values */ foreach ($input as $key => $value) { if ($graphene_defaults[$key] === $value || $value === '') { unset($input[$key]); } } if ($input) { $input = array_merge(array('db_version' => $graphene_defaults['db_version']), $input); } else { delete_option('graphene_settings'); return false; } } // Closes the uninstall conditional return $input; }
function graphene_options_advanced() { global $graphene_settings; ?> <input type="hidden" name="graphene_advanced" value="true" /> <?php /* Custom <head> tags */ ?> <div class="postbox"> <div class="head-wrap"> <div title="Click to toggle" class="handlediv"><br /></div> <?php graphene_docs_link('Custom_Head_Tags'); ?> <h3 class="hndle"><?php esc_html_e('Custom <head> Tags', 'graphene'); ?> </h3> </div> <div class="panel-wrap inside"> <table class="form-table"> <tr> <th scope="row"><label for="head_tags"><?php esc_html_e('Code to insert into the <head> element', 'graphene'); ?> </label></th> <td><textarea name="graphene_settings[head_tags]" id="head_tags" cols="60" rows="7" class="widefat code"><?php echo htmlentities(stripslashes($graphene_settings['head_tags'])); ?> </textarea></td> </tr> </table> <script type="text/javascript"> var customHeadTags = CodeMirror.fromTextArea(document.getElementById("head_tags"), { mode: 'text/html', htmlMode: true, lineNumbers: true, lineWrapping: true, indentUnit: 4, styleActiveLine: true }); </script> <p class="submit clearfix"><input type="submit" class="button" value="<?php _e('Save All Options', 'graphene'); ?> " /></p> </div> </div> <?php /* Action hooks widgets areas */ ?> <div class="postbox"> <div class="head-wrap"> <div title="Click to toggle" class="handlediv"><br /></div> <?php graphene_docs_link('Action_Hooks_Widget_Areas'); ?> <h3 class="hndle"><?php _e('Action Hooks Widget Areas', 'graphene'); ?> </h3> </div> <div class="panel-wrap inside"> <p><?php _e("This option enables you to place virtually any content to every nook and cranny in the theme, by attaching widget areas to the theme's action hooks.", 'graphene'); ?> </p> <p><?php _e("All action hooks available in the Graphene Theme are listed below. Click on the filename to display all the action hooks available in that file. Then, tick the checkbox next to an action hook to make a widget area available for that action hook.", 'graphene'); ?> </p> <p><?php printf(__('To see a visual map showing where each action hook in Graphene is located, visit this page: %s', 'graphene'), '<a href="http://demo.graphene-theme.com/graphene-hooks-map/" target="_blank">' . __('Graphene Action Hooks Map', 'graphene') . '</a>'); ?> </p> <ul class="graphene-action-hooks"> <?php $actionhooks = graphene_get_action_hooks(); foreach ($actionhooks as $actionhook) { $file = $actionhook['file']; ?> <li> <p class="hooks-file"><a href="#" class="toggle-widget-hooks" title="<?php _e('Click to show/hide the action hooks for this file', 'graphene'); ?> "><?php echo $file; ?> </a></p> <ul class="hooks-list"> <li class="widget-hooks<?php if (count(array_intersect($actionhook['hooks'], $graphene_settings['widget_hooks'])) == 0) { echo ' hide'; } ?> "> <?php foreach ($actionhook['hooks'] as $hook) { ?> <input type="checkbox" name="graphene_settings[widget_hooks][]" value="<?php echo $hook; ?> " id="hook_<?php echo $hook; ?> " <?php if (in_array($hook, $graphene_settings['widget_hooks'])) { echo 'checked="checked"'; } ?> /> <label for="hook_<?php echo $hook; ?> "><?php echo $hook; ?> </label><br /> <?php } ?> </li> </ul> </li> <?php } ?> </ul> <p class="submit clearfix"> <a href="themes.php?page=graphene_options&tab=advanced&rescan_hooks=true" class="button"><?php _e('Rescan action hooks', 'graphene'); ?> </a> <input type="submit" class="button" value="<?php _e('Save All Options', 'graphene'); ?> " /> </p> </div> </div> <?php /* Move generated CSS */ ?> <div class="postbox"> <div class="head-wrap nodocs"> <div title="Click to toggle" class="handlediv"><br /></div> <h3 class="hndle"><?php _e('Move generated CSS', 'graphene'); ?> </h3> </div> <div class="panel-wrap inside"> <?php $styles = graphene_custom_style(false, true, true); ?> <p> <?php printf(__("If you're using a child theme, you can move the CSS codes generated by the theme into the child theme's %s file.", 'graphene'), '<code>style.css</code>'); ?> <?php printf(__("The CSS codes are generated from the various customisation options in the theme's options pages, including any codes you have entered in the Custom CSS option.", 'graphene'), '<code>style.css</code>'); ?> </p> <p> <?php printf(__("This will reduce up to %.1f KB on every page load for your site.", 'graphene'), strlen($styles) / 1024); ?> </p> <p> <?php printf(__("You will need to update your child theme's %s file everytime you change any options that rely on CSS to be implemented, such as column widths and colours.", 'graphene'), '<code>style.css</code>'); ?> </p> <table class="form-table"> <tr> <th scope="row"> <label for="disable_css_generate"><?php _e('I have moved the generated CSS', 'graphene'); ?> </label> </th> <td><input type="checkbox" name="graphene_settings[disable_css_generate]" id="disable_css_generate" <?php checked($graphene_settings['disable_css_generate']); ?> value="true" /></td> </tr> <tr> <th scope="row"><?php _e('CSS codes generated by the theme', 'graphene'); ?> </th> <td class="generated-css-wrap"> <a href="#" class="select-all" rel="generated-css"><?php _e('Select all', 'graphene'); ?> </a> <div class="widefat code" id="generated-css"><?php echo $styles; ?> </div> </td> </tr> </table> <p class="submit clearfix"><input type="submit" class="button" value="<?php _e('Save All Options', 'graphene'); ?> " /></p> </div> </div> <?php }