Skip to content

Instantly share code, notes, and snippets.

@wpmark
Created January 6, 2015 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpmark/be4b611f90295697093a to your computer and use it in GitHub Desktop.
Save wpmark/be4b611f90295697093a to your computer and use it in GitHub Desktop.
Options Framework Get Option
<?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