Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
home
/
getwphos
/
www
/
wastefull
/
wp-content
/
themes
/
wastia
/
inc
/
theme-options
/
File Content:
theme-options.php
<?php if (class_exists('Theme_Core_Options')) { // Set Location of Theme Options Menu add_filter('tco_page_parent', 'wastia_tco_parent_page'); function wastia_tco_parent_page() { $current_theme = wp_get_theme(); if (is_child_theme()) { $current_theme = $current_theme->parent(); } return $current_theme->get('TextDomain'); } // Set Theme Options Name add_filter('tco_theme_options_name', 'wastia_tco_theme_options_name'); add_filter('swa_ie_options_name', 'wastia_tco_theme_options_name'); function wastia_tco_theme_options_name() { $opt_name = wastia_get_opt_name(); return $opt_name; } add_filter('tco_theme_options_args', 'wastia_theme_options_args'); function wastia_theme_options_args() { $default = false; $default_value = '1'; $default_layout = '1'; $default_on = 'on'; $default_off = 'off'; $default_width = 'container'; $custom_opts = false; $general = include get_template_directory() . '/inc/theme-options/args/general.php'; $header_top = include get_template_directory() . '/inc/theme-options/args/header-top.php'; $header = include get_template_directory() . '/inc/theme-options/args/header.php'; $page_title = include get_template_directory() . '/inc/theme-options/args/page-title.php'; $content = include get_template_directory() . '/inc/theme-options/args/content.php'; $sidebar = include get_template_directory() . '/inc/theme-options/args/sidebar.php'; $shop = include get_template_directory() . '/inc/theme-options/args/shop.php'; $footer = include get_template_directory() . '/inc/theme-options/args/footer.php'; $api = include get_template_directory() . '/inc/theme-options/args/api.php'; $page_404 = include get_template_directory() . '/inc/theme-options/args/404-page.php'; $args = [ 'general' => $general, 'header_top' => $header_top, 'header' => $header, 'page-title' => $page_title, 'content' => $content, 'sidebar' => $sidebar, 'footer' => $footer, '404-page' => $page_404, ]; if(class_exists('WooCommerce')){ $args['shop'] = $shop; } $args['api'] = $api; return $args; } } /** * Get post thumbnail as image options * @return array * */ function wastia_list_post_thumbnail($post_type = 'post', $default = false, $args = []){ $layouts = []; if($default){ $layouts['-1'] = get_template_directory_uri() . '/assets/images/default-opt/default.jpg'; $layouts['none'] = get_template_directory_uri() . '/assets/images/default-opt/none.jpg'; } $layouts = array_unique($layouts + $args); $posts = get_posts(array('post_type' => $post_type,'posts_per_page' => '-1')); foreach($posts as $post){ $layouts[$post->ID] = wp_get_attachment_image_url(get_post_thumbnail_id($post->ID), 'full'); } return $layouts; } /** * Typography **/ if(!function_exists('wastia_typography_opts')){ function wastia_typography_opts($args = []){ $default = [ 'body_font' => [ 'type' => Theme_Core_Options::SELECT_FIELD, 'title' => esc_html__('Body Font', 'wastia'), 'options' => [ 'default' => esc_html__('Default', 'wastia'), 'custom' => esc_html__('Custom', 'wastia'), ], 'default' => 'default' ], 'body_font_typo' => [ 'type' => Theme_Core_Options::TYPOGRAPHY_FIELD, 'title' => esc_html__('Body Custom Font', 'wastia'), 'subtitle' => esc_html__('This will be the default font of your website.', 'wastia'), 'required' => [ 'body_font', '=', 'custom' ], 'font_backup' => false, 'font_subsets' => false, 'font_style' => true, 'line_height' => false, 'font_size' => false, 'color' => false, 'output' => ['body'] ], 'heading_font' => [ 'type' => Theme_Core_Options::SELECT_FIELD, 'title' => esc_html__('Heading Default Font', 'wastia'), 'options' => [ 'default' => esc_html__('Default', 'wastia'), 'custom' => esc_html__('Google Font', 'wastia'), ], 'default' => 'default' ], 'heading_font_typo' => [ 'type' => Theme_Core_Options::TYPOGRAPHY_FIELD, 'title' => esc_html__('Heading', 'wastia'), 'subtitle' => esc_html__('This will be the default font for all Heading tags of your website.', 'wastia'), 'output' => [ //'h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6,.heading, .cms-heading' ], 'required' => [ 'heading_font', '=', 'custom', ], 'font_backup' => false, 'font_subsets' => false, 'font_style' => true, 'line_height' => true, 'font_size' => false, 'color' => false, ] ]; return [ 'title' => esc_html__('Typographys', 'wastia'), 'fields' => array_merge($default, $args) ]; } } if(!function_exists('wastia_general_advanced_opts')){ function wastia_general_advanced_opts($args = []){ $default = [ 'btn_style' => [ 'type' => Theme_Core_Options::SELECT_FIELD, 'title' => esc_html__('Button Style', 'wastia'), 'options' => [ 'btn-style-default' => esc_html__('Default', 'wastia'), 'btn-style-rounded' => esc_html__('Rounded', 'wastia'), 'btn-style-rounded5' => esc_html__('Rounded (5px)', 'wastia'), ], 'default' => 'btn-style-default' ] ]; return [ 'title' => esc_html__('Advanced', 'wastia'), 'fields' => array_merge($default, $args) ]; } } /** * ON/ OFF option * * */ function wastia_theme_on_off_opts($args = []){ $args = wp_parse_args($args, [ 'default' => false, 'default_value' => 'off', 'title' => esc_html__('On/Off', 'wastia'), 'subtitle' => '', 'required' => '' ]); $opts = [ 'on' => esc_html__('On', 'wastia'), 'off' => esc_html__('Off', 'wastia'), ]; if($args['default']) { $opts['-1'] = esc_html__('Default','wastia'); $args['default_value'] = '-1'; } return [ 'type' => Theme_Core_Options::BUTTON_SET_FIELD, 'title' => $args['title'], 'subtitle' => $args['subtitle'], 'options' => $opts, 'default' => $args['default_value'], 'required' => $args['required'] ]; } /** * Show/ Hide option * * */ function wastia_theme_show_hide_opts($args = []){ $args = wp_parse_args($args, [ 'default' => false, 'default_value' => 'off', 'title' => esc_html__('Show/Hide', 'wastia'), 'subtitle' => '', 'required' => '' ]); $opts = [ 'on' => esc_html__('Show', 'wastia'), 'off' => esc_html__('Hide', 'wastia'), ]; if($args['default']) { $opts['-1'] = esc_html__('Default','wastia'); $args['default_value'] = '-1'; } return [ 'type' => Theme_Core_Options::BUTTON_SET_FIELD, 'title' => $args['title'], 'subtitle' => $args['subtitle'], 'options' => $opts, 'default' => $args['default_value'], 'required' => $args['required'] ]; } /** * Content Width * * */ function wastia_theme_content_width_opts($args = []){ $args = wp_parse_args($args, [ 'default' => false, 'default_value' => 'container', 'title' => esc_html__('Content Width','wastia'), 'subtitle' => '', 'required' => '' ]); $opts = [ 'container' => esc_html__('Container', 'wastia'), 'container-wide' => esc_html__('Container Wide', 'wastia'), 'container-fluid' => esc_html__('Container Fluid', 'wastia'), 'container--full' => esc_html__('Container Full', 'wastia'), 'full' => esc_html__('Full No Space', 'wastia') ]; if($args['default']) { $opts['-1'] = esc_html__('Default','wastia'); $args['default_value'] = '-1'; } return [ 'type' => Theme_Core_Options::BUTTON_SET_FIELD, 'title' => $args['title'], 'subtitle' => $args['subtitle'], 'options' => $opts, 'default' => $args['default_value'], 'required' => $args['required'] ]; } function wastia_theme_content_width_render($args = []){ $args = wp_parse_args($args, [ 'name' => '', 'default' => 'container' ]); $settings = wastia_get_opts($args['name'], $agrs['default']); if(!empty($settings)) return $args['prefix'].$settings; } /** * Content Alignment * **/ function wastia_them_content_align_opts($args = []){ $args = wp_parse_args($args, [ 'default' => false, 'default_value' => '', 'title' => esc_html__('Content Alignment','wastia'), 'subtitle' => '', 'required' => '' ]); $opts = [ 'start' => esc_html__('Start', 'wastia'), 'center' => esc_html__('Center', 'wastia'), 'end' => esc_html__('End', 'wastia'), ]; if($args['default']) { $opts['-1'] = esc_html__('Default','wastia'); $args['default_value'] = '-1'; } return [ 'type' => Theme_Core_Options::BUTTON_SET_FIELD, 'title' => $args['title'], 'subtitle' => $args['subtitle'], 'options' => $opts, 'default' => $args['default_value'], 'required' => $args['required'] ]; } function wastia_them_content_align_render($args = []){ $args = wp_parse_args($args, [ 'name' => '', 'prefix' => 'text-', 'default' => 'start' ]); $settings = wastia_get_opts($args['name'], $agrs['default']); if(!empty($settings)) return $args['prefix'].$settings; } /** * Button Settings * * **/ if(!function_exists('wastia_theme_button_settings')){ function wastia_theme_button_settings($args = []){ $args = wp_parse_args($args, [ 'name' => 'h_btn', 'heading' => esc_html__('Button Settings','wastia'), 'default' => false, 'default_value' => 'off' ]); return [ $args['name'].'_heading' => [ 'type' => Theme_Core_Options::HEADING_FIELD, 'title' => $args['heading'], ], $args['name'].'_on' => wastia_theme_on_off_opts([ 'default' => $args['default'], 'default_value' => $args['default_value'], 'title' => esc_html__('Show/Hide Button', 'wastia') ]), $args['name'].'_text' => [ 'type' => Theme_Core_Options::TEXT_FIELD, 'title' => esc_html__('Button Text', 'wastia'), 'required' => [ $args['name'].'_on', '=', 'on' ], ], $args['name'].'_link_type' => [ 'type' => Theme_Core_Options::BUTTON_SET_FIELD, 'title' => esc_html__('Button Link Type', 'wastia'), 'options' => [ 'page' => esc_html__('Page', 'wastia'), 'custom' => esc_html__('Custom', 'wastia'), ], 'default' => 'page', 'required' => [ $args['name'].'_on', '=', 'on' ], ], $args['name'].'_link' => [ 'type' => Theme_Core_Options::SELECT_FIELD, 'title' => esc_html__('Page Link', 'wastia'), 'args' => [ 'post_type' => 'page', 'posts_per_page' => -1, 'orderby' => 'title', 'order' => 'ASC', ], 'select2' => true, 'required' => [ $args['name'].'_link_type', '=', 'page' ], ], $args['name'].'_link_custom' => [ 'type' => Theme_Core_Options::TEXT_FIELD, 'title' => esc_html__('Custom Link', 'wastia'), 'required' => [ $args['name'].'_link_type', '=', 'custom' ], ], $args['name'].'_target' => [ 'type' => Theme_Core_Options::BUTTON_SET_FIELD, 'title' => esc_html__('Button Target', 'wastia'), 'options' => [ '_self' => esc_html__('Self', 'wastia'), '_blank' => esc_html__('Blank', 'wastia'), ], 'default' => '_self', 'required' => [ $args['name'].'_on', '=', 'on' ], ] ]; } } /** * Phone Settings * **/ if(!function_exists('wastia_theme_phone_settings')){ function wastia_theme_phone_settings($args = []){ $args = wp_parse_args($args, [ 'name' => '', 'default' => false, 'default_opt' => 'off' ]); return [ 'show_phone'.$args['name'] => [ 'type' => Theme_Core_Options::HEADING_FIELD, 'title' => esc_html__('Phone', 'wastia').' '.$args['name'], ], 'h_phone'.$args['name'].'_on' => wastia_theme_on_off_opts([ 'default' => $args['default'], 'default_value' => 'off', 'title' => esc_html__('Show/Hide Phone', 'wastia').' '.$args['name'] ]), 'h_phone'.$args['name'].'_text' => [ 'type' => Theme_Core_Options::TEXT_FIELD, 'title' => esc_html__('Phone Text', 'wastia'), 'placeholder' => 'Need assistance?', 'required' => [ 'h_phone'.$args['name'].'_on', '=', 'on' ] ], 'h_phone'.$args['name'].'_number' => [ 'type' => Theme_Core_Options::TEXT_FIELD, 'title' => esc_html__('Phone Number', 'wastia'), 'placeholder' => '+2 0106124541', 'required' => [ 'h_phone'.$args['name'].'_on', '=', 'on' ] ] ]; } } /** * Header layout * * */ if(!function_exists('wastia_theme_header_layout_opts')){ function wastia_theme_header_layout_opts($args = []){ $args = wp_parse_args($args, [ 'default' => false, 'default_value' => '1', 'required' => '' ]); $header_layout = []; if($args['default']){ $header_layout['-1'] = get_template_directory_uri() . '/assets/images/default-opt/default.jpg'; $header_layout['none'] = get_template_directory_uri() . '/assets/images/default-opt/default.jpg'; } // Theme Layout $layouts = [ '1' => get_template_directory_uri() . '/assets/images/header-layout/h1.jpg', '2' => get_template_directory_uri() . '/assets/images/header-layout/h2.jpg', '3' => get_template_directory_uri() . '/assets/images/header-layout/h3.jpg', '5' => get_template_directory_uri() . '/assets/images/header-layout/h5.jpg', // @since 1.0.9 '6' => get_template_directory_uri() . '/assets/images/header-layout/h6.webp', '7' => get_template_directory_uri() . '/assets/images/header-layout/h7.webp', '8' => get_template_directory_uri() . '/assets/images/header-layout/h8.webp' ]; return [ 'type' => Theme_Core_Options::IMAGE_SELECT_FIELD, 'title' => esc_html__('Layout', 'wastia'), 'subtitle' => esc_html__('Select a layout for header.', 'wastia'), 'options' => array_unique ($header_layout + $layouts), 'default' => $args['default_value'], 'required' => $args['required'] ]; } } /** * Header Side Nav Options **/ if(!function_exists('wastia_header_side_nav_opts')){ function wastia_header_side_nav_opts($args=[]){ $args = wp_parse_args($args, [ 'default' => false, 'default_value' => '1', 'default_on' => 'off', 'required' => 'hide_sidebar_icon' ]); if($args['default']){ $args['default_value'] = '-1'; } $default_fields = [ 'header_sidenav_layout' => array( 'type' => Theme_Core_Options::IMAGE_SELECT_FIELD, 'title' => esc_html__('Hidden Sidebar Layout', 'wastia'), 'subtitle' => esc_html__('Select a layout for upper side nav area.', 'wastia'), 'description' => sprintf(esc_html__('%sClick Here%s to add your custom side nav layout.','wastia'),'<a href="' . esc_url( admin_url( 'edit.php?post_type=cms-sidenav' ) ) . '" target="_blank">','</a>'), 'placeholder' => esc_html__('Default','wastia'), 'options' => wastia_list_post_thumbnail('cms-sidenav', $args['default']), 'default' => $args['default_value'], 'required' => [ $args['required'], "=", 'on' ] ) ]; // Return /*return [ 'title' => esc_html__('Header Side Nav', 'wastia'), 'fields' => $custom_fields + $default_fields ];*/ return $default_fields; } } /** * Header TOp Options **/ if(!function_exists('wastia_header_top_opts')){ function wastia_header_top_opts($args=[]){ $args = wp_parse_args($args, [ 'default' => false, 'default_value' => '1', 'default_on' => 'off', 'custom' => false ]); if($args['default']){ $args['default_value'] = '-1'; } $custom_fields = []; if($args['custom']){ $custom_fields['header_top_custom'] = wastia_theme_on_off_opts([ 'title' => esc_html__('Custom Header Top','wastia'), 'default' => false ]); } $default_fields = [ 'header_top_layout' => array( 'type' => Theme_Core_Options::IMAGE_SELECT_FIELD, 'title' => esc_html__('Layout', 'wastia'), 'subtitle' => esc_html__('Select a layout for upper footer area.', 'wastia'), 'description' => sprintf(esc_html__('%sClick Here%s to add your custom header top layout.','wastia'),'<a href="' . esc_url( admin_url( 'edit.php?post_type=cms-header-top' ) ) . '" target="_blank">','</a>'), 'placeholder' => esc_html__('Default','wastia'), 'options' => wastia_list_post_thumbnail('cms-header-top', $args['default'], [ 'none' => get_template_directory_uri() . '/assets/images/default-opt/none.jpg' ]), 'default' => $args['default_value'], 'required' => [ 'header_top_custom', "=", 'on' ] ) ]; // Return return [ 'title' => esc_html__('Header Top', 'wastia'), 'fields' => $custom_fields + $default_fields ]; } } /** * Footer Options **/ if(!function_exists('wastia_footer_opts')){ function wastia_footer_opts($args=[]){ $args = wp_parse_args($args, [ 'default' => false, 'default_value' => '1', 'default_on' => 'off', 'custom' => false ]); if($args['default']){ $args['default_value'] = '-1'; } $custom_fields = []; if($args['custom']){ $custom_fields['footer_custom'] = wastia_theme_on_off_opts([ 'title' => esc_html__('Custom Footer','wastia'), 'default' => false ]); } $default_fields = [ 'footer_layout' => array( 'type' => Theme_Core_Options::IMAGE_SELECT_FIELD, 'title' => esc_html__('Layout', 'wastia'), 'subtitle' => esc_html__('Select a layout for upper footer area.', 'wastia'), 'description' => sprintf(esc_html__('%sClick Here%s to add your custom footer layout.','wastia'),'<a href="' . esc_url( admin_url( 'edit.php?post_type=cms-footer' ) ) . '" target="_blank">','</a>'), 'placeholder' => esc_html__('Default','wastia'), 'options' => wastia_list_post_thumbnail('cms-footer', $args['default'], [ '1' => get_template_directory_uri() . '/assets/images/footer-layout/default.png' ]), 'default' => $args['default_value'], 'required' => [ 'footer_custom', "=", 'on' ] ), 'footer_fixed' => wastia_theme_on_off_opts([ 'title' => esc_html__('Footer Fixed', 'wastia'), 'subtitle' => esc_html__('Make footer fixed at bottom?', 'wastia'), 'default' => $args['default'], 'default_value' => $args['default_on'], 'required' => [ 'footer_custom', "=", 'on' ] ]) ]; // Return return [ 'title' => esc_html__('Footer', 'wastia'), 'fields' => $custom_fields + $default_fields ]; } }
Edit
Rename
Chmod
Delete
FILE
FOLDER
Name
Size
Permission
Action
args
---
0755
theme-options.php
23082 bytes
0644
N4ST4R_ID | Naxtarrr