This repository has been archived by the owner on Nov 4, 2023. It is now read-only.
-
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 #5 from ycfreeman/develop
Develop
- Loading branch information
Showing
7 changed files
with
237 additions
and
65 deletions.
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 |
---|---|---|
|
@@ -3,4 +3,5 @@ | |
# Created by .ignore support plugin (hsz.mobi) | ||
|
||
lib/wowss/*_*.png | ||
wowss-*.xml | ||
wowss-*.xml | ||
wowss-*.json |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,67 @@ | ||
<?php | ||
/** | ||
* Widget Admin Page | ||
*/ | ||
add_action('admin_init', 'wow_ss_options_init'); | ||
add_action('admin_menu', 'wow_ss_options_add_page'); | ||
|
||
// Init plugin options to white list our options | ||
function wow_ss_options_init() | ||
{ | ||
register_setting('wow_ss_options_options', PLUGIN_OPTION_KEY, 'wow_ss_options_validate'); | ||
} | ||
|
||
// Add menu page | ||
function wow_ss_options_add_page() | ||
{ | ||
add_options_page('WOW Server Status Widget Options', 'WOW Server Status Widget', 'manage_options', 'wow_ss_options', 'wow_ss_options_do_page'); | ||
} | ||
|
||
// Draw the menu page itself | ||
function wow_ss_options_do_page() | ||
{ | ||
?> | ||
<div class="wrap"> | ||
<div id="icon-options-general" class="icon32"> | ||
<br> | ||
</div> | ||
<h2> | ||
WOW Recruit Widget Options | ||
</h2> | ||
|
||
<p> | ||
<a href="<?php echo WSS_BUG_URL; ?>" target="_blank"> | ||
<img style="vertical-align: middle;" | ||
src="<?php echo plugins_url( "../images/ic_bug_report.svg", __FILE__ ); ?>" | ||
alt="report bugs"/>Report Bugs</a></p> | ||
|
||
<p><em>To use this widget, you need a Battle.net API key, get one at <a href="https://dev.battle.net/" target="_blank">dev.battle.net</a>.</em></p> | ||
<form method="post" action="options.php"> | ||
<?php settings_fields('wow_ss_options_options'); ?> | ||
<?php $options = get_option(PLUGIN_OPTION_KEY); ?> | ||
<table class="form-table"> | ||
<tr valign="top"> | ||
<th scope="row">Blizzard Developer API Key</th> | ||
<td><input style="width:100%;" type="text" name="<?php echo PLUGIN_OPTION_KEY;?>[api_key]" | ||
value="<?php echo $options['api_key']; ?>"/></td> | ||
</tr> | ||
</table> | ||
<p class="submit"> | ||
<input type="submit" class="button-primary" | ||
value="<?php _e('Save Changes') ?>"/> | ||
</p> | ||
</form> | ||
</div> | ||
<?php | ||
} | ||
|
||
// Sanitize and validate input. Accepts an array, return a sanitized array. | ||
function wow_ss_options_validate($input) | ||
{ | ||
|
||
foreach ($input as $k => $v) { | ||
$input[$k] = wp_filter_nohtml_kses($v); | ||
} | ||
|
||
return $input; | ||
} |
Oops, something went wrong.