Created
November 10, 2011 09:55
-
-
Save kepek/1354524 to your computer and use it in GitHub Desktop.
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
function aboriginal_theme_option($atts) { | |
// EXAMPLE USAGE: | |
// [theme_option show="company_address"] | |
$options = aboriginal_get_theme_options(); | |
extract(shortcode_atts(array( | |
'show' => '' | |
), $atts)); | |
return $options[$show] ? $options[$show] : false; | |
} | |
add_shortcode('theme_option', 'aboriginal_theme_option'); | |
function aboriginal_get_theme_option($show, $echo = false) { | |
if($echo) { | |
echo do_shortcode('[theme_option show="'.$show.'"]'); | |
} | |
else { | |
return do_shortcode('[theme_option show="'.$show.'"]'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment