-
-
Save tommcfarlin/5a9940d1364b4d15e1de755f78bd0a79 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
<?php | |
/** | |
* Initializes the plugin settings fo ruse throughout the rest of the plugin. | |
*/ | |
private function initialize () { | |
$settings = [ | |
'username' => '', | |
'user-info' => [ | |
'location' => '', | |
'id-number' => '', | |
'first-name' => '', | |
'last-name' => '', | |
], | |
'short-bio' => '', | |
]; | |
update_option('acme-plugin-settings', $settings); | |
} |
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 | |
/** | |
* Intiializes the properties of the class, primarily the array of settings. | |
*/ | |
public function __construct() { | |
if (false === get_option('acme-plugin-settings')) { | |
$this->initialize(); | |
} | |
// More to come... | |
} |
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 | |
/** | |
* Intiializes the properties of the class, primarily the array of settings. | |
*/ | |
public function __construct() { | |
if (false === get_option('acme-plugin-settings')) { | |
$this->initialize(); | |
} | |
$this->settings = get_option('acme-plugin-settings'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment