'.esc_html( $value['name'] ).' '; else $menu .= '
  • '.esc_html( $value['name'] ) . '
  • '; } } return $menu; } } /** * Theme-option Tabs Content Fields. */ if( ! function_exists( 'mh_theme_options_tab_page' ) ){ function mh_theme_options_tab_page() { $theme_options = mh_theme_options(); $output = $val = $id = $val_1 = $val_2 = $val_3 = $no_display = $style = ''; $slider_counter = 1; $counter = 0; $options = get_option( 'mh_options' ); foreach ( $theme_options as $value ) { if( isset( $value['id'] ) && $value['type'] != "section" && $value['type'] != "typography" && $value['type'] != "body_typography" && $value['type'] != 'color_2' && $value['type'] != 'map' && $value['type'] != 'margin' ) { $val = isset( $options[ $value['id'] ] ) ? $options[esc_html( sanitize_title( $value['id'] ) )] : ''; $mh_option_name = 'mh_options['.$value['id'].']'; } if( $value['type'] == "typography" || $value['type'] == "body_typography" || $value['type'] == "margin" ) { $val_1 = isset( $options[esc_html( $value['id_1'] )] ) ? $options[esc_html( sanitize_title( $value['id_1'] ) )] : ''; $val_2 = isset( $options[esc_html( $value['id_2'] )] ) ? $options[esc_html( sanitize_title( $value['id_2'] ) )] : ''; $val_3 = isset( $options[esc_html( $value['id_3'] )] ) ? $options[esc_html( sanitize_title( $value['id_3'] ) )] : ''; $val_4 = isset( $options[esc_html( $value['id_4'] )] ) ? $options[esc_html( sanitize_title( $value['id_4'] ) )] : ''; $mh_option_name_1 = 'mh_options['.$value['id_1'].']'; $mh_option_name_2 = 'mh_options['.$value['id_2'].']'; $mh_option_name_3 = 'mh_options['.$value['id_3'].']'; $mh_option_name_4 = 'mh_options['.$value['id_4'].']'; } if( $value['type'] == 'color_2' ) { $val_1 = isset( $options[esc_html( $value['id_1'] )] ) ? $options[esc_html( sanitize_title( $value['id_1'] ) )] : ''; $val_2 = isset( $options[esc_html( $value['id_2'] )] ) ? $options[esc_html( sanitize_title( $value['id_2'] ) )] : ''; $mh_option_name_1 = 'mh_options['.$value['id_1'].']'; $mh_option_name_2 = 'mh_options['.$value['id_2'].']'; } if( $value['type'] == 'map' ) { $val_1 = isset( $options[esc_html( $value['id_1'] )] ) ? $options[esc_html( sanitize_title( $value['id_1'] ) )] : ''; $val_2 = isset( $options[esc_html( $value['id_2'] )] ) ? $options[esc_html( sanitize_title( $value['id_2'] ) )] : ''; $val_3 = isset( $options[esc_html( $value['id_3'] )] ) ? $options[esc_html( sanitize_title( $value['id_3'] ) )] : ''; $mh_option_name_1 = 'mh_options['.$value['id_1'].']'; $mh_option_name_2 = 'mh_options['.$value['id_2'].']'; $mh_option_name_3 = 'mh_options['.$value['id_3'].']'; } $mh_framework_field_name = isset( $value['name'] ) ? esc_html( $value['name'] ) : ''; $mh_framework_description = isset( $value['description'] ) ? esc_html( $value['description'] ) : ''; $mh_framework_class = isset( $value['class'] ) ? mh_is_empty( $value['class'] ) : ''; switch ( $value['type'] ) : case "section" : if ( $value['type'] == "section" ) { if( $counter >=1 ) { $output .= '
    '; } $counter++; if( $counter == 1) $output .= '
    '; else $output .= '
    '; $output .= '
    '; $output .= '
    ' ; $output .= '

    '. $mh_framework_field_name.'

    '.$mh_framework_description.'

    '; $output .= '
    '; $output .= '
    '; } break; case "map" : $output .= '
    '; $output .= '
    '; $output .= '

    '.$mh_framework_field_name.'

    '.$mh_framework_description.'

    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '

    '.esc_html($value['label_3']).'

    '; $output .= ' '; $output .= '
    '; $output .= '
    '; $output .= '

    '.esc_html($value['label_1']).'

    '; $output .= ' '; $output .= '
    '; $output .= '
    '; $output .= '

    '.esc_html($value['label_2']).'

    '; $output .= ' '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; break; case "text" : $output .= '
    '; $output .= '
    '; $output .= '

    '.$mh_framework_field_name.'

    '.$mh_framework_description.'

    '; $output .= '
    '; $output .= '
    '; $output .= ' '; $output .= '
    '; $output .= '
    '; break; case "import_data" : $output .= '
    '; $output .= '
    '; $output .= $value['description']; $output .= '
    '; $output .= '
    '; break; case "textarea" : $output .= '
    '; $output .= '
    '; $output .= '

    '.$mh_framework_field_name.'

    '.$mh_framework_description.'

    '; $output .= '
    '; $output .= '
    '; $output .= ''; $output .= '
    '; $output .= '
    '; break; case "checkbox": $output .= '
    '; $output .= '
    '; $output .= '

    '.$mh_framework_field_name.'

    '.$mh_framework_description.'

    '; $output .= '
    '; $output .= '
    '; foreach ($value['options'] as $key => $option) { $key = preg_replace('/[^a-zA-Z0-9._\-]/', '', strtolower(esc_html($value['name'])) ); if( isset($val) && !empty($val) && checked( esc_attr($val) == $options[ $value['id'] ], true, false ) ){ $output .= ''; $no_display .=''; } else { $output .= ''; $no_display .=''; } } $output .= '
    '; $output .= '
    '; break; case "select" : $output .= '
    '; $output .= '
    '; $output .= '

    '.$mh_framework_field_name.'

    '.$mh_framework_description.'

    '; $output .= '
    '; $output .= '
    '; $output .= ''; $output .= '
    '; $output .= '
    '; break; case "multiselect" : $output .= '
    '; $output .= '
    '; $output .= '

    '.$mh_framework_field_name.'

    '.$mh_framework_description.'

    '; $output .= '
    '; $output .= '
    '; $output .= ''; $output .= '
    '; $output .= '
    '; break; case "radio" : $output .= '
    '; $output .= '
    '; $output .= '

    '.$mh_framework_field_name.'

    '.$mh_framework_description.'

    '; $output .= '
    '; $output .= '
    '; $name = '['. $value['id'] .']'; $for_call = $value['id']; $output .= '
    '; foreach ($value['options'] as $key => $option) { $key_call=$key.'-'.$for_call; if( $val == $key ) { $output .= '
    '; } else { $output .= '
    '; } } $output .= '
    '; $output .= '
    '; $output .= '
    '; break; case "image" : $output .= '
    '; $output .= '
    '; $output .= '

    '.$mh_framework_field_name.'

    '.$mh_framework_description.'

    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; if( esc_url( $val ) != '' ) { $output .= ''; $output .= '
    '; $output .= ' '; }else { $output .= ''; $output .= '
    '; $output .= ' '; } $output .= '
    '; break; case "color" : $output .= '
    '; $output .= '
    '; $output .= '

    '.$mh_framework_field_name.'

    '.$mh_framework_description.'

    '; $output .= '
    '; $output .= '
    '; $output .= ' '; $output .= '
    '; $output .= '
    '; break; case "color_2" : $output .= '
    '; $output .= '
    '; $output .= '

    '.$mh_framework_field_name.'

    '.$mh_framework_description.'

    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '

    '.esc_html($value['label_1']).'

    '; $output .= ' '; $output .= '
    '; $output .= '
    '; $output .= '

    '.esc_html($value['label_2']).'

    '; $output .= ' '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; break; case "editor" : $output .= '
    '; $output .= '
    '; $output .= '

    '.$mh_framework_field_name.'

    '.$mh_framework_description.'

    '; $output .= '
    '; $output .= '
    '; echo $output; $textarea_name = $mh_option_name; $default_editor_settings = array( 'textarea_name' => $textarea_name, 'media_buttons' => false, 'quicktags' => false, 'textarea_rows' => 5, 'tinymce' => array( 'plugins' => 'wordpress' ) ); $editor_settings = array(); if ( isset( $value['settings'] ) ) { $editor_settings = $value['settings']; } $editor_settings = array_merge( $default_editor_settings, $editor_settings ); wp_editor( $val , $value['id'] , $editor_settings ); $output = ''; $output .= '
    '; $output .= '
    '; break; case "typography" : $output .= '
    '; $output .= '
    '; $output .= '

    '.$mh_framework_field_name.'

    '.$mh_framework_description.'

    '; $output .= '
    '; $output .= '
    '; /* row start */ $output .= '
    '; $output .= '
    '; $output .= '

    '.$value['label_1'].'

    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '

    '.esc_html($value['label_2']).'

    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '

    '.$value['label_3'].'

    '; $output .= ''; $output .= '
    '; $output .= '

    '; /* row started */ $output .= '
    '; $output .= '
    '; $output .= '

    '.esc_html($value['label_4']).'

    '; $output .= ' '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; break; case "spinner" : $output .= '
    '; $output .= '
    '; $output .= '

    '.$mh_framework_field_name.'

    '.$mh_framework_description.'

    '; $output .= '
    '; $output .= '
    '; $output .= ' '; $output .= '
    '; $output .= '
    '; break; case "date-picker" : $output .= '
    '; $output .= '
    '; $output .= '

    '.$mh_framework_field_name.'

    '.$mh_framework_description.'

    '; $output .= '
    '; $output .= '
    '; $output .= ' '; $output .= '
    '; $output .= '
    '; break; case "range-validator" : $output .= '
    '; $output .= '
    '; $output .= '

    '.$mh_framework_field_name.'

    '.$mh_framework_description.'

    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; if( empty($value['class']) ){ $value['class'] = "range_slider_class_".$slider_counter; } $output .= '
    '; $output .= ''; $output .= '
    '; $output .= '
    '; $output .= '
    '; $slider_counter++; break; case "margin" : $output .= '
    '; $output .= '
    '; $output .= '

    '.$mh_framework_field_name.'

    '.$mh_framework_description.'

    '; $output .= '
    '; $output .= '
    '; /* row start */ $output .= '
    '; $output .= '
    '; $output .= '

    '.$value['label_1'].'

    '; $output .= '
    '; $output .= ' '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '

    '.$value['label_2'].'

    '; $output .= '
    '; $output .= ' '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '

    '.$value['label_3'].'

    '; $output .= '
    '; $output .= ' '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '

    '.$value['label_4'].'

    '; $output .= '
    '; $output .= ' '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; break; case "body_typography" : $output .= '
    '; $output .= '
    '; $output .= '

    '.$mh_framework_field_name.'

    '.$mh_framework_description.'

    '; $output .= '
    '; $output .= '
    '; /* row start */ $output .= '
    '; $output .= '
    '; $output .= '

    '.$value['label_1'].'

    '; $output .= ''; $output .= '
    '; $output .= '
    '; $output .= '

    '.$value['label_2'].'

    '; $output .= ''; $output .= '
    '; $output .= '

    '; $output .= '
    '; $output .= '
    '; $output .= '

    '.$value['label_3'].'

    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '

    '.esc_html($value['label_4']).'

    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; break; default : break; endswitch; } // foreach return $output; } } ?>