Last active
June 3, 2018 06:50
-
-
Save aalimran07/e6bac0f24a47cb3af195fb2e67332f03 to your computer and use it in GitHub Desktop.
Make function with a global variable for getting data
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
<!-- Use this code instead including every file global $opt_name | |
You just copy this code and past it in your theme function.php and then change your options global veriable. | |
--> | |
if (! function_exists('redux_options')) { | |
function redux_options($id, $fallback = false, $key = false) | |
{ | |
global $industryall; | |
if ($fallback == false) { | |
$fallback = ''; | |
} | |
$output = ( isset($industryall[ $id ]) && $industryall[ $id ] !== '' ) ? $industryall[ $id ] : $fallback; | |
if (! empty($industryall[ $id ]) && $key) { | |
$output = $industryall[ $id ][ $key ]; | |
} | |
return $output; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment