### Example Config: Indented Options Section Source: https://devs.redux.io/core-fields/section.html This example demonstrates how to begin and end an indented section. Fields placed between the 'section-start' and 'section-end' will be indented. Always use 'indent' => true for the start and 'indent' => false for the end. ```php // Begin the section Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'id' => 'section-start', 'type' => 'section', 'title' => esc_html__('Indented Options', 'your-textdomain-here'), 'subtitle' => esc_html__('With the "section" field you can create indent option sections.', 'your-textdomain-here'), 'indent' => true ); // Other field arrays go between the start and end fields. Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'id' => 'text-field-in-section-id', 'type' => 'text', 'title' => esc_html__( 'Indented text field', 'your-textdomain-here' ) ) ); // End the section Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'id' => 'section-end', 'type' => 'section', 'indent' => false, ) ); ``` -------------------------------- ### Basic Media Field Setup Source: https://devs.redux.io/core-fields/media.html This snippet shows the basic setup for a media field. Ensure 'OPT_NAME' and 'SECTION_ID' are correctly defined for your configuration. ```php Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'type' => 'media' ) ); ``` -------------------------------- ### Redux Taxonomy Configuration Example Source: https://devs.redux.io/core-extensions/taxonomy.html This example demonstrates how to set up a taxonomy with Redux Framework, including defining term boxes, sections, and fields. Ensure an options page is configured for this to function correctly. ```php Redux_Taxonomy::set_term( $opt_name, array( 'id' => 'demo-taxonomy', 'title' => esc_html__( 'Cool Options', 'your-textdomain-here' ), 'taxonomy_types' => array( 'category', 'post_tag' ), 'sidebar' => false, 'style' => 'wp', //'add_visibility' => true, // Can bet set on term, section, or field level. Denotes what fields are displayed on the add {TERM} pages. 'sections' => array( array( 'title' => esc_html__( 'Home Settings', 'your-textdomain-here' ), 'icon' => 'el-icon-home', 'fields' => array( array( 'id' => 'tax-text-1', 'type' => 'text', 'add_visibility' => true, 'title' => esc_html__( 'Test Input', 'your-textdomain-here' ), ), array( 'id' => 'tax-text-2', 'type' => 'text', 'title' => esc_html__( 'Test Input2', 'your-textdomain-here' ), ), ) ), array( 'title' => esc_html__( 'Home Layout', 'your-textdomain-here' ), 'desc' => esc_html__( 'Redux Framework was created with the developer in mind. It allows for any theme developer to have an advanced theme panel with most of the features a developer would need. For more information check out the GitHub repo at: https://github.com/ReduxFramework/Redux-Framework', 'your-textdomain-here' ), 'icon' => 'el-icon-home', 'fields' => array( array( 'id' => 'tax-homepage_blocks', 'type' => 'sorter', 'title' => 'Homepage Layout Manager', 'desc' => 'Organize how you want the layout to appear on the homepage', 'compiler' => 'true', 'add_visibility' => true, 'required' => array( 'layout', '=', '1' ), 'options' => array( 'enabled' => array( 'highlights' => 'Highlights', 'slider' => 'Slider', 'staticpage' => 'Static Page', ), 'disabled' => array( 'services' => 'Services' ), ), ), ), ) ) ) ); ``` -------------------------------- ### Basic Link Color Field Setup Source: https://devs.redux.io/core-fields/link-color.html This snippet demonstrates the basic setup for a link color field. It initializes the field with the type 'link_color'. ```php Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'type' => 'link-color' ) ); ``` -------------------------------- ### Basic Color Gradient Field Setup Source: https://devs.redux.io/core-fields/color-gradient.html This snippet shows the most basic setup for a color gradient field. Ensure 'OPT_NAME' and 'SECTION_ID' are replaced with your specific configuration values. ```php Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'type' => 'color_gradient' ) ); ``` -------------------------------- ### Basic Accordion Field Configuration Source: https://devs.redux.io/core-extensions/accordion.html This example demonstrates how to configure a basic accordion field, including its start and end points, and nesting other field types within it. Ensure each accordion block has a 'start' and 'end' positioned field. ```php Redux::set_section( 'OPT_NAME', array( 'title' => esc_html__( 'Accordion Field', 'your-textdomain-here' ), 'icon' => 'el-icon-thumbs-up', 'fields' => array( array( 'id' => 'opt-accordion-begin-1', 'type' => 'accordion', 'title' => 'Accordion Section One', 'subtitle' => 'Section one with subtitle', 'position' => 'start', ), array( 'id' => 'opt-blank-text-1', 'type' => 'text', 'title' => 'Textbox for some noble purpose.', 'subtitle' => 'Frailty, thy name is woman!' ), array( 'id' => 'opt-blank-text-2', 'type' => 'switch', 'title' => 'Switch, for some other important task!', 'subtitle' => 'Physician, heal thyself!' ), array( 'id' => 'opt-accordion-end-1', 'type' => 'accordion', 'position' => 'end' ), // Second Accordion array( 'id' => 'opt-accordion-begin-2', 'type' => 'accordion', 'title' => 'Accordion Section Two (no subtitle)', 'position' => 'start', ), array( 'id' => 'opt-blank-text-3', 'type' => 'text', 'title' => 'Look, another sample textbox.', 'subtitle' => 'The tartness of his face sours ripe grapes.' ), array( 'id' => 'opt-blank-text-4', 'type' => 'switch', 'title' => 'Yes, another switch, but you\'re free to use any field you like.', 'subtitle' => 'I scorn you, scurvy companion!' ), array( 'id' => 'opt-accordion-end-2', 'type' => 'accordion', 'position' => 'end' ), ), ) ); ``` -------------------------------- ### Example Usage of Select Fields Source: https://devs.redux.io/core-fields/select.html Demonstrates how to retrieve and display values from both single and multi-select fields in your theme or plugin. ```php global $redux_demo; echo 'Single Select value: ' . $redux_demo['opt-select']; echo 'Multi Select value: ' . $redux_demo['opt-multi-select'][0]; echo 'Multi Select value: ' . $redux_demo['opt-multi-select'][1]; ``` -------------------------------- ### Basic Info Field Setup Source: https://devs.redux.io/core-fields/info.html This snippet shows the most basic configuration for an Info field, setting its type to 'info'. ```php Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'type' => 'info' ) ); ``` -------------------------------- ### Install Redux Master Branch with Composer Source: https://devs.redux.io/guides/basics/install.html Install the latest development version from the master branch using Composer. Be aware of potential bugs. ```json { "require": { "redux-framework/redux-framework": "dev-master" } } ``` -------------------------------- ### Basic Image Select Field Setup Source: https://devs.redux.io/core-fields/image-select.html This snippet demonstrates the basic setup for an image select field. Ensure 'OPT_NAME' and 'SECTION_ID' are correctly defined in your Redux configuration. ```php Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'type' => 'image-select' ) ); ``` -------------------------------- ### Basic Color RGBA Field Setup Source: https://devs.redux.io/core-fields/color-rgba.html This snippet demonstrates the basic setup for a Color RGBA field. Ensure 'OPT_NAME' and 'SECTION_ID' are replaced with your specific field and section identifiers. ```php Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'type' => 'color_rgba' ) ); ``` -------------------------------- ### Basic Checkbox Field Setup Source: https://devs.redux.io/core-fields/checkbox.html This snippet shows the fundamental setup for a checkbox field. It defines the field type and associates it with an option name and section ID. ```php Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'type' => 'checkbox' ) ); ``` -------------------------------- ### Example CSS Declaration Source: https://devs.redux.io/core-extensions/color-schemes.html This is an example of a CSS file declaration that corresponds to the color selectors defined in the color scheme. ```css body { color: #fdfdfd; background-color: #ededed; } ``` -------------------------------- ### Basic Editor Field Setup Source: https://devs.redux.io/core-fields/editor.html Sets up a basic Editor field. The 'type' argument is essential for identifying the field as an editor. ```php Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'type' => 'editor' ) ); ``` -------------------------------- ### Configure Multi Media Field Source: https://devs.redux.io/core-extensions/multi-media.html Example configuration for the multi_media field, setting a maximum of 5 files. Ensure 'opt_name' is replaced with your actual option name. ```php Redux::set_section( $opt_name, array( 'title' => esc_html__( 'Multi Media', 'your-textdomain-here' ), 'desc' => esc_html__( 'For full documentation on this field, visit: ', 'your-textdomain-here' ) . 'https://devs.redux.io/core-extensions/multi-media.html', 'subsection' => true, 'fields' => array( array( 'id' => 'opt-multi-media', 'type' => 'multi_media', 'title' => esc_html__( 'Multi Media Selector', 'your-textdomain-here' ), 'subtitle' => esc_html__( 'Alternative media field which allows for multi selections', 'your-textdomain-here' ), 'desc' => esc_html__( 'max_file_limit has been set to 5.', 'your-textdomain-here' ), 'max_file_upload' => 5, ), ), ) ); ``` -------------------------------- ### Get Redux Instance Source: https://devs.redux.io/guides/advanced/wp-filesystem-proxy.html Before using the filesystem proxy, you need to obtain the Redux object. Replace 'OPT_NAME' with your actual opt_name. ```APIDOC ## Get Redux Instance To access the filesystem proxy, first retrieve the Redux instance. ### Method ```php Redux::get_instance( 'OPT_NAME' ); ``` ### Parameters * **OPT_NAME** (string) - Required - Your Redux framework option name. ``` -------------------------------- ### Install Redux Stable Release with Composer Source: https://devs.redux.io/guides/basics/install.html Install pre-release versions of Redux that are considered stable but not yet fully community-tested. ```json { "require": { "redux-framework/redux-framework": "*" } } ``` -------------------------------- ### Basic Button Set Field Setup Source: https://devs.redux.io/core-fields/button-set.html This snippet shows the basic configuration for a button set field. Ensure 'OPT_NAME' and 'SECTION_ID' are correctly defined for your project. ```php Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'type' => 'button_set' ) ); ``` -------------------------------- ### Basic Dimension Field Setup Source: https://devs.redux.io/core-fields/dimensions.html Sets up a basic dimension field with default settings. Use this when you need a simple width and height input. ```php Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'type' => 'dimension' ) ); ``` -------------------------------- ### Basic Sortable Field Setup Source: https://devs.redux.io/core-fields/sortable.html This snippet shows the minimal configuration to set up a sortable field. Ensure 'OPT_NAME' and 'SECTION_ID' are replaced with your specific values. ```php Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'type' => 'sortable' ) ); ``` -------------------------------- ### Basic Slider Field Setup Source: https://devs.redux.io/core-fields/slider.html This snippet demonstrates the basic setup for a Redux Slider Field. Ensure 'OPT_NAME' and 'SECTION_ID' are correctly defined for your Redux framework instance. ```php Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'type' => 'slider' ) ); ``` -------------------------------- ### object - Get Filesystem Object Source: https://devs.redux.io/guides/advanced/wp-filesystem-proxy.html Returns the underlying WordPress FileSystem API object. ```APIDOC ## object - Get Filesystem Object Retrieves the WordPress FileSystem API object, allowing direct interaction with WordPress's filesystem functions. ### Method ```php $redux->filesystem->execute( 'object' ); ``` ### Example ```php $redux = Redux::get_instance('OPT_NAME'); // TODO - Use your opt_name $object = $redux->filesystem->execute( 'object' ); ``` ``` -------------------------------- ### Configure Color Palette Field - PHP Source: https://devs.redux.io/core-fields/color-palette.html Example configuration for a Color Palette field, demonstrating custom colors, round style, and output targeting. ```php Redux::set_section( $opt_name, array( 'title' => esc_html__( 'Color Palette', 'your-textdomain-here' ), 'desc' => esc_html__( 'For full documentation on this field, visit: ', 'your-textdomain-here' ) . 'https://devs.redux.io/core-fields/palette-color.html', 'id' => 'color-palette', 'subsection' => true, 'fields' => array( array( 'id' => 'opt-color-palette-grey', 'type' => 'color_palette', 'title' => esc_html__( 'Color Palette Control', 'your-textdomain-here' ), 'subtitle' => esc_html__( 'User defined colors with round selectors.', 'your-textdomain-here' ), 'desc' => esc_html__( 'Set the Widget Title color here.', 'your-textdomain-here' ), 'default' => '#888888', 'options' => array( 'colors' => array( '#000000', '#222222', '#444444', '#666666', '#888888', '#aaaaaa', '#cccccc', '#eeeeee', '#ffffff', ), 'style' => 'round', ), 'output' => array( 'color' => '.widget-title', 'important' => true, ), ), array( 'id' => 'opt-color-palette-mui-all', 'type' => 'color_palette', 'title' => esc_html__( 'Color Palette Control', 'your-textdomain-here' ), 'subtitle' => esc_html__( 'All Material Design Colors.', 'your-textdomain-here' ), 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), 'default' => '#F44336', 'options' => array( 'colors' => Redux_Helpers::get_material_design_colors( 'all' ), 'size' => 17, ), ), ) ) ); ``` -------------------------------- ### Configuring a Color Field with Options Source: https://devs.redux.io/core-fields/color.html This example demonstrates a fully configured Color field with ID, title, subtitle, default value, and validation. The 'validate' argument should be set to 'color'. ```php Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'id' => 'opt-color', 'type' => 'color', 'title' => esc_html__('Body Background Color', 'your-textdomain-here'), 'subtitle' => esc_html__('Pick a background color for the theme (default: #fff).', 'your-textdomain-here'), 'default' => '#FFFFFF', 'validate' => 'color', ) ); ``` -------------------------------- ### Get Redux Instance Source: https://devs.redux.io/guides/advanced/wp-filesystem-proxy.html Obtain the Redux object instance to access its filesystem methods. Replace 'OPT_NAME' with your actual Redux option name. ```php $redux = Redux::get_instance('OPT_NAME'); // TODO - Use your opt_name ``` -------------------------------- ### Install Redux using WP Packagist with Composer Source: https://devs.redux.io/guides/basics/install.html Use this Composer configuration for the most stable Redux releases, sourced from WordPress.org. ```json { "repositories": [ { "type": "composer", "url": "https://wpackagist.org" } ], "require": { "wpackagist-plugin/redux-framework": "*" } } ``` -------------------------------- ### Configuring a Switch Field with Options Source: https://devs.redux.io/core-fields/switch.html This example demonstrates how to configure a Switch field with a custom ID, title, subtitle, and a default value. The 'default' argument sets the initial state of the switch. ```php Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'id' => 'opt-switch', 'type' => 'switch', 'title' => esc_html__( 'Switch On', 'your-textdomain-here' ), 'subtitle' => esc_html__( 'Look, it\'s on!', 'your-textdomain-here' ), 'default' => true, ) ); ``` -------------------------------- ### Display Shortcode Output with do_shortcode Source: https://devs.redux.io/core-extensions/shortcodes.html Always use the `do_shortcode` function to ensure shortcode output is displayed properly. This example shows how to output a copyright notice with the current year. ```php echo do_shortcode( '©' . [date data="Y"] . 'Company name | All Rights Reserved.' ); ``` -------------------------------- ### Redux Repository or Composer File Structure Source: https://devs.redux.io/guides/basics/install.html This shows the file structure when Redux is downloaded as a full repository or installed via Composer. ```bash redux-framework/ ├── .github/ ├── codestyles/ ├── redux-core/ ├── sample/ ├── sample-config.php ├── barebones-config.php ``` -------------------------------- ### Configuring a Background Field with Defaults Source: https://devs.redux.io/core-fields/background.html This example demonstrates how to configure a background field with a title, subtitle, description, and a default background color. The 'id' should be unique for each field. ```php Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'id' => 'opt-background', 'type' => 'background', 'title' => esc_html__('Body Background', 'your-project-name'), 'subtitle' => esc_html__('Body background with image, color, etc.', 'your-project-name'), 'desc' => esc_html__('This is the description field, again good for additional info.', 'your-project-name'), 'default' => array( 'background-color' => '#1e73be', ) ) ); ``` -------------------------------- ### Basic Select Field Configuration Source: https://devs.redux.io/core-fields/select-image.html This snippet shows the basic configuration for a select field. Use this as a starting point for more complex select field types. ```php Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'type' => 'select' ) ); ``` -------------------------------- ### Basic Background Field Setup Source: https://devs.redux.io/core-fields/background.html This snippet shows the most basic way to declare a background field. Ensure 'OPT_NAME' and 'SECTION_ID' are correctly defined in your Redux configuration. ```php Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'type' => 'background' ) ); ``` -------------------------------- ### Spinner Field with Validation and Output Source: https://devs.redux.io/core-fields/spinner.html This example demonstrates a fully configured spinner field with validation (min, max, step) and output settings. The 'default' value is set to '40'. ```php Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'id' => 'opt-spinner', 'type' => 'spinner', 'title' => esc_html__('JQuery UI Spinner Example 1', 'your-textdomain-here'), 'subtitle' => esc_html__('No validation can be done on this field type','your-textdomain-here'), 'desc' => esc_html__('JQuery UI spinner description. Min:20, max: 100, step:20, default value: 40', 'your-textdomain-here'), 'default' => '40', 'min' => '20', 'step' => '20', 'max' => '100', 'output' => array( '.content-area' => 'max-width' ), ) ); ``` -------------------------------- ### Example JavaScript File Source: https://devs.redux.io/core-extensions/js-button.html Provides two JavaScript functions: `redux_add_date` to insert the current date into a text field and `redux_show_alert` to display an alert message. The `redux_add_date` function utilizes jQuery to interact with the DOM. ```javascript // Function to execute when the Add Date button is clicked. function redux_add_date() { (function($){ 'use strict'; $(document).ready(function(){ var date = new Date(); var text = $('#opt-blank-text'); text.val(date.toString()); }); })(jQuery) }; // Function to execute when the Alert button is clicked. function redux_show_alert() { alert ('You clicked the Alert button!'); }; ``` -------------------------------- ### Advanced Date Field Configuration Source: https://devs.redux.io/core-fields/date.html This example demonstrates a more detailed configuration for the Date field, including ID, title, subtitle, description, and placeholder text. The 'subtitle' notes that no validation is performed on this field type. ```php Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'id' => 'opt-date', 'type' => 'date', 'title' => esc_html__('Date Option', 'your-textdomain-here'), 'subtitle' => esc_html__('No validation can be done on this field type', 'your-textdomain-here'), 'desc' => esc_html__('This is the description field, again good for additional info.', 'your-textdomain-here'), 'placeholder' => 'Click to enter a date' ) ); ``` -------------------------------- ### Using the Slides Field Data Source: https://devs.redux.io/core-fields/slides.html This example demonstrates how to access and display data from a configured slides field. It includes checks for the existence and non-emptiness of the slides data, as Redux does not save blank slides. ```php global $redux_demo; if ( isset( $redux_demo['opt-slides'] ) && !empty( $redux_demo['opt-slides'] ) ) { echo 'Slide 1 Title: ' . $redux_demo['opt-slides'][0]['title']; echo 'Slide 1 Description: ' . $redux_demo['opt-slides'][0]['description']; echo 'Slide 1 URL: ' . $redux_demo['opt-slides'][0]['url']; echo 'Slide 1 Attachment ID: ' . $redux_demo['opt-slides'][0]['attachment_id']; echo 'Slide 1 Thumb: ' . $redux_demo['opt-slides'][0]['thumb']; echo 'Slide 1 Image: ' . $redux_demo['opt-slides'][0]['image']; echo 'Slide 1 Width: ' . $redux_demo['opt-slides'][0]['width']; echo 'Slide 1 Height: ' . $redux_demo['opt-slides'][0]['height']; } ``` -------------------------------- ### Get Allowed MIME Types in WordPress Source: https://devs.redux.io/core-fields/media.html Display all currently allowed MIME types and their associated file extensions in your WordPress installation. This helps in understanding existing upload restrictions. ```php print_r( get_allowed_mime_types() ); ``` -------------------------------- ### Create Directory with mkdir Source: https://devs.redux.io/guides/advanced/wp-filesystem-proxy.html Create a directory using the 'mkdir' filesystem action. This will create parent directories if they do not exist. Ensure the path is correctly defined and check if the directory already exists before attempting creation. ```php $redux = Redux::get_instance( 'OPT_NAME' ); // TODO - Use your opt_name $path = "THE_PATH"; // TODO - Replace with path if ( ! is_dir( $path ) ) { $redux->filesystem->execute( "mkdir", $path ); } ``` -------------------------------- ### Example Custom Validation Function Source: https://devs.redux.io/configuration/fields/validate.html This is an example of a custom validation function that checks for specific values and returns errors or warnings. ```php if ( ! function_exists( 'test_custom_callback' ) ) { /** * Custom function for the callback validation referenced above * * @param array $field Field array. * @param mixed $value New value. * @param mixed $existing_value Existing value. * * @return mixed */ function test_custom_callback( $field, $value, $existing_value ) { $error = false; $warning = false; // Do your validation. if ( 1 === $value ) { $error = true; $value = $existing_value; } elseif ( 2 === $value ) { $warning = true; $value = $existing_value; } $return['value'] = $value; if ( true === $error ) { $field['msg'] = 'your custom error message'; $return['error'] = $field; } if ( true === $warning ) { $field['msg'] = 'your custom warning message'; $return['warning'] = $field; } return $return; } } ``` -------------------------------- ### Raw Field with PHP Output Source: https://devs.redux.io/core-fields/raw.html This example demonstrates how to use PHP output buffering to capture dynamic content generated by PHP code and display it within a 'raw' field. Use `ob_start()` and `ob_get_clean()` to manage the buffer. ```php ob_start( ); // This tells PHP to start putting all output in a buffer. echo "HERE I AM"; ?> Now we're in HTML mode! Everything here will be saved as text, including line breaks! 'opt-raw', 'type' => 'raw', 'title' => esc_html__('Raw output', 'your-textdomain-here'), 'subtitle' => esc_html__('Subtitle text goes here.', 'your-textdomain-here'), 'desc' => esc_html__('This is the description field for additional info.', 'your-textdomain-here'), 'content' => $output // Now let's set that in the raw field. ) ); ``` -------------------------------- ### Include Redux Framework and Sample Config Source: https://devs.redux.io/guides/advanced/embedding-redux.html Include this code at the top of your functions.php file. Ensure the relative path to Redux Framework is accurate for your project structure. This allows your theme or plugin to use Redux, and it will automatically use the Redux plugin if installed. ```php if ( !class_exists( 'ReduxFramework' ) && file_exists( dirname( __FILE__ ) . '/ReduxFramework/redux-core/framework.php' ) ) { require_once( dirname( __FILE__ ) . '/ReduxFramework/redux-core/framework.php' ); } if ( !isset( $redux_demo ) && file_exists( dirname( __FILE__ ) . '/ReduxFramework/sample/sample-config.php' ) ) { require_once( dirname( __FILE__ ) . '/ReduxFramework/sample/sample-config.php' ); } ``` -------------------------------- ### Redux::load() Source: https://devs.redux.io/configuration/api.html Code to run at creation in instance. ```APIDOC ## Redux::load() ### Description Code to run at creation in instance. ### Method APICALL ### Endpoint Redux::load() ### Parameters None ### Response #### Success Response (200) - **status** (string) - Indicates the status of the load operation. ``` -------------------------------- ### Redux::init() Source: https://devs.redux.io/configuration/api.html Init Redux object. ```APIDOC ## Redux::init( $opt_name ) ### Description Init Redux object. ### Method APICALL ### Endpoint Redux::init( $opt_name ) ### Parameters #### Path Parameters - **opt_name** (string) - Required - The option name to initialize. ### Response #### Success Response (200) - **status** (string) - Indicates the status of the initialization. ``` -------------------------------- ### Example Generated CSS Variables Source: https://devs.redux.io/configuration/fields/output-variables.html Redux automatically generates CSS variables based on field IDs and their values. These variables are appended to the `:root` selector for use in your stylesheets. The example below shows expanded output for clarity. ```css :root { --site-header-border-top: 3px solid #1e73be; --site-header-border-right: 3px solid #1e73be; --site-header-border-bottom: 3px solid #1e73be; --site-header-border-left: 3px solid #1e73be; } ``` -------------------------------- ### Redux::get_extensions() Source: https://devs.redux.io/configuration/api.html Gets loaded extensions. ```APIDOC ## Redux::get_extensions( $opt_name, $key ) ### Description Gets loaded extensions. ### Method APICALL ### Endpoint Redux::get_extensions( $opt_name, $key ) ### Parameters #### Path Parameters - **opt_name** (string) - Required - The option name. - **key** (string) - Optional - The key of the extension to retrieve. ### Response #### Success Response (200) - **extensions** (array|object) - An array or object containing the loaded extensions. ``` -------------------------------- ### Configure Global Hint Settings Source: https://devs.redux.io/configuration/fields/hints.html Specify global hint settings within the `hints` array in your main configuration file. These settings apply to all tooltips across your panels. ```php $args = array( // ... (list of other arguments in the args array) // HINTS 'hints' => array( 'icon' => 'el icon-question-sign', 'icon_position' => 'right', 'icon_color' => 'lightgray', 'icon_size' => 'normal', 'tip_style' => array( 'color' => 'light', 'shadow' => true, 'rounded' => false, 'style' => '', ), 'tip_position' => array( 'my' => 'top left', 'at' => 'bottom left', ), 'tip_effect' => array( 'show' => array( 'effect' => 'slide', 'duration' => '500', 'event' => 'mouseover', ), 'hide' => array( 'effect' => 'slide', 'duration' => '500', 'event' => 'click mouseleave', ), ), ), ); Redux::set_args( $opt_name, $args ); ``` -------------------------------- ### Redux::get_priority() Source: https://devs.redux.io/configuration/api.html Get next availability priority for field/section. ```APIDOC ## Redux::get_priority( $opt_name, $type ) ### Description Get next availability priority for field/section. ### Method APICALL ### Endpoint Redux::get_priority( $opt_name, $type ) ### Parameters #### Path Parameters - **opt_name** (string) - Required - The option name. - **type** (string) - Required - The type of item (field or section). ### Response #### Success Response (200) - **priority** (integer) - The next available priority number. ``` -------------------------------- ### Redux::get_instance_extension() Source: https://devs.redux.io/configuration/api.html Gets all loaded extension for the passed ReduxFramework instance. ```APIDOC ## Redux::get_instance_extension( $opt_name, $instance ) ### Description Gets all loaded extension for the passed ReduxFramework instance. ### Method APICALL ### Endpoint Redux::get_instance_extension( $opt_name, $instance ) ### Parameters #### Path Parameters - **opt_name** (string) - Required - The option name. - **instance** (object) - Required - The ReduxFramework instance. ### Response #### Success Response (200) - **extensions** (array) - An array of loaded extensions for the instance. ``` -------------------------------- ### Configuring a Border Field with Defaults Source: https://devs.redux.io/core-fields/border.html This example demonstrates a more comprehensive Border field configuration, including ID, title, subtitle, output targeting, description, and default values for color, style, and individual border widths. ```php Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'id' => 'header-border', 'type' => 'border', 'title' => esc_html__('Header Border Option', 'your-project-name'), 'subtitle' => esc_html__('Only color validation can be done on this field type', 'your-project-name'), 'output' => array('.site-header'), 'desc' => esc_html__('This is the description field, again good for additional info.', 'your-project-name'), 'default' => array( 'border-color' => '#1e73be', 'border-style' => 'solid', 'border-top' => '3px', 'border-right' => '3px', 'border-bottom' => '3px', 'border-left' => '3px' ) ) ); ``` -------------------------------- ### Set Help Tabs Source: https://devs.redux.io/configuration/global_arguments.html Configure individual tabs for the help dropdown. Each tab requires an ID, title, and HTML-compatible content wrapped in `

` tags. ```php Redux::set_help_tab( $opt_name, array( array( 'id' => 'redux-help-tab-1', 'title' => esc_html__( 'Theme Information 1', 'your-project-name' ), 'content' => '

'. esc_html__( 'This is the tab content, HTML is allowed.' . '

', 'your-project-name' ) ), array( 'id' => 'redux-help-tab-2', 'title' => esc_html__( 'Theme Information 2', 'your-textdomain-here' ), 'content' => '

' . esc_html__( '

This is the tab content, HTML is allowed.' . '

', 'your-project-name' ) ) ) ); ``` ```php Redux::set_args( $opt_name, array( 'help_tabs' => array( array( 'id' => 'redux-help-tab-1', 'title' => esc_html__( 'Theme Information 1', 'your-textdomain-here' ), 'content' => '

' . esc_html__( 'This is the tab content, HTML is allowed.' . '

', 'your-textdomain-here' ) ), array( 'id' => 'redux-help-tab-2', 'title' => esc_html__( 'Theme Information 2', 'your-textdomain-here' ), 'content' => '

' . esc_html__( 'This is the tab content, HTML is allowed.' . '

', 'your-textdomain-here' ) ) ) ); ``` -------------------------------- ### Add PayPal Social Profile Source: https://devs.redux.io/core-extensions/social-profiles.html Example of adding a new social profile with specific icon and color configurations. ```php 'icons' => array( array ( 'id' => 'paypal', 'icon' => 'fa-paypal', 'class' => 'fa-brands', 'enabled' => false, 'name' => __ ( 'PayPal', 'your-textdomain-here' ), 'background' => '', 'color' => '#1769ff', 'url' => '', ) ) ``` -------------------------------- ### Basic Sorter Field Setup Source: https://devs.redux.io/core-fields/sorter.html This is the most basic configuration for a sorter field. It requires a unique field type identifier. ```php Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'type' => 'sorter' ) ); ``` -------------------------------- ### Edit Apple Social Profile Source: https://devs.redux.io/core-extensions/social-profiles.html Example of modifying an existing social profile by changing its name, label, and enabled state. ```php 'icons' => array( array ( 'id' => 'apple', 'class' => 'fa-brands', 'enabled' => true, 'name' => esc_html__( 'CrApple', 'your-textdomain-here' ), 'label' => 'Enter username:', ) ) ``` -------------------------------- ### mkdir - Create Directory Source: https://devs.redux.io/guides/advanced/wp-filesystem-proxy.html Creates a directory, including any necessary parent directories. ```APIDOC ## mkdir - Create Directory Creates a new directory. This function can create nested directories if they do not exist. ### Method ```php $redux->filesystem->execute( 'mkdir', $path ); ``` ### Parameters * **action** (string) - Must be 'mkdir'. * **$path** (string) - Required - The path of the directory to create. ### Example ```php $redux = Redux::get_instance( 'OPT_NAME' ); // TODO - Use your opt_name $path = "THE_PATH"; // TODO - Replace with path if ( ! is_dir( $path ) ) { $redux->filesystem->execute( "mkdir", $path ); } ``` ``` -------------------------------- ### Slider with Decimal Steps Source: https://devs.redux.io/core-fields/slider.html Configure a slider that accepts decimal values. This example sets the minimum, maximum, and step to decimal values, and specifies that the value should be displayed as text. The 'resolution' parameter is also set to ensure precise decimal handling. ```php Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'id' => 'opt-slider-float', 'type' => 'slider', 'title' => esc_html__( 'Slider Example 4 with float values', 'your-textdomain-here' ), 'subtitle' => esc_html__( 'This example displays float values', 'your-textdomain-here' ), 'desc' => esc_html__( 'Slider description. Min: 0, max: 1, step: .1, default value: .5', 'your-textdomain-here' ), 'default' => .5, 'min' => 0, 'step' => .1, 'max' => 1, 'resolution' => 0.1, 'display_value' => 'text', ), ); ``` -------------------------------- ### Basic Date Field Configuration Source: https://devs.redux.io/core-fields/date.html This snippet shows the minimal configuration required to set up a Date field. Ensure 'OPT_NAME' and 'SECTION_ID' are correctly defined for your project. ```php Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'type' => 'date' ) ); ``` -------------------------------- ### Get All Sections for an OptName Source: https://devs.redux.io/configuration/objects/field.html Use this method to retrieve all sections associated with a specific opt_name. Ensure the opt_name is correctly defined. ```php $sections = Redux::get_sections( 'OPT_NAME' ); ``` -------------------------------- ### Retrieve Color Palette Value - PHP Source: https://devs.redux.io/core-fields/color-palette.html Example of how to retrieve the selected color value from a Color Palette field in your theme or plugin. ```php global $redux_demo; echo esc_html__( 'Selected color: ', 'your-textdomain-here' ) . $redux_demo['opt-color-palette-grey']; ``` -------------------------------- ### Execute Filesystem Action Source: https://devs.redux.io/guides/advanced/wp-filesystem-proxy.html The core method for interacting with the filesystem. It takes an action, a path, and optional arguments. ```APIDOC ## Execute Filesystem Action This method is used to perform various file operations using the WordPress filesystem API. ### Method ```php $redux->filesystem->execute( 'action', PATH, $args ); ``` ### Parameters * **action** (string) - Required - The filesystem operation to perform (e.g., 'mkdir', 'copy', 'put_contents', 'get_contents', 'object', 'unzip'). * **PATH** (string) - Required - The path to the file or directory. * **$args** (array) - Optional - An array of arguments specific to the action. ``` -------------------------------- ### Redux::create_redux() Source: https://devs.redux.io/configuration/api.html Create Redux instance. ```APIDOC ## Redux::create_redux() ### Description Create Redux instance. ### Method APICALL ### Endpoint Redux::create_redux() ### Parameters None ### Response #### Success Response (200) - **instance** (object) - The newly created Redux instance. ``` -------------------------------- ### Configure Sidebar Metabox Source: https://devs.redux.io/core-extensions/metaboxes.html Define a metabox specifically for sidebar configuration using `Redux_Metaboxes::set_box`. This example shows a select field for choosing a sidebar. ```php // Metabox sidebar. Redux_Metaboxes::set_box( $opt_name, array( 'id' => 'opt-metaboxes-3', 'post_types' => array( 'page', 'post' ), 'position' => 'side', // normal, advanced, side. 'priority' => 'high', // high, core, default, low. 'sections' => array( array( 'icon_class' => 'icon-large', 'icon' => 'el-icon-home', 'fields' => array( array( 'id' => 'sidebar', 'title' => esc_html__( 'Sidebar', 'your-textdomain-here' ), 'desc' => esc_html__( 'Please select the sidebar you would like to display on this page. Note: You must first create the sidebar under Appearance > Widgets.', 'your-textdomain-here' ), 'type' => 'select', 'data' => 'sidebars', 'default' => 'None', ), ), ), ), ) ); ``` -------------------------------- ### Advanced Password Field Configuration with Placeholders Source: https://devs.redux.io/core-fields/password.html This example demonstrates a more comprehensive configuration for a password field, including enabling the username field, setting a custom title, and defining specific placeholders for both username and password inputs. ```php Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'id' => 'opt-password', 'type' => 'password', 'username' => true, 'title' => esc_html__( 'SMTP Account', 'your-textdomain-here' ), 'placeholder' => array( 'username' => esc_html__( 'Enter your Username', 'your-textdomain-here' ), 'password' => esc_html__( 'Enter your Password', 'your-textdomain-here' ), ) ) ); ``` -------------------------------- ### redux/init Source: https://devs.redux.io/configuration/hooks/hooks-action.html Fires when Redux is initialized. ```APIDOC ## redux/init ### Description Fires on Redux initialization. ### Method `do_action()` ### Endpoint `redux/init` ### Parameters None ``` -------------------------------- ### Advanced Spacing Field Configuration Source: https://devs.redux.io/core-fields/spacing.html This example demonstrates an advanced configuration for the Spacing field, including output targeting, mode selection (margin), custom units, extended units disabled, and default values for spacing and units. ```php Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'id' => 'opt-spacing', 'type' => 'spacing', 'output' => array('.site-header'), 'mode' => 'margin', 'units' => array('em', 'px'), 'units_extended' => 'false', 'title' => esc_html__('Padding/Margin Option', 'your-textdomain-here'), 'subtitle' => esc_html__('Allow your users to choose the spacing or margin they want.', 'your-textdomain-here'), 'desc' => esc_html__('You can enable or disable any piece of this field. Top, Right, Bottom, Left, or Units.', 'your-textdomain-here'), 'default' => array( 'margin-top' => '1px', 'margin-right' => '2px', 'margin-bottom' => '3px', 'margin-left' => '4px', 'units' => 'em', ) ) ); ``` -------------------------------- ### Get WP_Filesystem API Object Source: https://devs.redux.io/guides/advanced/wp-filesystem-proxy.html Retrieve the underlying WordPress FileSystem API object. This allows direct interaction with WordPress's filesystem methods. ```php $redux = Redux::get_instance('OPT_NAME'); // TODO - Use your opt_name $object = $redux->filesystem->execute( 'object' ); ``` -------------------------------- ### Basic Text Field Configuration Source: https://devs.redux.io/core-fields/text.html Use this to set up a basic text field. Ensure 'OPT_NAME' and 'SECTION_ID' are replaced with your specific values. ```php Redux::set_field( 'OPT_NAME', 'SECTION_ID', array( 'type' => 'text' ) ); ``` -------------------------------- ### Render Social Profiles with HTML Source: https://devs.redux.io/core-extensions/social-profiles.html Loops through enabled social profiles and constructs HTML for rendering icons. Ensure `redux_demo` is replaced with your opt_name. ```php // Or do the following for full icon rendering foreach ( $redux_demo['opt-social-profiles'] as $idx => $arr ) { if ( isset( $arr['enabled'] ) && !empty( $arr['enabled'] ) ) { $id = $arr['id']; $id = $arr['class']; $url = $arr['url']; $icons .= ''; $icons .= '
';
    }

    $output = '
';
}
```