Used within different fields. Simply examples. Search for ACTUAL DECLARATION for field examples * */ $sampleHTML = ''; if ( file_exists( get_template_directory() . '/info-html.html' ) ) { Redux_Functions::initWpFilesystem(); global $wp_filesystem; $sampleHTML = $wp_filesystem->get_contents( get_template_directory() . '/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 ); } } } } /** * ---> SET ARGUMENTS * All the possible arguments for Redux. * For full documentation on arguments, please refer to: https://github.com/ReduxFramework/ReduxFramework/wiki/Arguments * */ $theme = wp_get_theme(); // For use with some settings. Not necessary. $args = array( // TYPICAL -> Change these values as you need/desire 'opt_name' => $opt_name, 'disable_tracking' => true, // This is where your data is stored in the database and also becomes your global variable name. 'display_name' => $theme->get( 'Name' ), // Name that appears at the top of your panel 'display_version' => $theme->get( 'Version' ), // Version that appears at the top of your panel 'menu_type' => 'menu', //Specify if the admin menu should appear or not. Options: menu or submenu (Under appearance only) 'allow_sub_menu' => true, // Show the sections below the admin menu item or not 'menu_title' => esc_html__( 'Ariana Options', 'ariana' ), 'page_title' => esc_html__( 'Ariana Options', 'ariana' ), // You will need to generate a Google API key to use this feature. // Please visit: https://developers.google.com/fonts/docs/developer_api#Auth 'google_api_key' => '', // Set it you want google fonts to update weekly. A google_api_key value is required. 'google_update_weekly' => false, // Must be defined to add google fonts to the typography module 'async_typography' => true, // Use a asynchronous font on the front end or font string //'disable_google_fonts_link' => true, // Disable this in case you want to create your own google fonts loader 'admin_bar' => true, // Show the panel pages on the admin bar 'admin_bar_icon' => 'dashicons-portfolio', // Choose an icon for the admin bar menu 'admin_bar_priority' => 50, // Choose an priority for the admin bar menu 'global_variable' => '', // Set a different name for your global variable other than the opt_name 'dev_mode' => false, // Show the time the page took to load, etc 'update_notice' => false, // If dev_mode is enabled, will notify developer of updated versions available in the GitHub Repo 'customizer' => false, // Enable basic customizer support //'open_expanded' => true, // Allow you to start the panel in an expanded way initially. //'disable_save_warn' => true, // Disable the save warning when a user changes a field // OPTIONAL -> Give you extra features 'page_priority' => 3, // Order where the menu appears in the admin area. If there is any conflict, something will not show. Warning. 'page_parent' => 'themes.php', // For a full list of options, visit: http://codex.wordpress.org/Function_Reference/add_submenu_page#Parameters 'page_permissions' => 'manage_options', // Permissions needed to access the options panel. 'menu_icon' => '', // Specify a custom URL to an icon 'last_tab' => '', // Force your panel to always open to a specific tab (by id) 'page_icon' => 'icon-themes', // Icon displayed in the admin panel next to your menu_title 'page_slug' => '', // Page slug used to denote the panel, will be based off page title then menu title then opt_name if not provided 'save_defaults' => true, // On load save the defaults to DB before user clicks save or not 'default_show' => false, // If true, shows the default value next to each field that is not the default value. 'default_mark' => '', // What to print by the field's title if the value shown is default. Suggested: * 'show_import_export' => true, // Shows the Import/Export panel when not used as a field. // CAREFUL -> These options are for advanced use only 'transient_time' => 60 * MINUTE_IN_SECONDS, 'output' => true, // Global shut-off for dynamic CSS output by the framework. Will also disable google fonts output 'output_tag' => true, // Allows dynamic CSS to be generated for customizer and google fonts, but stops the dynamic CSS from going to the head // 'footer_credit' => '', // Disable the footer credit of Redux. Please leave if you can help it. // FUTURE -> Not in use yet, but reserved or partially implemented. Use at your own risk. 'database' => '', // possible: options, theme_mods, theme_mods_expanded, transient. Not fully functional, warning! 'use_cdn' => true, // If you prefer not to use the CDN for Select2, Ace Editor, and others, you may download the Redux Vendor Support plugin yourself and run locally or embed it in your code. ); // Panel Intro text -> before the form if ( ! isset( $args['global_variable'] ) || $args['global_variable'] !== false ) { if ( ! empty( $args['global_variable'] ) ) { $v = $args['global_variable']; } else { $v = str_replace( '-', '_', $args['opt_name'] ); } $args['intro_text'] = sprintf( esc_html__( '', 'ariana' ), $v ); } else { $args['intro_text'] = esc_html__( '', 'ariana' ); } // Add content after the form. $args['footer_text'] = esc_html__( '', 'ariana' ); Redux::setArgs( $opt_name, $args ); /* * ---> END ARGUMENTS */ /* * ---> START HELP TABS */ $tabs = array( array( 'id' => 'redux-help-tab-1', 'title' => esc_html__( 'Theme Information 1', 'ariana' ), 'content' => esc_html__( '
This is the tab content, HTML is allowed.
', 'ariana' ) ), array( 'id' => 'redux-help-tab-2', 'title' => esc_html__( 'Theme Information 2', 'ariana' ), 'content' => esc_html__( 'This is the tab content, HTML is allowed.
', 'ariana' ) ) ); Redux::setHelpTab( $opt_name, $tabs ); // Set the help sidebar $content = esc_html__( 'This is the sidebar content, HTML is allowed.
', 'ariana' ); Redux::setHelpSidebar( $opt_name, $content ); /* * <--- END HELP TABS */ /* * * ---> START SECTIONS * */ /* As of Redux 3.5+, there is an extensive API. This API can be used in a mix/match mode allowing for */ // -> START Basic Fields Redux::setSection( $opt_name, array( 'title' => esc_html__( 'General Settings', 'ariana' ), 'desc' => esc_html__( '', 'ariana' ), 'icon' => 'el el-cog', 'fields' => array( array( 'id' => 'ariana_home_logo', 'type' => 'media', 'compiler' => true, 'title' => esc_html__('Logo Upload', 'ariana'), 'subtitle' => esc_html__('upload your logo', 'ariana'), 'default' => array( 'url'=> get_template_directory_uri().'/assets/img//logo.png' ), ), array( 'id' => 'ariana_home_banner_img', 'type' => 'media', 'compiler' => true, 'title' => esc_html__('Main Banner Image', 'ariana'), 'subtitle' => esc_html__('upload banner image here', 'ariana'), 'default' => array( 'url'=> get_template_directory_uri().'/assets/img/bg/section-bg.jpg' ), ), array( 'id' => 'ariana_menu_text_color', 'type' => 'color', 'title' => esc_html__('Menu Text Color', 'ariana'), 'subtitle' => esc_html__('Choice color here', 'ariana'), 'default' => '' ), array( 'id' => 'ariana_menu_text_hover_acive_color', 'type' => 'color', 'title' => esc_html__('Menu Text Hover / Active Color', 'ariana'), 'subtitle' => esc_html__('Choice color here', 'ariana'), 'default' => '' ), array( 'id' => 'ariana_sticky_menu_bg_color', 'type' => 'color', 'title' => esc_html__('Sticky Menu Backgrund Color', 'ariana'), 'subtitle' => esc_html__('Please use color ', 'ariana'), 'default' => '' ), array( 'id' => 'ariana_sticky_menu_text_color', 'type' => 'color', 'title' => esc_html__('Sticky Menu Backgrund Color', 'ariana'), 'subtitle' => esc_html__('Please use color ', 'ariana'), 'default' => '' ), ) ) ); Redux::setSection( $opt_name, array( 'title' => esc_html__( 'Footer Settings', 'ariana' ), 'id' => 'ariana-foooter-setting', 'icon' => 'el el-stop-alt', 'customizer_width' => '400px', 'fields' => array( array( 'id' => 'ariana_footer_bg_color', 'type' => 'color', 'title' => esc_html__('Footer Backgrund Color', 'ariana'), 'subtitle' => esc_html__('Please use color ', 'ariana'), 'default' => '' ), array( 'id' => 'ariana_footer_text_color', 'type' => 'color', 'title' => esc_html__('footer Text Color', 'ariana'), 'subtitle' => esc_html__('Please use color ', 'ariana'), 'default' => '' ), array( 'id' => 'ariana_footer_link_color', 'type' => 'color', 'title' => esc_html__('footer Text Color', 'ariana'), 'subtitle' => esc_html__('Please use color ', 'ariana'), 'default' => '' ), array( 'id' => 'ariana_copywrite_text', 'type' => 'editor', 'title' => esc_html__('CopyWrite Text', 'ariana'), 'subtitle' => esc_html__('Write Copywrite text here.', 'ariana'), 'default' => 'Copyright © 2016 Ariana | All Rights Reserved | Designed By Themes_Mountain
', 'args' => array( 'teeny' => true, 'textarea_rows' => 4 ) ), array( 'id' => 'ariana_ft_social_icon', 'type' => 'text', 'title' => esc_html__('First social Icon', 'ariana'), 'subtitle' => esc_html__('enter social icon here.', 'ariana'), 'default' => 'fa-facebook', ), array( 'id' => 'ariana_ft_social_url', 'type' => 'text', 'title' => esc_html__('First social Url', 'ariana'), 'subtitle' => esc_html__('enter social url here.', 'ariana'), 'default' => '#', ), array( 'id' => 'ariana_ft_social_bg_color', 'type' => 'color', 'title' => esc_html__('First social Hover Background Color', 'ariana'), 'subtitle' => esc_html__('choice color here.', 'ariana'), 'default' => '', ), array( 'id' => 'ariana_sec_social_icon', 'type' => 'text', 'title' => esc_html__('Second social Icon', 'ariana'), 'subtitle' => esc_html__('enter social icon here.', 'ariana'), 'default' => 'fa-twitter', ), array( 'id' => 'ariana_sec_social_url', 'type' => 'text', 'title' => esc_html__('Second Social Url', 'ariana'), 'subtitle' => esc_html__('enter social url here.', 'ariana'), 'default' => '#', ), array( 'id' => 'ariana_sec_social_bg_color', 'type' => 'color', 'title' => esc_html__('Second Social Hover Background Color', 'ariana'), 'subtitle' => esc_html__('choice color here.', 'ariana'), 'default' => '', ), array( 'id' => 'ariana_third_social_icon', 'type' => 'text', 'title' => esc_html__('Third Social Icon', 'ariana'), 'subtitle' => esc_html__('enter social icon here.', 'ariana'), 'default' => 'fa-google-plus', ), array( 'id' => 'ariana_third_social_url', 'type' => 'text', 'title' => esc_html__('Third Social Url', 'ariana'), 'subtitle' => esc_html__('enter social url here.', 'ariana'), 'default' => '#', ), array( 'id' => 'ariana_third_social_bg_color', 'type' => 'color', 'title' => esc_html__('Third Social Hover Background Color', 'ariana'), 'subtitle' => esc_html__('choice color here.', 'ariana'), 'default' => '', ), array( 'id' => 'ariana_4th_social_icon', 'type' => 'text', 'title' => esc_html__('Fourth Social Icon', 'ariana'), 'subtitle' => esc_html__('enter social icon here.', 'ariana'), 'default' => 'fa-linkedin', ), array( 'id' => 'ariana_4th_social_url', 'type' => 'text', 'title' => esc_html__('Fourth Social Url', 'ariana'), 'subtitle' => esc_html__('enter social url here.', 'ariana'), 'default' => '#', ), array( 'id' => 'ariana_4thsocial_bg_color', 'type' => 'color', 'title' => esc_html__('Fourth Social Hover Background Color', 'ariana'), 'subtitle' => esc_html__('choice color here.', 'ariana'), 'default' => '', ), array( 'id' => 'ariana_5th_social_icon', 'type' => 'text', 'title' => esc_html__('Fifth Social Icon', 'ariana'), 'subtitle' => esc_html__('enter social icon here.', 'ariana'), 'default' => 'fa-youtube', ), array( 'id' => 'ariana_5th_social_url', 'type' => 'text', 'title' => esc_html__('Fifth Social Url', 'ariana'), 'subtitle' => esc_html__('enter social url here.', 'ariana'), 'default' => '#', ), array( 'id' => 'ariana_5th_social_bg_color', 'type' => 'color', 'title' => esc_html__('Fifth Social Hover Background Color', 'ariana'), 'subtitle' => esc_html__('choice color here.', 'ariana'), 'default' => '', ), array( 'id' => 'ariana_6th_social_icon', 'type' => 'text', 'title' => esc_html__('Sixth Social Icon', 'ariana'), 'subtitle' => esc_html__('enter social icon here.', 'ariana'), 'default' => 'fa-pinterest', ), array( 'id' => 'ariana_6th_social_url', 'type' => 'text', 'title' => esc_html__('Sixth Social Url', 'ariana'), 'subtitle' => esc_html__('enter social url here.', 'ariana'), 'default' => '#', ), array( 'id' => 'ariana_6th_social_bg_color', 'type' => 'color', 'title' => esc_html__('Sixth Social Hover Background Color', 'ariana'), 'subtitle' => esc_html__('choice color here.', 'ariana'), 'default' => '', ), ) ) ); Redux::setSection( $opt_name, array( 'title' => esc_html__( 'Advance Settings', 'ariana' ), 'id' => 'ariana-advance-setting', 'customizer_width' => '400px', 'fields' => array( array( 'id' => 'ariana_theme_color', 'type' => 'color', 'title' => esc_html__('Theme Color', 'ariana'), 'subtitle' => esc_html__('choice color here.', 'ariana'), 'default' => '', ), array( 'id' => 'ariana_theme_hover_color', 'type' => 'color', 'title' => esc_html__('Theme Hover Color', 'ariana'), 'subtitle' => esc_html__('choice color here.', 'ariana'), 'default' => '', ), array( 'id' => 'ariana_preloader_opt', 'type' => 'switch', 'title' => esc_html__('Display Preloader', 'ariana'), 'subtitle' => esc_html__('If yes then click the checkbox.', 'ariana'), 'default' => '1'// 1 = on | 0 = off ), array( 'id' => 'ariana_homepage_opt', 'type' => 'checkbox', 'title' => esc_html__('Only Enable Home Page', 'ariana'), 'default' => '0', 'subtitle' => esc_html__('if check this option preloader only will be enable for home page', 'ariana'), 'required' => array( 'ariana_preloader_opt', '=', '1' ), ), array( 'id' => 'ariana_preloader_text', 'type' => 'text', 'title' => esc_html__('Preloader Text', 'ariana'), 'default' => 'Ariana', 'subtitle' => esc_html__('write preloader text here', 'ariana'), 'required' => array( 'ariana_preloader_opt', '=', '1' ), ), array( 'id' => 'ariana_preloader_bg_color', 'type' => 'color', 'title' => esc_html__('Preloader Background Color', 'ariana'), 'default' => '#fff', 'subtitle' => esc_html__('choice color here', 'ariana'), 'required' => array( 'ariana_preloader_opt', '=', '1' ), ), array( 'id' => 'ariana_preloader_imge', 'type' => 'media', 'title' => esc_html__('Preloader Background Color', 'ariana'), 'default' => array( 'url' => get_template_directory_uri(). '/assets/img/status.gif' ), 'subtitle' => esc_html__('upload preloader image here', 'ariana'), 'required' => array( 'ariana_preloader_opt', '=', '1' ), ), array( 'id' => 'ariana_css_editor', 'type' => 'ace_editor', 'title' => esc_html__('Custom CSS', 'ariana'), 'subtitle' => esc_html__('Write your CSS code here.', 'ariana'), 'mode' => 'css', 'theme' => 'monokai', ), ) ) ); Redux::setSection( $opt_name, array( 'icon' => 'el el-list-alt', 'title' => esc_html__( 'Customizer Only', 'ariana' ), 'desc' => esc_html__( 'This Section should be visible only in Customizer
', 'ariana' ), 'customizer_only' => true, 'fields' => array( array( 'id' => 'opt-customizer-only', 'type' => 'select', 'title' => esc_html__( 'Customizer Only Option', 'ariana' ), 'subtitle' => esc_html__( 'The subtitle is NOT visible in customizer', 'ariana' ), 'desc' => esc_html__( 'The field desc is NOT visible in customizer.', 'ariana' ), 'customizer_only' => true, //Must provide key => value pairs for select options 'options' => array( '1' => esc_html__('Opt 1' , 'ariana'), '2' => esc_html__('Opt 2' , 'ariana'), '3' => esc_html__('Opt 3' , 'ariana') ), 'default' => '2' ), ) ) ); if ( file_exists( get_template_directory() . '/../README.md' ) ) { $section = array( 'icon' => 'el el-list-alt', 'title' => esc_html__( 'Documentation', 'ariana' ), 'fields' => array( array( 'id' => '17', 'type' => 'raw', 'markdown' => true, 'content_path' => get_template_directory() . '/../README.md', // FULL PATH, not relative please //'content' => 'Raw content here', ), ), ); Redux::setSection( $opt_name, $section ); } /* * <--- END SECTIONS */