GithubHelp home page GithubHelp logo

reduxframework / redux-framework Goto Github PK

View Code? Open in Web Editor NEW
1.7K 113.0 582.0 50.91 MB

Redux is a simple, truly extensible options framework for WordPress themes and plugins!

Home Page: http://redux.io

License: Other

CSS 11.44% JavaScript 15.30% PHP 67.20% SCSS 6.06%
redux-framework wordpress-plugin php wordpress-theme converter options option-framework metaboxes user-meta wordpress-admin

redux-framework's Introduction

Redux Framework

WordPress plugin WordPress

ATTENTION

While we recognize Redux could be embedded in a theme or plugin in the past, we are no longer supporting the practice. Too many developers are not keeping their Redux code up-to-date (which could easily accomplished with Composer). When users of the projects experience issues, they seek support from us, which we are unable to provide short of suggesting they contact the project author (you) and ask you to update your vendor code. This puts your users in the middle, and we'd prefer not to do that anymore.

Consequently, the vendor support plugin/extension for ace_editor has been discontinued. The ACE Editor will load exclusively via CDN. If your project requires a local installation of the ACE Editor JavaScript (whose size is substantial), please include it in your project and use the redux/<opt_name>/fields/ace/script filter to specify the URL to that script. The ace_editor field will use that URL to enqueue the ACE library.

Thank you for your kind attention in this matter.

New to Version 4.4

  • Content Field
  • COLOR SCHEMES Extension.
  • TABBED Extension.
  • TAXONOMY METABOXES!
  • USER PROFILE METABOXES!
  • ICON SELECT Extension.
  • The Extendify Templates and Patterns library have been unbundled from Redux. To continue using Extendify, please download the standalone plugin from the WordPress.org repository: https://wordpress.org/plugins/extendify

New to Version 4.3

  • METABOXES!
  • REPEATER EXTENSION!
  • SOCIAL PROFILES EXTENSION!
  • CUSTOM FONTS EXTENSION!
  • Multi Media extension.
  • DateTime extension.
  • JS Button extension.
  • Google Maps extension
  • Widget Areas extension (applies to Classic Widgets only).
  • Gutenberg Template Library updated to the new Extendify library. See more information here about this upgrade and how to access the legacy library: https://redux.io/gutenberg-template-library-upgrade.

New to Version 4.2

See the sample folder for examples of the new and improved fields.

  • Additional Typography features: Top and bottom margins, text shadow.
  • New Media Image Filters (greyscale, sepia, opacity, contrast, invert, blur, saturate, brightness, hue-rotate).
  • New Gradient Field Filters (type, reach, angle), including output for autogenerated CSS.
  • New Box Shadow field with output for autogenerated CSS.
  • New Flyout Submenus: flyout_submenus global arg.
  • New Alpha color option for color field: color_alpha field arg for fields that support color pickers.
  • Removed: async_typography global arg. Google no longer supports it. Use font_display with one of the following auto|block|swap|fallback|optional. See: https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display
  • Automatic update option for Google Fonts without a Pro subscription.

Join us on Slack

Redux Slack

Follow us on Social Media!

Follow us on X Like us on Facebook

Changelog

See Changelog.md

Documentation

Need a little help with Redux? Come check out our brand-new documentation site at devs.redux.io, chock-full of tutorials and examples!

Help Us Translate Redux

Please head over to the plugin page to learn how you can help us translate Redux quickly. Any and all translations are welcome. We appreciate your help! https://translate.wordpress.org/projects/wp-plugins/redux-framework/

Features

  • Uses the WordPress Settings API
  • Multiple built-in field types
  • Multiple layout field types
  • Fields can be overloaded with a callback function for custom field types
  • Easily extendable by creating Field Classes
  • Built-in Validation Classes
  • Easily extendable by creating Validation Classes
  • Custom Validation error handling, including error counts for each section, and custom styling for error fields
  • Custom Validation warning handling, including warning counts for each section, and custom styling for warning fields
  • Multiple Hook Points for customization
  • Import / Export Functionality — including cross-site importing of settings
  • Easily add page help through the class
  • Fully responsive options panel
  • Much more

What's new in version 4?

Core Rewrite

Our code base has been rebuilt from the ground up. With compartmentalized code, autoload, and class inheritance, Redux is now faster and more efficient than it's ever been!

Top of the Line Security!

Redux meets security standards laid out by WordPress Coding Standards, WordPress VIP Standards, and ThemeForest Guidelines. Focus includes escaping, sanitizing, nonces verification, and database query prep/caching.

Automatic Google Font Updates.

This is one of the crown jewels of Redux v4! Your users will have the ability to update Google Fonts as updates are available or automatic ‘behind the scenes’ updates. No more waiting for updates and no API key is required!

Field Sanitizing

Field sanitizing allows one to pass an array of function names as an argument to a field in which the return value will be the sanitizing string. This feature will only work with text-based fields, including text, textarea, and multi_text (ACE Editor and WP Editor not included).

One may use any existing function, including PHP functions, WordPress functions, and custom-written functions. The return value of any used function must be that of a string. Any other return value will be disregarded.

Please view the sample-config.php file for specific examples.

Select2 AJAX Loading

The AJAX loading routines for the select2 fields have been fixed/finished. See the 'capabilities' field in the demo panel for an example.

In the interim, this feature will only work when used in conjunction with the data argument (that is, the one that fetches WordPress data).

To set AJAX loading, add the 'ajax' => true argument to your select field. The min_input_length argument may also be added to specify how many characters should be typed before results are shown. The default is 1.

Field/Section Disabling

This feature has been requested quite a few times over the years. Fields and sections can now be disabled by adding the 'disabled' => true argument to either a section or a field. The section or field will then appear 'greyed out' and not respond to input. This comes in handy in the event one may want to offer teasers for premium versions of their products.

Since those with a little CSS know-how could easily reactivate disabled fields with a little CSS, we took the added precaution of having Redux remove any name attributes on disabled fields/sections. This way, even if a clever user reactivates the field, it will never save.

Updated Panel Interface

The option panel interface has been brought up to date with the current WordPress admin design. It is also now ‘theme aware.’ Panel colors will now follow suit with the selected admin theme.

Improved Field Validation

Due to the need for multiple field validations, Redux now supports an array of validations versus the previously limiting single argument. Validation results now appear in real time after a save without the need for a page refresh.

Full v3 Backward Compatibility

We take backward compatibility very seriously here and strive to maintain it. Redux v4 has been designed to act as a drop-in replacement to offer new functionality without breaking existing functionality.

FAQs

  1. Why should we use require_once instead of get_template_part?
  • First, because get_template_part is for... you guessed it, themes! Redux is designed to work with both themes and plugins.
  • Second, read this.
  1. Why shouldn't we edit sample-config.php in the plugin directory?
  • Because sample-config.php will be replaced at each update of the plugin. You will lose all your work.

redux-framework's People

Contributors

abu-taymiyyah avatar andreilupu avatar dependabot[bot] avatar dovy avatar eplanetdesign avatar fovoc avatar htrex avatar kevinbatdorf avatar kprovance avatar krishna19 avatar ksere avatar kwayyinfotech avatar meydjer avatar mintbird avatar ninos avatar owletserver avatar partnuz avatar paulthecoder avatar phpbits avatar polonel avatar pseudonymus avatar sir-daniel avatar tivnet avatar tpaksu avatar vertigo7x avatar web-caos avatar webbudesign avatar wpexplorer avatar zackkatz avatar zafarkamal123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redux-framework's Issues

Export options don't work locally

When working locally (Win7 with xampp) the export "download" and "copy link" options do not do anything.

This is related to: SimpleRain/SimpleOptions#34

On a dedicated apache webserver the options seem to work fine.

This issue started to occur in SimpleOptions >=0.5.0. Prior versions worked fine locally.

Can you think of any reason this may no longer work? It's a shame. I typically work locally and then want to copy the settings to the webserver.

I should note, the "copy link" feature generates a url, but when you load the url it's simply a blank page. The "copy" option seems to work fine.

Typography style not saving

When using a non-google font, the style does not save.

Example, set font to "courier, monospace" with a style of "bold 700".

You should notice "bold 700" is reset to empty on save.

Options Builder Plugin

Want to build a "panel" builder if you will. Complete with preview and everything. Allowing users to see how it would look if they did it this way, then export with the proper PHP.

This would be a premium feature.

Undefined Variable Notice - framework.php line 876

The th variable is setting an undefined notice when in WP debug mode.

This is due to the initial variable define being placed inside of an if statement that isn't being called all the time. If you move the following on line 824...

$th = '';

...to above and outside the current if statement scope, the error is resolved (move to around line 819). There is probably a better way to write all of this but I'm not sure exactly how it would be done.

Presets not working

Presets are not working for me. Here is what I have found while testing base options found in the current repo.

The presets array shows this in Dev Mode Tab:

id: "presets"
type: "image_select"
presets: true
title: "Preset"
subtitle: "This allows you to set a json string or array to override multiple preferences in your theme."
default: 0
desc: "This allows you to set a json string or array to override multiple preferences in your theme."
-options: {
-1: {
alt: "Preset 1"
img: http://localhost/wp-multi/theme/wp-content/themes/theme/framework/admin/options-framework/sample/presets/preset1.png
-presets: {
switch-on: 1
switch-off: 1
switch-custom: 1
}
}
-2: {
alt: "Preset 2"
img: http://localhost/wp-multi/theme/wp-content/themes/theme/framework/admin/options-framework/sample/presets/preset2.png
presets: "{"slider1":"1", "slider2":"0", "switch-on":"0"}"
}
}

As you can see, this is exactly as it is in the sample-config.php

Here is what I see under options_defaults in Dev Mode Tab for the preset and the fields in the preset array:

switch-on: 1
switch-off: 0
switch-custom: 0
presets: 0

Here is what I see this under options:

switch-on: "1"
switch-off: ""
switch-custom: ""
presets: 0

Now, when I select the preset option 1, here is what I see under options:

switch-on: "1"
switch-off: ""
switch-custom: ""
presets: "1"

So, preset option 1 is set, but the switch values never changed.

Typography improvements italic bold etc.

Hy everybody i think it would be great to extend the typography with those options. Because over the parameter style returns chubby values like 900-italic. But those you cant use for style etc. Would be better to split the size like 900 into font-weight and the styles like italic, italic, italic+bold... 👍

EDD Licensing support

Need an extension to allow integration of the EDD Software Licensing component directly into a panel created with Redux.

Notice: Undefined variable: defaults

Received this notice when installing redux on fresh wp install and theme activation.

Notice: Undefined variable: defaults in ...framework.php on line 211

Add on request? Slider options

NOTE: Carried over from pre-3.x repo - original issue posted by @availium

I know this shouldn't be core functionality, which is why I'm requesting it as an add-on. Couldn't think of any other way to ask.

So as to not reinvent the wheel, does anyone have, or is willing to share their, slider option fields? I'm thinking (or am hopeful) someone's done this with the FlexSlider2 Slider already.

Thanks!

Select Field Shows Default ID on Change

I noticed that when you change a select field and save the options, it displays the default ID beneath the subtitle, is this being done intentionally? Is there a way to turn this off?

You can see an example of what I am referring to in the image below:

select-default

Inconsistency with Field Description Styles

I noticed that the field descriptions alternate between italic and standard font seemingly random. Not sure if this is done by design or simply an oversight.

For instance these field types have an italic description:

Text Input Field
Textarea Field
Layout Manager Field

While, these field types have a standard description:

Multi Text
Checkbox Field
Multi Check Field
Select Field

framework.php : $tabs - never used?

            foreach( $this->sections as $k => $section ) {
                echo '<div id="' . $k . '_section_group' . '" class="redux-group-tab">';
                if ( !empty( $section['sections'] ) ) {
                    $tabs = "";

Redux Guidelines?

The framework is nice. Been checking the functionality in the admin side and it looks great same as HNP Framework that I'm using. The problem with this, there's no guide on how to use in front-end. Guidelines on how to use it in front-end should be implemented. Like, how to use the radio option, multi-check, upload, fonts and especially with if else state.

What's nice if there's an if else statement guide; is to display the field entry if there is an entry, and if it's empy, it should not display or else, display another content as default.

Not all front-end developer is good in PHP like me. Hope this will be implemented like what Advanced Custom Fields doing. Lots of sample guidelines for front-end development. Thanks for the framework. Good job.

ReduxFramework Stable release and Dev release

It's been 5 days now that I'm working with the STABLE release. as I read the Dev release installation, I don't know what you mean about the cloning with git and even the installation of Dev release.

From your page: http://reduxframework.com/docs/getting-started/
this code does not show the options menu.

if(!class_exists('ReduxFramework')){
require_once(dirname(FILE) . '/ReduxFramework/framework.php');
}

and in the main page https://github.com/ReduxFramework/ReduxFramework
you mention about the installation and setting up the framework. I don't even understand the unzip of file. Is that in Ubuntu OS or Linux OS?

calling this option require_once('path/to/copied/options.php'); is for the STABLE release. The DEV release framework doesn't have the options.php file.

I'm confused to migrate to the DEV version. or just continue with STABLE version.

sorry about this post, I just don't understand the flow of setting up the framework for DEV release.

Compiler fails on image_select field

The compiler fails to run using image_select fields.

Example:

array(
    'id'=>'layout',
    'type' => 'image_select',
    'title' => __('Main Layout', 'redux-framework'), 
    'subtitle' => __('Select main content and sidebar alignment. Choose between 1, 2 or 3 column layout.', 'redux-framework'),
    'options' => array(
            '1' => array('alt' => '1 Column', 'img' => REDUX_URL.'assets/img/1col.png'),
            '2' => array('alt' => '2 Column Left', 'img' => REDUX_URL.'assets/img/2cl.png'),
            '3' => array('alt' => '2 Column Right', 'img' => REDUX_URL.'assets/img/2cr.png'),
            '4' => array('alt' => '3 Column Middle', 'img' => REDUX_URL.'assets/img/3cm.png'),
            '5' => array('alt' => '3 Column Left', 'img' => REDUX_URL.'assets/img/3cl.png'),
            '6' => array('alt' => '3 Column Right', 'img' => REDUX_URL.'assets/img/3cr.png')
        ),
    'default' => '2',
    'compiler'  => 'true',
    ),

Spacing field type broken

@dovy it appears this field broke over the last few days. The Select for units is showing "1" instead of px,%, em. I also don't see the units in the output.

units

Returning Values

Hy everybody i'm starting using redux for a new client theme. So i'm using roots as the basis and copied this into functions.php
if(!class_exists('ReduxFramework')){
require_once(dirname(FILE) . '/options/framework.php');
}
require_once(dirname(FILE).'/options/sample/sample-config.php');

Everything is fine see the values ecetera. Now i want to retrieve the value from slider1. I defined opt_name with roots_opt. So i could acces via global var $roots_opt['slider1'] the value???

ReduxFramework_switch::render() - useless assignments ?

    function render(){

        $cb_enabled = $cb_disabled = '';//no errors, please

        $val = intval($this->value);

        //Get selected
        if ( (int) $this->value == 1 ){
            $cb_enabled = ' selected';
            $cb_disabled = '';
        }else {
            $cb_enabled = '';
            $cb_disabled = ' selected';
        }

$cb_enabled/disabled are defined in if-else, so do not need initial assignment (or remove the else part)
$val - do not see any reference to it later

Better Info Boxes?

May think about implementing some of these. May be difficult as we use the options framework. Oy.

screen shot 2013-09-14 at 11 09 11 pm

class ReduxFramework_sorter - is that used at all?

Because if it is used somehow, there is something strange with the
$sortlists = $this->value;
assignment.
$this->value defaults to empty string in constructor, and I do not see any sings of validating if it's an array, before being used in foreach()....

Cant display saved data

Hi, first - amazing work !

I worked with SMOF till now, but my knowledge not help me to get here on Redux saved data.

On the option admin i can saved the data and it really saved it, but i cant to display it on the site.

Functions.php

              /**
             * Set up Admin
             */

             if(!class_exists('ReduxFramework')){
             require_once(dirname(__FILE__) . '/admin/framework.php');
             }

             require_once(dirname(__FILE__).'/admin/options.php');

Options.php:

$args['opt_name'] = 'data';

On next of options.php:

        array(
            'id'=>'logo_image',
            'type' => 'media', 
            'title' => __('Logo image', 'redux-framework'),
            'subtitle' => __('Upload any media using the Wordpress native uploader', 'redux-framework'),
            ),

                            array(
            'id'=>'text',
            'type' => 'textarea',
            'title' => __('Text', 'redux-framework'), 
            'subtitle' => __('Paste your Google Analytics (or other) tracking code here. This will be added into the footer template of your theme.', 'redux-framework'),
            'validate' => 'js',
            'desc' => 'Validate that it\'s javascript!',
            ),

Framework.php:

       public function __construct( $sections = array(), $args = array(), $extra_tabs = array() ) {
        // Create defaults array
        $defaults = array();
        $defaults['opt_name']           = ''; // Must be defined by theme/plugin
        $defaults['google_api_key']     = ''; // Must be defined to add google fonts to the typography module
        $defaults['last_tab']           = '0';
        $defaults['menu_icon']          = REDUX_URL . 'assets/img/menu_icon.png';
        if (defined('MP6')) {
            $defaults['menu_icon']      = '';
        }
        $defaults['menu_title']         = __( 'Options', 'redux-framework' );
        $defaults['page_icon']          = 'icon-themes';
        $defaults['page_title']         = __( 'Options', 'redux-framework' );
        $defaults['page_slug']          = '_options';
        $defaults['page_cap']           = 'manage_options';
        $defaults['page_type']          = 'menu';
        $defaults['page_parent']        = 'themes.php';
        $defaults['page_position']      = null;
        $defaults['allow_sub_menu']     = true;
        $defaults['show_import_export'] = true;
        $defaults['dev_mode']           = true;
        $defaults['system_info']        = true;
        $defaults['admin_stylesheet']   = 'standard';
        $defaults['footer_credit']      = __( '<span id="footer-thankyou">Options panel created using <a href="' . $this->framework_url . '" target="_blank">Redux Framework</a> v' . $this->framework_version . '</span>', 'redux-framework' );
        $defaults['help_tabs']          = array();
        $defaults['help_sidebar']       = __( '', 'redux-framework' );
        $defaults['theme_mods']         = false;
        $defaults['theme_mods_expand']  = false;
        $defaults['transient']          = false;
        $defaults['global_variable']    = '';
        $defaults['transient_time']     = 60 * MINUTE_IN_SECONDS;

header.php:

                  <?php global $data; ?>
                  < img src="<?php echo $data['logo_image'] ?>" /><?php echo $data['text'] ?> 

what i forgot to do ? what am i doing wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.