Created
January 6, 2015 20:41
-
-
Save wpmark/be4b611f90295697093a to your computer and use it in GitHub Desktop.
Options Framework Get Option
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
<?php | |
/** | |
* function wpmark_get_option() | |
* gets a theme options specificed from the options table | |
* @param (string) $name is the name of the options to get | |
* @param (string) $default is the default value to return if no value is present | |
*/ | |
function wpmark_get_option( $name, $default = false ) { | |
/* get the options framework setting option */ | |
$optionsframework_settings = get_option( 'optionsframework' ); | |
/* get the option with all our options stored in */ | |
if( get_option( $optionsframework_settings['id'] ) ) { | |
$options = get_option( $optionsframework_settings['id'] ); | |
} | |
/* if the name of the option request is present */ | |
if( isset( $options[ $name ] ) ) { | |
/* return the option value */ | |
return $options[ $name ]; | |
/* options requested returns nothing */ | |
} else { | |
/* return the default supplied in the function */ | |
return $default; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment