-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from SparkartGroupInc/initial-development
#0rQ4rIV6 Initial Development
- Loading branch information
Showing
2 changed files
with
179 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
function storyteller_settings_init() { | ||
add_settings_section( | ||
'storyteller_settings', | ||
'Storyteller', | ||
'storyteller_settings_section_setup', | ||
'general' | ||
); | ||
|
||
add_settings_field( | ||
'storyteller_project', | ||
'Project', | ||
'storyteller_project_setup', | ||
'general', | ||
'storyteller_settings' | ||
); | ||
register_setting( 'general', 'storyteller_project' ); | ||
|
||
add_settings_field( | ||
'storyteller_apikey', | ||
'API Key', | ||
'storyteller_apikey_setup', | ||
'general', | ||
'storyteller_settings' | ||
); | ||
register_setting( 'general', 'storyteller_apikey' ); | ||
|
||
add_settings_field( | ||
'storyteller_proxyurl', | ||
'Proxy URL', | ||
'storyteller_proxyurl_setup', | ||
'general', | ||
'storyteller_settings' | ||
); | ||
register_setting( 'general', 'storyteller_proxyurl' ); | ||
} | ||
add_action( 'admin_init', 'storyteller_settings_init' ); | ||
|
||
function storyteller_project_setup() { | ||
$storyteller_project = get_option('storyteller_project'); | ||
$storyteller_project_name = isset($storyteller_project) ? $storyteller_project : ''; | ||
echo '<input name="storyteller_project" id="storytellerProject" type="text" value="' . $storyteller_project_name . '" />'; | ||
} | ||
|
||
function storyteller_apikey_setup() { | ||
$storyteller_apikey = get_option('storyteller_apikey'); | ||
$storyteller_key = isset($storyteller_apikey) ? $storyteller_apikey : ''; | ||
echo '<input name="storyteller_apikey" id="storytellerApiKey" type="text" value="' . $storyteller_key . '" />'; | ||
} | ||
|
||
function storyteller_proxyurl_setup() { | ||
$storyteller_proxyurl = get_option('storyteller_proxyurl'); | ||
$storyteller_url = isset($storyteller_proxyurl) ? $storyteller_proxyurl : 'http://proxy.storyteller.io/wordpress-rest-api/'; | ||
echo '<input name="storyteller_proxyurl" id="storytellerProxyUrl" type="text" value="' . $storyteller_url . '" />'; | ||
} | ||
|
||
function storyteller_settings_section_setup() { | ||
|
||
// Render settings html | ||
echo '<p>Enter Storyteller.io credentials to authenticate WordPress with Storyteller.</p>'; | ||
} |
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