?AlkantarClanX12
| Current Path : /home/rankinh/villavanille/wp-content/plugins/drew-core/inc/fonts/dashboard/admin/ |
| Current File : /home/rankinh/villavanille/wp-content/plugins/drew-core/inc/fonts/dashboard/admin/fonts-options.php |
<?php
if ( ! function_exists( 'drew_core_add_fonts_options' ) ) {
/**
* Function that add options for this module
*/
function drew_core_add_fonts_options() {
$qode_framework = qode_framework_get_framework_root();
$page = $qode_framework->add_options_page(
array(
'scope' => DREW_CORE_OPTIONS_NAME,
'type' => 'admin',
'slug' => 'fonts',
'title' => esc_html__( 'Fonts', 'drew-core' ),
'description' => esc_html__( 'Global Fonts Options', 'drew-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', 'drew-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', 'drew-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', 'drew-core' ),
'description' => esc_html__( 'Choose Google Fonts which you want to use on your website', 'drew-core' ),
'button_text' => esc_html__( 'Add New Google Font', 'drew-core' ),
)
);
$page_repeater->add_field_element(
array(
'field_type' => 'googlefont',
'name' => 'qodef_choose_google_font',
'title' => esc_html__( 'Google Font', 'drew-core' ),
'description' => esc_html__( 'Choose Google Font', 'drew-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', 'drew-core' ),
'description' => esc_html__( 'Choose a default Google Fonts weights for your website. Impact on page load time', 'drew-core' ),
'options' => array(
'100' => esc_html__( '100 Thin', 'drew-core' ),
'100i' => esc_html__( '100 Thin Italic', 'drew-core' ),
'200' => esc_html__( '200 Extra-Light', 'drew-core' ),
'200i' => esc_html__( '200 Extra-Light Italic', 'drew-core' ),
'300' => esc_html__( '300 Light', 'drew-core' ),
'300i' => esc_html__( '300 Light Italic', 'drew-core' ),
'400' => esc_html__( '400 Regular', 'drew-core' ),
'400i' => esc_html__( '400 Regular Italic', 'drew-core' ),
'500' => esc_html__( '500 Medium', 'drew-core' ),
'500i' => esc_html__( '500 Medium Italic', 'drew-core' ),
'600' => esc_html__( '600 Semi-Bold', 'drew-core' ),
'600i' => esc_html__( '600 Semi-Bold Italic', 'drew-core' ),
'700' => esc_html__( '700 Bold', 'drew-core' ),
'700i' => esc_html__( '700 Bold Italic', 'drew-core' ),
'800' => esc_html__( '800 Extra-Bold', 'drew-core' ),
'800i' => esc_html__( '800 Extra-Bold Italic', 'drew-core' ),
'900' => esc_html__( '900 Ultra-Bold', 'drew-core' ),
'900i' => esc_html__( '900 Ultra-Bold Italic', 'drew-core' ),
),
)
);
$google_fonts_section->add_field_element(
array(
'field_type' => 'checkbox',
'name' => 'qodef_google_fonts_subset',
'title' => esc_html__( 'Google Fonts Style', 'drew-core' ),
'description' => esc_html__( 'Choose a default Google Fonts style for your website. Impact on page load time', 'drew-core' ),
'options' => array(
'latin' => esc_html__( 'Latin', 'drew-core' ),
'latin-ext' => esc_html__( 'Latin Extended', 'drew-core' ),
'cyrillic' => esc_html__( 'Cyrillic', 'drew-core' ),
'cyrillic-ext' => esc_html__( 'Cyrillic Extended', 'drew-core' ),
'greek' => esc_html__( 'Greek', 'drew-core' ),
'greek-ext' => esc_html__( 'Greek Extended', 'drew-core' ),
'vietnamese' => esc_html__( 'Vietnamese', 'drew-core' ),
),
)
);
$page_repeater = $page->add_repeater_element(
array(
'name' => 'qodef_custom_fonts',
'title' => esc_html__( 'Custom Fonts', 'drew-core' ),
'description' => esc_html__( 'Add custom fonts', 'drew-core' ),
'button_text' => esc_html__( 'Add New Custom Font', 'drew-core' ),
)
);
$page_repeater->add_field_element(
array(
'field_type' => 'file',
'name' => 'qodef_custom_font_ttf',
'title' => esc_html__( 'Custom Font TTF', 'drew-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', 'drew-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', 'drew-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', 'drew-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', 'drew-core' ),
)
);
// Hook to include additional options after module options
do_action( 'drew_core_action_after_page_fonts_options_map', $page );
}
}
add_action( 'drew_core_action_default_options_init', 'drew_core_add_fonts_options', drew_core_get_admin_options_map_position( 'fonts' ) );
}