Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[WordPress] Initializing Default WordPress Options
<?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
You can’t perform that action at this time.