Created
February 7, 2017 08:36
-
-
Save kirillrocks/e2bf418da0fe3ee4b44190eb348a6553 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
public static function get_option( $name, $default = false ) { | |
$option = get_option( 'cjlp' ); | |
if ( false === $option ) { | |
return $default; | |
} | |
if ( isset( $option[ $name ] ) ) { | |
return $option[ $name ]; | |
} else { | |
return $default; | |
} | |
} | |
public static function update_option( $name, $value ) { | |
$option = get_option( 'cjlp' ); | |
$option = ( false === $option ) ? array() : (array) $option; | |
$option = array_merge( $option, array( $name => $value ) ); | |
update_option( 'cjlp', $option ); | |
} | |
public static function delete_option( $name ) { | |
$option = get_option( 'cjlp' ); | |
$option = ( false === $option ) ? array() : (array) $option; | |
unset( $option[ $name ] ); | |
update_option( 'cjlp', $option ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment