barebones-config.php (11357B)
1 <?php 2 /** 3 * ReduxFramework Barebones Sample Config File 4 * For full documentation, please visit: http://devs.redux.io/ 5 * 6 * @package Redux Framework 7 */ 8 9 if ( ! class_exists( 'Redux' ) ) { 10 return null; 11 } 12 13 // This is your option name where all the Redux data is stored. 14 $opt_name = 'redux_demo'; 15 16 /** 17 * GLOBAL ARGUMENTS 18 * All the possible arguments for Redux. 19 * For full documentation on arguments, please refer to: @link https://github.com/ReduxFramework/ReduxFramework/wiki/Arguments 20 */ 21 22 /** 23 * ---> BEGIN ARGUMENTS 24 */ 25 26 $theme = wp_get_theme(); // For use with some settings. Not necessary. 27 28 $args = array( 29 // REQUIRED!! Change these values as you need/desire. 30 'opt_name' => $opt_name, 31 32 // Name that appears at the top of your panel. 33 'display_name' => $theme->get( 'Name' ), 34 35 // Version that appears at the top of your panel. 36 'display_version' => $theme->get( 'Version' ), 37 38 // Specify if the admin menu should appear or not. Options: menu or submenu (Under appearance only). 39 'menu_type' => 'menu', 40 41 // Show the sections below the admin menu item or not. 42 'allow_sub_menu' => true, 43 44 'menu_title' => esc_html__( 'Sample Options', 'your-textdomain-here' ), 45 'page_title' => esc_html__( 'Sample Options', 'your-textdomain-here' ), 46 47 // Disable this in case you want to create your own google fonts loader. 48 'disable_google_fonts_link' => false, 49 50 // Show the panel pages on the admin bar. 51 'admin_bar' => true, 52 53 // Choose an icon for the admin bar menu. 54 'admin_bar_icon' => 'dashicons-portfolio', 55 56 // Choose an priority for the admin bar menu. 57 'admin_bar_priority' => 50, 58 59 // Set a different name for your global variable other than the opt_name. 60 'global_variable' => '', 61 62 // Show the time the page took to load, etc. 63 'dev_mode' => true, 64 65 // Enable basic customizer support. 66 'customizer' => true, 67 68 // Order where the menu appears in the admin area. If there is any conflict, something will not show. Warning. 69 'page_priority' => null, 70 71 // For a full list of options, visit: @link http://codex.wordpress.org/Function_Reference/add_submenu_page#Parameters. 72 'page_parent' => 'themes.php', 73 74 // Permissions needed to access the options panel. 75 'page_permissions' => 'manage_options', 76 77 // Specify a custom URL to an icon. 78 'menu_icon' => '', 79 80 // Force your panel to always open to a specific tab (by id). 81 'last_tab' => '', 82 83 // Icon displayed in the admin panel next to your menu_title. 84 'page_icon' => 'icon-themes', 85 86 // Page slug used to denote the panel. 87 'page_slug' => '_options', 88 89 // On load save the defaults to DB before user clicks save or not. 90 'save_defaults' => true, 91 92 // If true, shows the default value next to each field that is not the default value. 93 'default_show' => false, 94 95 // What to print by the field's title if the value shown is default. Suggested: *. 96 'default_mark' => '', 97 98 // Shows the Import/Export panel when not used as a field. 99 'show_import_export' => true, 100 101 // CAREFUL -> These options are for advanced use only. 102 'transient_time' => 60 * MINUTE_IN_SECONDS, 103 104 // Global shut-off for dynamic CSS output by the framework. Will also disable google fonts output. 105 'output' => true, 106 107 // Allows dynamic CSS to be generated for customizer and google fonts, but stops the dynamic CSS from going to the head. 108 'output_tag' => true, 109 110 // FUTURE -> Not in use yet, but reserved or partially implemented. Use at your own risk. 111 // possible: options, theme_mods, theme_mods_expanded, transient. Not fully functional, warning! 112 'database' => '', 113 114 // 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. 115 'use_cdn' => true, 116 'compiler' => true, 117 118 // Enable or disable flyout menus when hovering over a menu with submenus. 119 'flyout_submenus' => true, 120 121 // Mode to display fonts (auto|block|swap|fallback|optional) 122 // See: https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display 123 'font_display' => 'swap', 124 125 // HINTS. 126 'hints' => array( 127 'icon' => 'el el-question-sign', 128 'icon_position' => 'right', 129 'icon_color' => 'lightgray', 130 'icon_size' => 'normal', 131 'tip_style' => array( 132 'color' => 'light', 133 'shadow' => true, 134 'rounded' => false, 135 'style' => '', 136 ), 137 'tip_position' => array( 138 'my' => 'top left', 139 'at' => 'bottom right', 140 ), 141 'tip_effect' => array( 142 'show' => array( 143 'effect' => 'slide', 144 'duration' => '500', 145 'event' => 'mouseover', 146 ), 147 'hide' => array( 148 'effect' => 'slide', 149 'duration' => '500', 150 'event' => 'click mouseleave', 151 ), 152 ), 153 ), 154 ); 155 156 // ADMIN BAR LINKS -> Setup custom links in the admin bar menu as external items. 157 $args['admin_bar_links'][] = array( 158 'id' => 'redux-docs', 159 'href' => '//devs.redux.io/', 160 'title' => esc_html__( 'Documentation', 'your-textdomain-here' ), 161 ); 162 163 $args['admin_bar_links'][] = array( 164 'id' => 'redux-support', 165 'href' => '//github.com/ReduxFramework/redux-framework/issues', 166 'title' => esc_html__( 'Support', 'your-textdomain-here' ), 167 ); 168 169 $args['admin_bar_links'][] = array( 170 'id' => 'redux-extensions', 171 'href' => 'redux.io/extensions', 172 'title' => esc_html__( 'Extensions', 'your-textdomain-here' ), 173 ); 174 175 // SOCIAL ICONS -> Setup custom links in the footer for quick links in your panel footer icons. 176 $args['share_icons'][] = array( 177 'url' => '//github.com/ReduxFramework/ReduxFramework', 178 'title' => 'Visit us on GitHub', 179 'icon' => 'el el-github', 180 ); 181 $args['share_icons'][] = array( 182 'url' => '//www.facebook.com/pages/Redux-Framework/243141545850368', 183 'title' => esc_html__( 'Like us on Facebook', 'your-textdomain-here' ), 184 'icon' => 'el el-facebook', 185 ); 186 $args['share_icons'][] = array( 187 'url' => '//twitter.com/reduxframework', 188 'title' => esc_html__( 'Follow us on Twitter', 'your-textdomain-here' ), 189 'icon' => 'el el-twitter', 190 ); 191 $args['share_icons'][] = array( 192 'url' => '//www.linkedin.com/company/redux-framework', 193 'title' => esc_html__( 'FInd us on LinkedIn', 'your-textdomain-here' ), 194 'icon' => 'el el-linkedin', 195 ); 196 197 // Panel Intro text -> before the form. 198 if ( ! isset( $args['global_variable'] ) || false !== $args['global_variable'] ) { 199 if ( ! empty( $args['global_variable'] ) ) { 200 $v = $args['global_variable']; 201 } else { 202 $v = str_replace( '-', '_', $args['opt_name'] ); 203 } 204 $args['intro_text'] = '<p>' . sprintf( __( 'Did you know that Redux sets a global variable for you? To access any of your saved options from within your code you can use your global variable: $s', 'your-textdomain-here' ) . '</p>', '<strong>' . $v . '</strong>' ); 205 } else { 206 $args['intro_text'] = '<p>' . esc_html__( 'This text is displayed above the options panel. It isn\'t required, but more info is always better! The intro_text field accepts all HTML.', 'your-textdomain-here' ) . '</p>'; 207 } 208 209 // Add content after the form. 210 $args['footer_text'] = '<p>' . esc_html__( 'This text is displayed below the options panel. It isn\'t required, but more info is always better! The footer_text field accepts all HTML.', 'your-textdomain-here' ) . '</p>'; 211 212 Redux::set_args( $opt_name, $args ); 213 214 /* 215 * ---> END ARGUMENTS 216 */ 217 218 /* 219 * ---> BEGIN HELP TABS 220 */ 221 222 $help_tabs = array( 223 array( 224 'id' => 'redux-help-tab-1', 225 'title' => esc_html__( 'Theme Information 1', 'your-textdomain-here' ), 226 'content' => '<p>' . esc_html__( 'This is the tab content, HTML is allowed.', 'your-textdomain-here' ) . '</p>', 227 ), 228 229 array( 230 'id' => 'redux-help-tab-2', 231 'title' => esc_html__( 'Theme Information 2', 'your-textdomain-here' ), 232 'content' => '<p>' . esc_html__( 'This is the tab content, HTML is allowed.', 'your-textdomain-here' ) . '</p>', 233 ), 234 ); 235 236 Redux::set_help_tab( $opt_name, $help_tabs ); 237 238 // Set the help sidebar. 239 $content = '<p>' . esc_html__( 'This is the sidebar content, HTML is allowed.', 'your-textdomain-here' ) . '</p>'; 240 Redux::set_help_sidebar( $opt_name, $content ); 241 242 /* 243 * <--- END HELP TABS 244 */ 245 246 /* 247 * 248 * ---> BEGIN SECTIONS 249 * 250 */ 251 252 /* As of Redux 3.5+, there is an extensive API. This API can be used in a mix/match mode allowing for. */ 253 254 /* -> START Basic Fields. */ 255 256 $kses_exceptions = array( 257 'a' => array( 258 'href' => array(), 259 ), 260 'strong' => array(), 261 'br' => array(), 262 ); 263 264 $section = array( 265 'title' => esc_html__( 'Basic Field', 'your-textdomain-here' ), 266 'id' => 'basic', 267 'desc' => esc_html__( 'Basic field with no subsections.', 'your-textdomain-here' ), 268 'icon' => 'el el-home', 269 'fields' => array( 270 array( 271 'id' => 'opt-text', 272 'type' => 'text', 273 'title' => esc_html__( 'Example Text', 'your-textdomain-here' ), 274 'desc' => esc_html__( 'Example description.', 'your-textdomain-here' ), 275 'subtitle' => esc_html__( 'Example subtitle.', 'your-textdomain-here' ), 276 'hint' => array( 277 'content' => wp_kses( __( 'This is a <strong>hint</strong> tool-tip for the text field.<br/><br/>Add any HTML based text you like here.', 'your-textdomain-here' ), $kses_exceptions ), 278 ), 279 ), 280 ), 281 ); 282 283 Redux::set_section( $opt_name, $section ); 284 285 $section = array( 286 'title' => __( 'Basic Fields', 'your-textdomain-here' ), 287 'id' => 'basic', 288 'desc' => __( 'Basic fields as subsections.', 'your-textdomain-here' ), 289 'icon' => 'el el-home', 290 ); 291 292 Redux::set_section( $opt_name, $section ); 293 294 $section = array( 295 'title' => esc_html__( 'Text', 'your-textdomain-here' ), 296 'desc' => esc_html__( 'For full documentation on this field, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/core-fields/text.html" target="_blank">https://devs.redux.io/core-fields/text.html</a>', 297 'id' => 'opt-text-subsection', 298 'subsection' => true, 299 'fields' => array( 300 array( 301 'id' => 'text-example', 302 'type' => 'text', 303 'title' => esc_html__( 'Text Field', 'your-textdomain-here' ), 304 'subtitle' => esc_html__( 'Subtitle', 'your-textdomain-here' ), 305 'desc' => esc_html__( 'Field Description', 'your-textdomain-here' ), 306 'default' => 'Default Text', 307 ), 308 ), 309 ); 310 311 Redux::set_section( $opt_name, $section ); 312 313 $section = array( 314 'title' => esc_html__( 'Text Area', 'your-textdomain-here' ), 315 'desc' => esc_html__( 'For full documentation on this field, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/core-fields/textarea.html" target="_blank">https://devs.redux.io/core-fields/textarea.html</a>', 316 'id' => 'opt-textarea-subsection', 317 'subsection' => true, 318 'fields' => array( 319 array( 320 'id' => 'textarea-example', 321 'type' => 'textarea', 322 'title' => esc_html__( 'Text Area Field', 'your-textdomain-here' ), 323 'subtitle' => esc_html__( 'Subtitle', 'your-textdomain-here' ), 324 'desc' => esc_html__( 'Field Description', 'your-textdomain-here' ), 325 'default' => 'Default Text', 326 ), 327 ), 328 ); 329 330 Redux::set_section( $opt_name, $section ); 331 332 /* 333 * <--- END SECTIONS 334 */