PATH:
home
/
lab2454c
/
fcxpro.com
/
wp-content
/
plugins
/
webon-core
/
inc
/
fonts
/
dashboard
/
admin
<?php if ( ! function_exists( 'webon_core_add_fonts_options' ) ) { /** * Function that add options for this module */ function webon_core_add_fonts_options() { $qode_framework = qode_framework_get_framework_root(); $page = $qode_framework->add_options_page( array( 'scope' => WEBON_CORE_OPTIONS_NAME, 'type' => 'admin', 'slug' => 'fonts', 'title' => esc_html__( 'Fonts', 'webon-core' ), 'description' => esc_html__( 'Global Fonts Options', 'webon-core' ), 'icon' => 'fa fa-cog' ) ); if ( $page ) { $page->add_field_element( array( 'field_type' => 'yesno', 'name' => 'qodef_enable_google_fonts', 'title' => esc_html__( 'Enable Google Fonts', 'webon-core' ), 'default_value' => 'yes', 'args' => array( 'custom_class' => 'qodef-enable-google-fonts' ) ) ); $google_fonts_section = $page->add_section_element( array( 'name' => 'qodef_google_fonts_section', 'title' => esc_html__( 'Google Fonts Options', 'webon-core' ), 'dependency' => array( 'show' => array( 'qodef_enable_google_fonts' => array( 'values' => 'yes', 'default_value' => '' ) ) ) ) ); $page_repeater = $google_fonts_section->add_repeater_element( array( 'name' => 'qodef_choose_google_fonts', 'title' => esc_html__( 'Google Fonts to Include', 'webon-core' ), 'description' => esc_html__( 'Choose Google Fonts which you want to use on your website', 'webon-core' ), 'button_text' => esc_html__( 'Add New Google Font', 'webon-core' ) ) ); $page_repeater->add_field_element( array( 'field_type' => 'googlefont', 'name' => 'qodef_choose_google_font', 'title' => esc_html__( 'Google Font', 'webon-core' ), 'description' => esc_html__( 'Choose Google Font', 'webon-core' ), 'args' => array( 'include' => 'google-fonts' ) ) ); $google_fonts_section->add_field_element( array( 'field_type' => 'checkbox', 'name' => 'qodef_google_fonts_weight', 'title' => esc_html__( 'Google Fonts Weight', 'webon-core' ), 'description' => esc_html__( 'Choose a default Google Fonts weights for your website. Impact on page load time', 'webon-core' ), 'options' => array( '100' => esc_html__( '100 Thin', 'webon-core' ), '100i' => esc_html__( '100 Thin Italic', 'webon-core' ), '200' => esc_html__( '200 Extra-Light', 'webon-core' ), '200i' => esc_html__( '200 Extra-Light Italic', 'webon-core' ), '300' => esc_html__( '300 Light', 'webon-core' ), '300i' => esc_html__( '300 Light Italic', 'webon-core' ), '400' => esc_html__( '400 Regular', 'webon-core' ), '400i' => esc_html__( '400 Regular Italic', 'webon-core' ), '500' => esc_html__( '500 Medium', 'webon-core' ), '500i' => esc_html__( '500 Medium Italic', 'webon-core' ), '600' => esc_html__( '600 Semi-Bold', 'webon-core' ), '600i' => esc_html__( '600 Semi-Bold Italic', 'webon-core' ), '700' => esc_html__( '700 Bold', 'webon-core' ), '700i' => esc_html__( '700 Bold Italic', 'webon-core' ), '800' => esc_html__( '800 Extra-Bold', 'webon-core' ), '800i' => esc_html__( '800 Extra-Bold Italic', 'webon-core' ), '900' => esc_html__( '900 Ultra-Bold', 'webon-core' ), '900i' => esc_html__( '900 Ultra-Bold Italic', 'webon-core' ) ) ) ); $google_fonts_section->add_field_element( array( 'field_type' => 'checkbox', 'name' => 'qodef_google_fonts_subset', 'title' => esc_html__( 'Google Fonts Style', 'webon-core' ), 'description' => esc_html__( 'Choose a default Google Fonts style for your website. Impact on page load time', 'webon-core' ), 'options' => array( 'latin' => esc_html__( 'Latin', 'webon-core' ), 'latin-ext' => esc_html__( 'Latin Extended', 'webon-core' ), 'cyrillic' => esc_html__( 'Cyrillic', 'webon-core' ), 'cyrillic-ext' => esc_html__( 'Cyrillic Extended', 'webon-core' ), 'greek' => esc_html__( 'Greek', 'webon-core' ), 'greek-ext' => esc_html__( 'Greek Extended', 'webon-core' ), 'vietnamese' => esc_html__( 'Vietnamese', 'webon-core' ) ) ) ); $page_repeater = $page->add_repeater_element( array( 'name' => 'qodef_custom_fonts', 'title' => esc_html__( 'Custom Fonts', 'webon-core' ), 'description' => esc_html__( 'Add custom fonts', 'webon-core' ), 'button_text' => esc_html__( 'Add New Custom Font', 'webon-core' ) ) ); $page_repeater->add_field_element( array( 'field_type' => 'file', 'name' => 'qodef_custom_font_ttf', 'title' => esc_html__( 'Custom Font TTF', 'webon-core' ), 'args' => array( 'allowed_type' => 'application/octet-stream' ) ) ); $page_repeater->add_field_element( array( 'field_type' => 'file', 'name' => 'qodef_custom_font_otf', 'title' => esc_html__( 'Custom Font OTF', 'webon-core' ), 'args' => array( 'allowed_type' => 'application/octet-stream' ) ) ); $page_repeater->add_field_element( array( 'field_type' => 'file', 'name' => 'qodef_custom_font_woff', 'title' => esc_html__( 'Custom Font WOFF', 'webon-core' ), 'args' => array( 'allowed_type' => 'application/octet-stream' ) ) ); $page_repeater->add_field_element( array( 'field_type' => 'file', 'name' => 'qodef_custom_font_woff2', 'title' => esc_html__( 'Custom Font WOFF2', 'webon-core' ), 'args' => array( 'allowed_type' => 'application/octet-stream' ) ) ); $page_repeater->add_field_element( array( 'field_type' => 'text', 'name' => 'qodef_custom_font_name', 'title' => esc_html__( 'Custom Font Name', 'webon-core' ), ) ); // Hook to include additional options after module options do_action( 'webon_core_action_after_page_fonts_options_map', $page ); } } add_action( 'webon_core_action_default_options_init', 'webon_core_add_fonts_options', webon_core_get_admin_options_map_position( 'fonts' ) ); }
[+]
..
[-] fonts-options.php
[edit]