__( 'Arial, Helvetica, sans-serif', 'fruitful' ), 'Arial Black, Gadget, sans-serif' => __( 'Arial Black, Gadget, sans-serif', 'fruitful' ), 'Comic Sans MS, Textile, cursive' => __( 'Comic Sans MS, Textile, cursive', 'fruitful' ), 'Courier New, Courier, monospace' => __( 'Courier New, Courier, monospace', 'fruitful' ), 'Georgia, Times New Roman, Times, serif' => __( 'Georgia, Times New Roman, Times, serif', 'fruitful' ), 'Impact, Charcoal, sans-serif' => __( 'Impact, Charcoal, sans-serif', 'fruitful' ), 'Lucida Console, Monaco, monospace' => __( 'Lucida Console, Monaco, monospace', 'fruitful' ), 'Lucida Sans Unicode, Lucida Grande, sans-serif' => __( 'Lucida Sans Unicode, Lucida Grande, sans-serif', 'fruitful' ), 'Palatino Linotype, Book Antiqua, Palatino, serif' => __( 'Palatino Linotype, Book Antiqua, Palatino, serif', 'fruitful' ), 'Tahoma, Geneva, sans-serif' => __( 'Tahoma, Geneva, sans-serif', 'fruitful' ), 'Times New Roman, Times, serif' => __( 'Times New Roman, Times, serif', 'fruitful' ), 'Trebuchet MS, Helvetica, sans-serif' => __( 'Trebuchet MS, Helvetica, sans-serif', 'fruitful' ), 'Verdana, Geneva, sans-serif' => __( 'Verdana, Geneva, sans-serif', 'fruitful' ), 'MS Sans Serif, Geneva, sans-serif' => __( 'MS Sans Serif, Geneva, sans-serif', 'fruitful' ), 'MS Serif, New York, serif' => __( 'MS Serif, New York, serif', 'fruitful' ), /*Google fonts*/ 'Open Sans, sans-serif' => __( 'Open Sans, sans-serif', 'fruitful' ), 'Lobster, cursive' => __( 'Lobster, cursive', 'fruitful' ), 'Josefin Slab, serif' => __( 'Josefin Slab, serif', 'fruitful' ), 'Arvo, serif' => __( 'Arvo, serif', 'fruitful' ), 'Lato, sans-serif' => __( 'Lato, sans-serif', 'fruitful' ), 'Vollkorn, serif' => __( 'Vollkorn, serif', 'fruitful' ), 'Abril Fatface, cursive' => __( 'Abril Fatface, cursive', 'fruitful' ), 'Ubuntu, sans-serif' => __( 'Ubuntu, sans-serif', 'fruitful' ), 'PT Sans, sans-serif' => __( 'PT Sans, sans-serif', 'fruitful' ), 'Old Standard TT, serif' => __( 'Old Standard TT, serif', 'fruitful' ), 'Droid Sans, sans-serif' => __( 'Droid Sans, sans-serif', 'fruitful' ), ); return apply_filters( 'fruitful_fonts_list', $font_family_options ); } function fruitful_custom_do_settings_sections($page) { global $wp_settings_sections, $wp_settings_fields; $id_=0; $optins = (array) get_option( 'fruitful_theme_options' ); if ( !isset($wp_settings_sections) || !isset($wp_settings_sections[$page]) ) return; foreach( (array) $wp_settings_sections[$page] as $section ) { call_user_func($section['callback'], $section); if ( !isset($wp_settings_fields) || !isset($wp_settings_fields[$page]) || !isset($wp_settings_fields[$page][$section['id']]) ) continue; $name_id = "settings-section-" . $id_; print '
'; fruitful_custom_do_settings_fields($page, $section['id']); print '
'; $id_++; } } function fruitful_custom_do_settings_fields($page, $section) { global $wp_settings_fields; $id_=0; if ( !isset($wp_settings_fields) || !isset($wp_settings_fields[$page]) || !isset($wp_settings_fields[$page][$section]) ) return; foreach ( (array) $wp_settings_fields[$page][$section] as $field ) { if (!empty($field['args']['newrow'])) { print '
'; } else { print '
'; } if ( !empty($field['args']['label_for']) ) print '

' . esc_attr($field['title']); else print '

' . esc_attr($field['title']); print '

'; print ''. $field['args']['info'] .''; if (!empty($field['args']['fields'])) { $id = (isset($field['args']['id'])) ? $field['args']['id'] : ''; if($id == 'slider-options' ) { print '
'; print ''; print '
'; print '
'; print '
'; print '

'.__('No Slider Select!', 'fruitful' ).'

'; print '
'; print '
'; foreach($field['args']['fields'] as $row => $value){ print '
'; call_user_func($field['callback'], $field['args']['fields'][$row]); print '
'; } print '
'; print '
'; } else { print '
'; foreach($field['args']['fields'] as $row => $value){ print '
'; call_user_func($field['callback'], $field['args']['fields'][$row]); print '
'; } print '
'; } } else { print '
'; print '
'; call_user_func($field['callback'], $field['args']); print '
'; } print '
'; $id_++; } } add_action('wp_ajax_fruitful_add_new_slide_action', 'fruitful_new_slide'); function fruitful_new_slide() { $slides = (array) get_option( 'fruitful_theme_slides_options' ); $data = $_POST['data']; echo fruitful_get_slide($data, -1, ''); die(); } function fruitful_get_box_upload_slide($attach_id, $link_url, $is_blank, $ind, $btnclassup = 'upload_btn', $btnclassr = 'reset_btn') { $out = ''; $out .= '
'; if ($attach_id != -1) { $out .= '
'; $image_attributes = wp_get_attachment_image_src($attach_id, 'full'); $out .= ''; $out .= '
'; } /*Link out for Slider*/ $out .= ''; $out .= ''; $out .= '
'; $out .= ''; $out .= ''; $out .= '
'; $out .= ''.__('Upload Image', 'fruitful') .''; $out .= ''.__('Remove', 'fruitful') .''; $out .= '
'; $out .= '
'; return $out; } function fruitful_get_slide($ind, $id, $link_url = null, $is_blank = 'off') { $out = ''; $out .= '
  • '; $out .= '

    ' . sprintf(__('Slide # %1$d', 'fruitful'), $ind); $out .= ''; $out .= ''; $out .= '

    '; $out .= '
    '; $out .= fruitful_get_box_upload_slide($id, $link_url, $is_blank, $ind); $out .= '
    '; $out .= '
  • '; return $out; } function fruitful_slider_images() { global $fruitful_theme_options; $slides = get_option($fruitful_theme_options->args['opt_name']); $vcount_slides = 0; if(!empty($slides['slides'])) { $vcount_slides = count($slides['slides']); } ?>
    args['opt_name']]; foreach ( $fruitful_theme_options->sections as $section => $data_f ) { foreach ( $data_f['fields'] as $field ) { $id = (isset($field['id' ])) ? $field['id'] : ''; $type = (isset($field['type'])) ? $field['type'] : ''; if ($type == 'checkbox') { if (!isset($data[$id])) {$data[$id] = 'off'; } } if ($type == 'textarea') { if (isset($data[$id])) {$data[$id] = stripslashes($data[$id]);} } if (!empty ($field['fields'])) { foreach ($field['fields'] as $sub_field) { $id = (isset($sub_field['id' ])) ? $sub_field['id'] : ''; $type = (isset($sub_field['type'])) ? $sub_field['type'] : ''; if ($type == 'checkbox') { if (!isset($data[$id])) {$data[$id] = 'off'; } } if ($type == 'textarea') { if (isset($data[$id])) {$data[$id] = stripslashes($data[$id]);} } } } } } if (!isset($data['reset'])) {$data['reset'] = 'reset';} if(!empty($data)) { if(update_option('fruitful_theme_options', $data)) { die('1'); } else { die('0'); } } else { die('1'); } } function fruitful_get_default_array() { global $fruitful_theme_options; $output = array(); foreach ( $fruitful_theme_options->sections as $section => $data_f ) { foreach ( $data_f['fields'] as $field ) { $id = (isset($field['id' ])) ? $field['id'] : ''; $default = (isset($field['default' ])) ? $field['default'] : ''; $output[$id] = $default; if (!empty ($field['fields'])) { foreach ($field['fields'] as $sub_field) { $id = (isset($sub_field['id' ])) ? $sub_field['id'] : ''; $default = (isset($sub_field['default' ])) ? $sub_field['default'] : ''; $output[$id] = $default; } } } } return apply_filters( 'themeslug_option_defaults', $output ); } function fruitful_get_theme_options() { global $fruitful_theme_options; return wp_parse_args( get_option($fruitful_theme_options->args['opt_name'], array() ), fruitful_get_default_array() ); } add_action('wp_ajax_fruitful_reset_btn', 'fruitful_reset_action'); function fruitful_reset_action() { global $fruitful_theme_options; delete_option($fruitful_theme_options->args['opt_name']); die(); } function fruitful_theme_sanitize_checkbox( $input ) { if ( $input == 1 ) {return 'on';} else {return 'off';} } ?>