How to get default values?
Hi this is not really an issue, I was just wondering if you can access the default values of lets say the typography field from the global variable $global_redux, or any other way.
array(
'id' => 'main_font',
'type' => 'typography',
'color' => false,
'font-size' => false,
'font-style' => false,
'font-weight' => false,
'letter-spacing' => true,
'line-height' => false,
'text-align' => false,
'subsets' => false,
'default' => array(
'font-family' => 'Roboto Condensed',
'google' => true,
'letter-spacing' => '0.5px',
'font-size' => '18px',
),
),
Something like this:
Redux->get_default('main_font','font-size');
or
$global_redux['main_font']['default']['font-size'];
Not yet. It would be a REALLY easy function to implement. I'm low on time right now. Feel like submitting a pull request? We have a default_values array already.
Maybe you could try something like this: http://docs.reduxframework.com/redux-framework/advanced/update-an-option-outside-the-options-panel/
Only instead of ReduxFramework->get, you'd do ReduxFramework->options_defaults
Don't forget, you can use the $redux = ReduxFramework::get_instance('OPTNAME'); to get the active object.
So now just add a function, and you could even do:
$value = ReduxFramework::get_instance('OPTNAME')->get_default('KEY', 'ARRAY_KEY');
Alright, thanks for steering me into the right direction. I'll submit a pull request later tonight, possibly tomorrow.
;) Thanks for helping out.
Is there a possible way now, to get the default values of options?
Could anyone post a feedback on this? Has it been implemented already?