File: /mnt/data/smarthr-co-in/wp-content/themes/dreamslanding/inc/options-init.php
<?php
/**
* ReduxFramework Sample Config File
* For full documentation, please visit: http://docs.reduxframework.com/
*/
if ( ! class_exists( 'Redux' ) ) {
return;
}
// This is your option name where all the Redux data is stored.
$opt_name = "dreamstour_theme_options";
// This line is only for altering the demo. Can be easily removed.
/*
*
* --> Used within different fields. Simply examples. Search for ACTUAL DECLARATION for field examples
*
*/
$sampleHTML = '';
if ( file_exists( dirname( __FILE__ ) . '/info-html.html' ) ) {
Redux_Functions::initWpFilesystem();
global $wp_filesystem;
$sampleHTML = $wp_filesystem->get_contents( dirname( __FILE__ ) . '/info-html.html' );
}
// Background Patterns Reader
$sample_patterns_path = ReduxFramework::$_dir . '../sample/patterns/';
$sample_patterns_url = ReduxFramework::$_url . '../sample/patterns/';
$sample_patterns = array();
if ( is_dir( $sample_patterns_path ) ) {
if ( $sample_patterns_dir = opendir( $sample_patterns_path ) ) {
$sample_patterns = array();
while ( ( $sample_patterns_file = readdir( $sample_patterns_dir ) ) !== false ) {
if ( stristr( $sample_patterns_file, '.png' ) !== false || stristr( $sample_patterns_file, '.jpg' ) !== false ) {
$name = explode( '.', $sample_patterns_file );
$name = str_replace( '.' . end( $name ), '', $sample_patterns_file );
$sample_patterns[] = array(
'alt' => $name,
'img' => $sample_patterns_url . $sample_patterns_file
);
}
}
}
}
$theme = wp_get_theme();
$args = array(
'opt_name' => $opt_name,
'display_name' => $theme->get( 'Name' ),
'display_version' => $theme->get( 'Version' ),
'menu_type' => 'submenu',
'allow_sub_menu' => true,
'menu_title' => __( 'Theme Options','dreamstour' ),
'page_title' => __( 'Theme Options','dreamstour' ),
'google_api_key' => '',
'google_update_weekly' => false,
'async_typography' => false,
'admin_bar' => true,
'admin_bar_icon' => 'dashicons-portfolio',
'admin_bar_priority' => 50,
'global_variable' => '',
'dev_mode' => false,
'update_notice' => true,
'customizer' => true,
'page_priority' => null,
'page_parent' => 'themes.php',
'page_permissions' => 'manage_options',
'menu_icon' => '',
'last_tab' => '',
'page_icon' => 'icon-themes',
'page_slug' => 'dreamstour',
'save_defaults' => true,
'default_show' => false,
'default_mark' => '',
'show_import_export' => true,
'transient_time' => 60 * MINUTE_IN_SECONDS,
'output' => true,
'output_tag' => true,
'database' => '',
'use_cdn' => true,
'hints' => array(
'icon' => 'el el-question-sign',
'icon_position' => 'right',
'icon_color' => 'lightgray',
'icon_size' => 'normal',
'tip_style' => array(
'color' => 'red',
'shadow' => true,
'rounded' => false,
'style' => '',
),
'tip_position' => array(
'my' => 'top left',
'at' => 'bottom right',
),
'tip_effect' => array(
'show' => array(
'effect' => 'slide',
'duration' => '500',
'event' => 'mouseover',
),
'hide' => array(
'effect' => 'slide',
'duration' => '500',
'event' => 'click mouseleave',
),
),
)
);
$args['share_icons'][] = array(
'url' => 'https://www.youtube.com/',
'title' => 'View videos on YouTube',
'icon' => 'el el-youtube'
);
$args['share_icons'][] = array(
'url' => 'https://www.facebook.com/',
'title' => 'Like us on Facebook',
'icon' => 'el el-facebook'
);
Redux::setArgs( $opt_name, $args );
$tabs = array(
array(
'id' => 'redux-help-tab-1',
'title' => __( 'Theme Information 1','dreamstour'),
'content' => __( '<p>This is the tab content, HTML is allowed.</p>' ,'dreamstour')
),
array(
'id' => 'redux-help-tab-2',
'title' => __( 'Theme Information 2' ,'dreamstour'),
'content' => __( '<p>This is the tab content, HTML is allowed.</p>','dreamstour' )
)
);
Redux::set_help_tab( $opt_name, $tabs );
$content = __( '<p>This is the sidebar content, HTML is allowed.</p>' ,'dreamstour');
Redux::set_help_sidebar( $opt_name, $content );
Redux::setSection( $opt_name, array(
'title' => __( 'Header','dreamstour' ),
'id' => 'header',
'desc' => __( 'All Website Header settings will be changeable from here','dreamstour' ),
'icon' => 'el el-home',
'fields' => array(
array(
'id' => 'frontend_logo',
'type' => 'media',
'url' => true,
'title' => __( 'Logo' ,'dreamstour'),
'compiler' => 'true',
'default' => array( 'url' => trailingslashit(get_template_directory_uri()) . 'assets/images/logo.svg' ),
),
array(
'id' => 'header_style',
'type' => 'select',
'title' => esc_html__('Header Style', 'dreamslms'),
'options' => array(
'style1' => esc_html__('Style 1', 'dreamslms'),
),
'default' => 'default',
),
array(
'id' => 'header_login_text',
'type' => 'text',
'title' => __('Login Button Text', 'dreamstour'),
'default' => 'Login',
),
array(
'id' => 'header_login_url',
'type' => 'text',
'title' => __('Login Button URL', 'dreamstour'),
'placeholder' => __('https://example.com/login', 'dreamstour'),
'default' => '#',
'validate' => 'url',
),
array(
'id' => 'header_buy_product_text',
'type' => 'text',
'title' => __('Buy Product Button Text', 'dreamstour'),
'default' => 'Buy Product',
),
array(
'id' => 'header_buy_product_url',
'type' => 'text',
'title' => __('Buy Product Button URL', 'dreamstour'),
'placeholder' => __('https://example.com/buy', 'dreamstour'),
'default' => '#',
'validate' => 'url',
),
)
) );
Redux::setSection( $opt_name, array(
'title' => __( 'Footer' ,'dreamstour'),
'id' => 'footers',
'customizer_width' => '500px',
'icon' => 'el el-edit',
'fields' => array(
array(
'id' => 'footer_style',
'type' => 'select',
'title' => esc_html__('Footer Style', 'dreamslms'),
'options' => array(
'style1' => esc_html__('Style 1', 'dreamslms'),
),
'default' => 'style1',
),
// Top section
array(
'id' => 'footer_top_section',
'title' => 'Footer Top',
'type' => 'section',
'indent' => true,
),
array(
'id' => 'footer_top_heading',
'type' => 'text',
'title' => esc_html__('Top Heading','dreamstour' ),
'default' => 'Fully customizable. Enterprise-grade security. Startup-friendly pricing.',
),
array(
'id' => 'footer_top_desc',
'type' => 'textarea',
'title' => esc_html__('Top Description','dreamstour' ),
'default' => 'SmartHR is a unified business management platform that combines HRM, Accounting, CRM, Projects, User Management, and POS in one powerful system. Trusted by 2,500+ companies across 50+ countries, we help businesses eliminate manual processes, scale efficiently, and make data-driven decisions.',
'args' => array(
'wpautop' => false,
'media_buttons' => false,
'textarea_rows' => 3,
'teeny' => false,
'quicktags' => false,
)
),
array(
'id' => 'footer_top_cta_text',
'type' => 'text',
'title' => esc_html__('Top CTA Text','dreamstour' ),
'default' => 'Ready to Customize?',
),
array(
'id' => 'footer_top_cta_url',
'type' => 'text',
'title' => esc_html__('Top CTA URL','dreamstour' ),
'default' => '#',
'validate' => 'url',
),
array(
'id' => 'footer_top_cta_heading',
'type' => 'text',
'title' => esc_html__('Top CTA Heading','dreamstour' ),
'default' => 'Speak with Our Sales Experts',
),
array(
'id' => 'footer_main_column_1',
'title' => 'Footer Column 1',
'type' => 'section',
'indent' => true,
),
array(
'id' => 'footer_column1_title',
'type' => 'text',
'title' => esc_html__('Footer Column 1 Title','dreamstour' ),
'default' => 'Product',
),
array(
'id' => 'footer_column1_menus',
'type' => 'select',
'title' => __('Select Footer Column 1 Menus','dreamstour' ),
'multi' => true,
'sortable' => true,
'data' => 'menus',
'args' => array(
'save_as' => 'id',
),
),
array(
'id' => 'footer_main_column_2',
'title' => 'Footer Column 2',
'type' => 'section',
'indent' => true,
),
array(
'id' => 'footer_column2_title',
'type' => 'text',
'title' => esc_html__('Footer Column 2 Title','dreamstour' ),
'default' => 'Resources',
),
array(
'id' => 'footer_column2_menus',
'type' => 'select',
'title' => __('Select Footer Column 2 Menus','dreamstour' ),
'multi' => true,
'sortable' => true,
'data' => 'menus',
'args' => array(
'save_as' => 'id', //
),
),
array(
'id' => 'footer_main_column_3',
'title' => 'Footer Column 3',
'type' => 'section',
'indent' => true,
),
array(
'id' => 'footer_column3_title',
'type' => 'text',
'title' => esc_html__('Footer Column 3 Title','dreamstour' ),
'default' => 'Resources',
),
array(
'id' => 'footer_column3_menus',
'type' => 'select',
'title' => __('Select Footer Column 3 Menus','dreamstour' ),
'multi' => true,
'sortable' => true,
'data' => 'menus',
'args' => array(
'save_as' => 'id', //
),
),
array(
'id' => 'footer_main_column_4',
'title' => 'Footer Column 4',
'type' => 'section',
'indent' => true,
),
array(
'id' => 'footer_contact_title',
'type' => 'text',
'title' => esc_html__('Footer Contact Title','dreamstour' ),
'default' => 'Contact',
),
array(
'id' => 'footer_contact_uk_heading',
'type' => 'text',
'title' => esc_html__('UK Address Heading','dreamstour' ),
'default' => 'UK Location',
),
array(
'id' => 'footer_contact_uk',
'type' => 'textarea',
'title' => esc_html__('UK Address','dreamstour' ),
'default' => "City Business Centre, 11a Lower Rd,\nLondon SE16 2XB\nContact: +44 7438823475",
'args' => array(
'wpautop' => false,
'media_buttons' => false,
'textarea_rows' => 4,
'teeny' => false,
'quicktags' => false,
),
),
array(
'id' => 'footer_contact_india_heading',
'type' => 'text',
'title' => esc_html__('India Address Heading','dreamstour' ),
'default' => 'India Location',
),
array(
'id' => 'footer_contact_india',
'type' => 'textarea',
'title' => esc_html__('India Address','dreamstour' ),
'default' => "22, Sri Kanchi Nagar,\nCheranmanagar,\nCoimbatore, India - 641035.\nContact: +91 9942576886",
'args' => array(
'wpautop' => false,
'media_buttons' => false,
'textarea_rows' => 4,
'teeny' => false,
'quicktags' => false,
),
),
array(
'id' => 'footer_social_facebook',
'type' => 'text',
'title' => esc_html__('Facebook URL','dreamstour' ),
'default' => '',
'validate' => 'url',
),
array(
'id' => 'footer_social_linkedin',
'type' => 'text',
'title' => esc_html__('LinkedIn URL','dreamstour' ),
'default' => '',
'validate' => 'url',
),
array(
'id' => 'footer_social_x',
'type' => 'text',
'title' => esc_html__('X (Twitter) URL','dreamstour' ),
'default' => '',
'validate' => 'url',
),
array(
'id' => 'footer_social_youtube',
'type' => 'text',
'title' => esc_html__('YouTube URL','dreamstour' ),
'default' => '',
'validate' => 'url',
),
array(
'id' => 'footer_social_instagram',
'type' => 'text',
'title' => esc_html__('Instagram URL','dreamstour' ),
'default' => '',
'validate' => 'url',
),
array(
'id' => 'footer_bottom',
'title' => 'Footer Bottom',
'type' => 'section',
'indent' => true,
),
array(
'id' => 'footer_copyright_text',
'type' => 'textarea',
'title' => esc_html__('Footer Copyright Text','dreamstour' ),
'default' => ' 2025 SmartHR. All rights reserved.',
'args' => array(
'wpautop' => false,
'media_buttons' => false,
'textarea_rows' => 5,
'teeny' => false,
'quicktags' => false,
)
),
array(
'id' => 'footer_compliance_text',
'type' => 'text',
'title' => esc_html__('Footer Compliance Text','dreamstour' ),
'default' => 'ISO 27001 | SOC 2 Type II | GDPR Compliant',
),
),
) );
// Model Popup (top-level) section
Redux::setSection( $opt_name, array(
'title' => __( 'Model Popup','dreamstour' ),
'id' => 'model_popup',
'icon' => 'el el-bell',
'fields' => array(
array(
'id' => 'onload_enable',
'type' => 'switch',
'title' => esc_html__('Enable Onload Modal','dreamstour'),
'default' => false,
),
array(
'id' => 'onload_small_heading',
'type' => 'text',
'title' => esc_html__('Small Heading','dreamstour'),
'default' => 'Get Started with',
),
array(
'id' => 'onload_title',
'type' => 'text',
'title' => esc_html__('Title','dreamstour'),
'default' => 'SmartHR in 2 Minutes',
),
array(
'id' => 'onload_desc',
'type' => 'textarea',
'title' => esc_html__('Description','dreamstour'),
'default' => 'See how 2,500+ businesses manage HR, Payroll, Projects & Accounting in one platform. 50-70% more affordable than enterprise HRMS. Go live in 1-3 weeks, not months.',
'args' => array(
'wpautop' => false,
'media_buttons' => false,
'textarea_rows' => 3,
'teeny' => false,
'quicktags' => false,
),
),
array(
'id' => 'onload_email_label',
'type' => 'text',
'title' => esc_html__('Email Label','dreamstour'),
'default' => 'Email',
),
array(
'id' => 'onload_email_placeholder',
'type' => 'text',
'title' => esc_html__('Email Placeholder','dreamstour'),
'default' => 'Enter Your Email',
),
array(
'id' => 'onload_primary_btn_text',
'type' => 'text',
'title' => esc_html__('Primary Button Text','dreamstour'),
'default' => 'See SmartHR Demo',
),
array(
'id' => 'onload_primary_btn_url',
'type' => 'text',
'title' => esc_html__('Primary Button URL','dreamstour'),
'default' => '#',
'validate' => 'url',
),
array(
'id' => 'onload_secondary_btn_text',
'type' => 'text',
'title' => esc_html__('Secondary Button Text','dreamstour'),
'default' => "I'll explore on my own",
),
array(
'id' => 'onload_secondary_btn_url',
'type' => 'text',
'title' => esc_html__('Secondary Button URL','dreamstour'),
'default' => '#',
'validate' => 'url',
),
array(
'id' => 'onload_highlight1_icon',
'type' => 'text',
'title' => esc_html__('Highlight 1 Icon Class','dreamstour'),
'default' => 'ti ti-shield',
),
array(
'id' => 'onload_highlight1_text',
'type' => 'text',
'title' => esc_html__('Highlight 1 Text','dreamstour'),
'default' => 'Your Data is Safe',
),
array(
'id' => 'onload_highlight2_icon',
'type' => 'text',
'title' => esc_html__('Highlight 2 Icon Class','dreamstour'),
'default' => 'ti ti-star',
),
array(
'id' => 'onload_highlight2_text',
'type' => 'text',
'title' => esc_html__('Highlight 2 Text','dreamstour'),
'default' => '4.8/5 Rating',
),
array(
'id' => 'onload_highlight3_icon',
'type' => 'text',
'title' => esc_html__('Highlight 3 Icon Class','dreamstour'),
'default' => 'ti ti-building-estate',
),
array(
'id' => 'onload_highlight3_text',
'type' => 'text',
'title' => esc_html__('Highlight 3 Text','dreamstour'),
'default' => '2,500+ Companies Trust US',
),
),
) );
if ( file_exists( dirname( __FILE__ ) . '/../README.md' ) ) {
$section = array(
'icon' => 'el el-list-alt',
'title' => __( 'Documentation' ,'dreamstour'),
'fields' => array(
array(
'id' => '17',
'type' => 'raw',
'markdown' => true,
'content_path' => dirname( __FILE__ ) . '/../README.md',
),
),
);
Redux::setSection( $opt_name, $section );
}
if ( ! function_exists( 'compiler_action' ) ) {
function compiler_action( $options, $css, $changed_values ) {
echo '<h1>The compiler hook has run!</h1>';
echo "<pre>";
print_r( $changed_values );
echo "</pre>";
}
}
function dreamstour_validate_menus( $field, $value, $existing_value ) {
$valid = array();
foreach ( (array) $value as $menu_id ) {
if ( wp_get_nav_menu_object( $menu_id ) ) {
$valid[] = $menu_id;
}
}
return $valid;
}
if ( ! function_exists( 'redux_validate_callback_function' ) ) {
function redux_validate_callback_function( $field, $value, $existing_value ) {
$error = false;
$warning = false;
//do your validation
if ( $value == 1 ) {
$error = true;
$value = $existing_value;
} elseif ( $value == 2 ) {
$warning = true;
$value = $existing_value;
}
$return['value'] = $value;
if ( $error == true ) {
$field['msg'] = 'your custom error message';
$return['error'] = $field;
}
if ( $warning == true ) {
$field['msg'] = 'your custom warning message';
$return['warning'] = $field;
}
return $return;
}
}
if ( ! function_exists( 'redux_my_custom_field' ) ) {
function redux_my_custom_field( $field, $value ) {
print_r( $field );
echo '<br/>';
print_r( $value );
}
}
if ( ! function_exists( 'dynamic_section' ) ) {
function dynamic_section( $sections ) {
$sections[] = array(
'title' => __( 'Section via hook' ,'dreamstour'),
'desc' => __( '<p class="description">This is a section created by adding a filter to the sections array. Can be used by child themes to add/remove sections from the options.</p>','dreamstour' ),
'icon' => 'el el-paper-clip',
'fields' => array()
);
return $sections;
}
}
if ( ! function_exists( 'change_arguments' ) ) {
function change_arguments( $args ) {
return $args;
}
}
if ( ! function_exists( 'change_defaults' ) ) {
function change_defaults( $defaults ) {
$defaults['str_replace'] = 'Testing filter hook!';
return $defaults;
}
}