/00-default-options.php Secret
Created
November 22, 2016 16:22
Star
You must be signed in to star a gist
[WordPress] Initializing Default WordPress Options
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 | |
public function set_options() { | |
$this->options = array_merge( | |
$this->get_default_options(), | |
get_option( 'acme_options_example', array() ) | |
); | |
} | |
public function get_default_options() { | |
$defaults = array( | |
'social' => array( | |
'twitter' => '', | |
'google' => '', | |
'instagram' => '', | |
), | |
'web' => array( | |
'site' => '', | |
'email' => '', | |
) | |
); | |
return $defaults; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment