Skip to content

Instantly share code, notes, and snippets.

@kepek
Created November 10, 2011 09:55
Show Gist options
  • Save kepek/1354524 to your computer and use it in GitHub Desktop.
Save kepek/1354524 to your computer and use it in GitHub Desktop.
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