2

Can anyone who successfully used this framework help me? Redux states that it utilizes a global variable for referencing all of the saved options in the database.

My goal is to access these stored options, so I can figure out how to call them.

Admittedly, I am new to using options panel frameworks. There is another similar question at: redux framework wordpress calling variable. I can't figure out using the documentation how this is done.

Here is the documentation for the framework: http://plovs.github.io/Redux-Framework-Docs/docs.html

What am I missing? The section/field arrays look like this:

    $sections[] = array(
    'title' => __('Home Settings', 'redux-framework-demo'),
    'desc' => __('Here, you can change any of the many options bundled with samTheme', 'redux-framework-demo'),
    'icon' => 'el-icon-home',
    // 'submenu' => false, // Setting submenu to false on a given section will hide it from the WordPress sidebar menu!
    'fields' => array(  
        array(
            'id'=>'webFonts',
            'type' => 'media', 
            'title' => __('Web Fonts', 'redux-framework-demo'),
            'compiler' => 'true',
            'mode' => false, // Can be set to false to allow any media type, or can also be set to any mime type.
            'desc'=> __('Basic media uploader with disabled URL input field.', 'redux-framework-demo'),
            'subtitle' => __('Upload any media using the WordPress native uploader', 'redux-framework-demo'),
            ),              

The $sections[] array id is generic in name. The arrays are generic in name. I'm assuming these can be referenced by id? This is ultra confusing. If I'm missing something ridiculous here, I apologise in advance. I'm completely new to this framework.

3 Answers 3

1

I too found Redux Framework confusing at first.

I think what you're trying to do (assuming this is still the case, as it's an old question) is output the value of the Redux Framework opt_name variable.

Find the value of opt_name in your options/config file. Using the sample config file as an example, opt_name is defined as redux_demo.

So armed with that, head over to your functions.php page (or any of your theme's pages as an example) and declare

global $redux_demo;

followed by

echo $redux_demo['webFonts']['url'];

That should output the URL saved within the webFonts section of your options panel. You can find a list of available fields along with more example code at http://docs.reduxframework.com/core/fields/media/

Sign up to request clarification or add additional context in comments.

2 Comments

How can we make Redux less confusing? I'd love to get your input on docs and how to improve them.
@Dovy I can't speak for others but I learn by examples, so a quick start demo with code works for me.
1

Spoiler alert, I am a core dev of Redux, ha.

So the best place to get support is our issue tracker found here: https://github.com/ReduxFramework/ReduxFramework/issues

But, I'll answer this here.

The docs you have are old, really old, like 2 years old. Redux is a completely new setup now. Please look here: https://github.com/ReduxFramework/ReduxFramework/wiki/Getting-Started#step-3-using-the-saved-option-values

That should answer all your questions. Let me know if you need further help!

1 Comment

Links may be old in some years too. Stop fishing for visitors and just answer the question here with example code - that is what stackoverflow is for.
0

In Config file find:

$opt_name = 'your_opt_name';

In functions.php or in theme:

global $your_opt_name;

echo $your_opt_name['webFonts'];

Or you can debug to get full info:

var_dump($your_opt_name)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.