/** * Build the Combined & Minified stylesheet file. * * @since 1.0.1 */ function genesis_extender_build_minified_styles() { if (genesis_extender_get_settings('include_column_class_styles')) { $default_stylesheet = 'default-with-columns.css'; } else { $default_stylesheet = 'default.css'; } $css_prefix = '/* ' . __('Combined & Minified CSS', 'extender') . "\n" . '------------------------------------------------------------ */' . "\n"; $css = file_get_contents(GENEXT_PATH . 'lib/css/' . $default_stylesheet); $css .= genesis_extender_get_custom_css('custom_css'); $css = $css_prefix . genesis_extender_minify_css($css); return $css; }
/** * Hook all Custom Hook Boxes that are set to be hooked into a Hook Location. * * @since 1.0 */ function genesis_extender_build_hook_boxes() { $genesis_extender_conditionals = get_option('genesis_extender_custom_conditionals'); $genesis_extender_hooks = get_option('genesis_extender_custom_hook_boxes'); $genesis_extender_hook_boxes = '<?php' . "\n" . '/**' . "\n" . ' * Build and Hook-In Custom Hook Boxes.' . "\n" . ' */' . "\n"; $single_quote = "'"; if (!empty($genesis_extender_hooks)) { foreach ($genesis_extender_hooks as $genesis_extender_hook => $hook_bits) { $genesis_extender_conditional_tags = ''; $genesis_extender_hook_conditional = explode('|', $hook_bits['conditionals']); foreach ($genesis_extender_conditionals as $genesis_extender_conditional => $conditional_bits) { if (in_array($conditional_bits['conditional_id'], $genesis_extender_hook_conditional)) { $genesis_extender_conditional_tags .= $conditional_bits['conditional_tag'] . ' || '; } } $genesis_extender_hook_boxes .= ' /* Name: ' . $hook_bits['hook_name'] . ' */ '; if ($hook_bits['status'] == 'sht' || $hook_bits['status'] == 'bth') { $genesis_extender_hook_boxes .= ' add_shortcode( ' . $single_quote . $hook_bits['hook_name'] . $single_quote . ', ' . $single_quote . 'genesis_extender_' . $hook_bits['hook_name'] . '_hook_box_shortcode' . $single_quote . ' ); function genesis_extender_' . $hook_bits['hook_name'] . '_hook_box_shortcode() {'; $genesis_extender_hook_boxes .= ' ob_start(); genesis_extender_' . $hook_bits['hook_name'] . '_hook_box_content(); $output_string = ob_get_contents(); ob_end_clean(); return $output_string; } '; } if ($hook_bits['status'] == 'hkd' || $hook_bits['status'] == 'bth') { $genesis_extender_hook_boxes .= ' add_action( ' . $single_quote . $hook_bits['hook_location'] . $single_quote . ', ' . $single_quote . 'genesis_extender_' . $hook_bits['hook_name'] . '_hook_box' . $single_quote . ', ' . $hook_bits['priority'] . ' ); function genesis_extender_' . $hook_bits['hook_name'] . '_hook_box() {'; $genesis_extender_hook_boxes .= ' genesis_extender_' . $hook_bits['hook_name'] . '_hook_box_content(); } '; } if ($hook_bits['status'] == 'css') { $genesis_extender_hook_boxes .= ' add_action( ' . $single_quote . 'wp_head' . $single_quote . ', ' . $single_quote . 'genesis_extender_' . $hook_bits['hook_name'] . '_hook_box' . $single_quote . ', ' . $hook_bits['priority'] . ' ); function genesis_extender_' . $hook_bits['hook_name'] . '_hook_box() {'; $genesis_extender_hook_boxes .= ' genesis_extender_' . $hook_bits['hook_name'] . '_hook_box_content(); } '; } $genesis_extender_hook_boxes .= ' function genesis_extender_' . $hook_bits['hook_name'] . '_hook_box_content() {'; if (!empty($hook_bits['conditionals'])) { $genesis_extender_hook_boxes .= ' if ( ' . substr($genesis_extender_conditional_tags, 0, -4) . ' ) { ?> '; } else { $genesis_extender_hook_boxes .= ' ?> '; } if ($hook_bits['status'] == 'css') { $genesis_extender_hook_boxes .= '<!-- "' . $hook_bits['hook_name'] . '" hook box styles --><style type="text/css">' . genesis_extender_minify_css($hook_bits['hook_textarea']) . '</style><!-- end "' . $hook_bits['hook_name'] . '" hook box styles -->'; } else { $genesis_extender_hook_boxes .= $hook_bits['hook_textarea']; } if (!empty($hook_bits['conditionals'])) { $genesis_extender_hook_boxes .= ' <?php } else { return false; }'; } else { $genesis_extender_hook_boxes .= ' <?php'; } $genesis_extender_hook_boxes .= ' } '; } } return $genesis_extender_hook_boxes; }