typography = "Typography"; global $special_id_for_db; $this->shorttypography = $special_id_for_db."ty"; $value_of_std[0]=get_theme_mod($this->shorttypography."_type_headers_font",'Segoe UI'); $value_of_std[1]=get_theme_mod($this->shorttypography."_type_headers_kern",'0.00em'); $value_of_std[2]=get_theme_mod($this->shorttypography."_type_headers_transform",'none'); $value_of_std[3]=get_theme_mod($this->shorttypography."_type_headers_variant",'normal'); $value_of_std[4]=get_theme_mod($this->shorttypography."_type_headers_weight",'normal'); $value_of_std[5]=get_theme_mod($this->shorttypography."_type_headers_style",'normal'); $value_of_std[6]=get_theme_mod($this->shorttypography."_type_inputs_font",'Segoe UI'); $value_of_std[7]=get_theme_mod($this->shorttypography."_type_inputs_kern",'0.00em'); $value_of_std[8]=get_theme_mod($this->shorttypography."_type_inputs_transform",'none'); $value_of_std[9]=get_theme_mod($this->shorttypography."_type_inputs_variant",'normal'); $value_of_std[10]=get_theme_mod($this->shorttypography."_type_inputs_weight",'normal'); $value_of_std[11]=get_theme_mod($this->shorttypography."_type_inputs_style",'normal'); $value_of_std[12]=get_theme_mod($this->shorttypography."_type_primary_font",'Segoe UI'); $value_of_std[13]=get_theme_mod($this->shorttypography."_type_primary_kern",'0.00em'); $value_of_std[14]=get_theme_mod($this->shorttypography."_type_primary_transform",'none'); $value_of_std[15]=get_theme_mod($this->shorttypography."_type_primary_variant",'normal'); $value_of_std[16]=get_theme_mod($this->shorttypography."_type_primary_weight",'normal'); $value_of_std[17]=get_theme_mod($this->shorttypography."_type_primary_style",'normal'); $value_of_std[18]=get_theme_mod($this->shorttypography."_type_secondary_font",'Segoe UI'); $value_of_std[19]=get_theme_mod($this->shorttypography."_type_secondary_kern",'0.00em'); $value_of_std[20]=get_theme_mod($this->shorttypography."_type_secondary_transform",'none'); $value_of_std[21]=get_theme_mod($this->shorttypography."_type_secondary_variant",'normal'); $value_of_std[22]=get_theme_mod($this->shorttypography."_type_secondary_weight",'normal'); $value_of_std[23]=get_theme_mod($this->shorttypography."_type_secondary_style",'normal'); $this->options_typography = array( array( "name" => "Typography", "type" => "title" ), array( "type" => "open" ), 'type_headers_font'=>array( "name" => "Select Font", "name_customize" => "Header Font", "var_name" =>'type_headers_font', "all_values" => $this->fonts_options(), "id" => $this->shorttypography."_type_headers_font", "type" => "select", "std" => $value_of_std[0] ), 'type_headers_kern'=>array( "name" => "Letter Spacing", "var_name" =>'type_headers_kern', "all_values" => $this->inputs_kern(), "id" => $this->shorttypography."_type_headers_kern", "type" => "", "std" => $value_of_std[1] ), 'type_headers_transform'=>array( "name" => "Text Transform", "var_name" =>'type_headers_transform', "all_values" => $this->text_transform(), "id" => $this->shorttypography."_type_headers_transform", "type" => "", "std" => $value_of_std[2] ), 'type_headers_variant'=>array( "name" => "Variant", "var_name" =>'type_headers_variant', "all_values" => $this->text_variant(), "id" => $this->shorttypography."_type_headers_variant", "type" => "", "std" => $value_of_std[3] ), 'type_headers_weight'=>array( "name" => "Weight", "var_name" =>'type_headers_weight', "all_values" => $this->text_weight(), "id" => $this->shorttypography."_type_headers_weight", "type" => "", "std" => $value_of_std[4] ), 'type_headers_style'=>array( "name" => "Style", "var_name" =>'type_headers_style', "all_values" => $this->text_stylee(), "id" => $this->shorttypography."_type_headers_style", "type" => "", "std" => $value_of_std[5] ), 'type_inputs_font'=>array( "name" => "Select Font", "name_customize" => "Inputs and Text Areas Font", "var_name" =>'type_inputs_font', "all_values" => $this->fonts_options(), "id" => $this->shorttypography."_type_inputs_font", "type" => "", "std" => $value_of_std[6] ), 'type_inputs_kern' => array( "name" => "Letter Spacing", "var_name" =>'type_inputs_kern', "all_values" => $this->inputs_kern(), "id" => $this->shorttypography."_type_inputs_kern", "type" => "", "std" => $value_of_std[7] ), 'type_inputs_transform'=>array( "name" => "Text Transform", "var_name" =>'type_inputs_transform', "all_values" => $this->text_transform(), "id" => $this->shorttypography."_type_inputs_transform", "type" => "", "std" => $value_of_std[8] ), 'type_inputs_variant'=>array( "name" => "Variant", "var_name" =>'type_inputs_variant', "all_values" => $this->text_variant(), "id" => $this->shorttypography."_type_inputs_variant", "type" => "", "std" => $value_of_std[9] ), 'type_inputs_weight'=>array( "name" => "Weight", "var_name" =>'type_inputs_weight', "all_values" => $this->text_weight(), "id" => $this->shorttypography."_type_inputs_weight", "type" => "", "std" => $value_of_std[10] ), 'type_inputs_style'=>array( "name" => "Style", "var_name" =>'type_inputs_style', "all_values" => $this->text_stylee(), "id" => $this->shorttypography."_type_inputs_style", "type" => "", "std" => $value_of_std[11] ), 'type_primary_font'=>array( "name" => "Select Font", "name_customize" => "Primary Font (Body)", "var_name" =>'type_primary_font', "all_values" => $this->fonts_options(), "id" => $this->shorttypography."_type_primary_font", "desc" => "", "type" => "", "std" => $value_of_std[12] ), 'type_primary_kern'=>array( "name" => "Letter Spacing", "var_name" =>'type_primary_kern', "all_values" => $this->inputs_kern(), "id" => $this->shorttypography."_type_primary_kern", "type" => "", "std" => $value_of_std[13] ), 'type_primary_transform'=>array( "name" => "Text Transform", "var_name" =>'type_primary_transform', "all_values" => $this->text_transform(), "id" => $this->shorttypography."_type_primary_transform", "type" => "", "std" => $value_of_std[14] ), 'type_primary_variant'=>array( "name" => "Variant", "var_name" =>'type_primary_variant', "all_values" => $this->text_variant(), "id" => $this->shorttypography."_type_primary_variant", "type" => "", "std" => $value_of_std[15] ), 'type_primary_weight'=>array( "name" => "Weight", "var_name" =>'type_primary_weight', "all_values" => $this->text_weight(), "id" => $this->shorttypography."_type_primary_weight", "type" => "", "std" => $value_of_std[16] ), 'type_primary_style'=>array( "name" => "Style", "var_name" =>'type_primary_style', "all_values" => $this->text_stylee(), "id" => $this->shorttypography."_type_primary_style", "type" => "", "std" => $value_of_std[17] ), 'type_secondary_font'=>array( "name" => "Select Font", "name_customize" => "Secondary Font (Subtitle)", "var_name" =>'type_secondary_font', "all_values" => $this->fonts_options(), "id" => $this->shorttypography."_type_secondary_font", "type" => "", "std" => $value_of_std[18] ), 'type_secondary_kern'=>array( "name" => "Letter Spacing", "var_name" =>'type_secondary_kern', "all_values" => $this->inputs_kern(), "id" => $this->shorttypography."_type_secondary_kern", "type" => "", "std" => $value_of_std[19] ), 'type_secondary_transform'=>array( "name" => "Text Transform", "var_name" =>'type_secondary_transform', "all_values" => $this->text_transform(), "id" => $this->shorttypography."_type_secondary_transform", "type" => "", "std" => $value_of_std[20] ), 'type_secondary_variant'=>array( "name" => "Variant", "var_name" =>'type_secondary_variant', "all_values" => $this->text_variant(), "id" => $this->shorttypography."_type_secondary_variant", "type" => "", "std" => $value_of_std[21] ), 'type_secondary_weight'=>array( "name" => "Weight", "var_name" =>'type_secondary_weight', "all_values" => $this->text_weight(), "id" => $this->shorttypography."_type_secondary_weight", "type" => "", "std" => $value_of_std[22] ), 'type_secondary_style'=>array( "name" => "Style", "var_name" =>'type_secondary_style', "all_values" => $this->text_stylee(), "id" => $this->shorttypography."_type_secondary_style", "type" => "", "std" => $value_of_std[23] ), array( "type" => "close" ) ); } public function web_bussines_typography_customize_preview_js() { wp_enqueue_script( 'web_bussines-customizer', get_template_directory_uri() . '/scripts/theme-customizer.js', array( 'customize-preview' ) ); } public function web_bussines_typography_customize_register( $wp_customize ) { $wp_customize->add_section( 'fonts' , array( 'title' => __( 'Fonts', 'sp_webBusiness' ), 'priority' => 50, ) ); foreach($this->options_typography as $key=>$spec_font) { if(isset($spec_font['name'])){ if($spec_font['name']=='Select Font'){ $wp_customize->add_setting( 'theme_mods_exclusive['.$spec_font['id'].']', array( 'default' => $spec_font['std'], 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'theme_mods_exclusive['.$spec_font['id'].']', array( 'label' => $spec_font['name_customize'], 'section' => 'fonts', 'settings' => 'theme_mods_exclusive['.$spec_font['id'].']', 'type' => 'select', 'choices' => $this->fonts_options() ) ); } } } } /// save changes or reset options public function web_dorado_theme_update_and_get_options_typography(){ if (isset($_GET['page']) && $_GET['page'] == "web_dorado_theme" && isset($_GET['controller']) && $_GET['controller'] == "typography_page") { if (isset($_REQUEST['action']) == 'save' ) { foreach ($this->options_typography as $value) { if (isset($_REQUEST[$value['var_name']])) { set_theme_mod($value['id'], $_REQUEST[$value['var_name']]); } else { remove_theme_mod($value['id']); } } header("Location: themes.php?page=web_dorado_theme&controller=typography_page&saved=true"); die; } else if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'reset') { foreach ($this->options_typography as $value) { remove_theme_mod($value['id']); } header("Location: themes.php?page=web_dorado_theme&controller=typography_page&reset=true"); die; } } } public function web_dorado_typography_page_admin_scripts(){ wp_enqueue_style('typagraphi_page_main_style',get_bloginfo('template_directory').'/admin/css/typography_page.css'); wp_enqueue_script('jquery'); } public function dorado_theme_admin_typography(){ if(isset($_REQUEST['controller']) && $_REQUEST['controller']=='typography_page'){ if (isset($_REQUEST['saved']) && $_REQUEST['saved'] ) echo '
Typography settings saved.
Typography settings reset.