Forked from dongilbert/option_tree_shortcode.php
Last active
August 29, 2015 13:57
-
-
Save joshlevinson/9791661 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?php | |
/** | |
* Shortcode to go along with my Option Tree | |
* helper functions. See those here: | |
* https://gist.github.com/2627998 | |
* | |
* <samp>[theme_option name="home_text"]</samp> | |
* | |
* @param array Array of attributes passed from the shortcode. | |
* @return string|null | |
*/ | |
if(function_exists('ot_get_option')) | |
{ | |
add_shortcode('theme_option', 'theme_option_shortcode'); | |
function theme_option_shortcode($atts) | |
{ | |
extract(shortcode_atts(array( | |
'name' => null | |
), $atts)); | |
if($name !== null) | |
{ | |
$name = ot_get_option($name); | |
} | |
return $name; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment