Skip to content

Instantly share code, notes, and snippets.

@taeo
Created December 3, 2014 00:31
Show Gist options
  • Save taeo/17e4fd02b4ca18bfd5ae to your computer and use it in GitHub Desktop.
Save taeo/17e4fd02b4ca18bfd5ae to your computer and use it in GitHub Desktop.
Wordpress Redux Helper
<?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