Skip to content

Instantly share code, notes, and snippets.

@dovy
Last active December 26, 2015 22:28
Show Gist options
  • Save dovy/7222834 to your computer and use it in GitHub Desktop.
Save dovy/7222834 to your computer and use it in GitHub Desktop.
<?php
function useReduxVariables() {
// Redux does some nifty setup things. To use the variables inside your functions.php file you will need to run your
// code inside a function run at the init hook or later.
// In this example we assume that demo mode is turned on. You can sub your variable name here to get your values.
global $redux_demo;
print_r($redux_demo);
}
add_action( 'init', 'useReduxVariables');
<?php
// Due to a limitations of variables and functions, you must globally define
// variables inside functions.
global $redux_demo; // This is your opt_name.
print_r($redux_demo);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment