-
-
Save tommcfarlin/76522dbf7589f88048abbaac42493dbf to your computer and use it in GitHub Desktop.
[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