Created
December 3, 2014 00:31
-
-
Save taeo/17e4fd02b4ca18bfd5ae to your computer and use it in GitHub Desktop.
Wordpress Redux Helper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* NOTE: | |
* This requires setting your redux global var to $sg_redux | |
**/ | |
/* Echo value from sole redux config */ | |
function the_redux_setting($key, $index=null) { | |
echo get_redux_setting($key, $index); | |
} | |
/* Return value from sole redux config */ | |
function get_redux_setting($key, $index=null) { | |
global $sg_redux; | |
if (isset($sg_redux[$key])) { | |
if (is_array($sg_redux[$key]) && $index) { | |
return $sg_redux[$key][$index]; | |
} | |
return $sg_redux[$key]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment