Skip to content
This repository has been archived by the owner on Nov 4, 2023. It is now read-only.

Commit

Permalink
Merge pull request #5 from ycfreeman/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ycfreeman committed Apr 4, 2016
2 parents 51201d5 + ce4bbaa commit 55614fd
Show file tree
Hide file tree
Showing 7 changed files with 237 additions and 65 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
# Created by .ignore support plugin (hsz.mobi)

lib/wowss/*_*.png
wowss-*.xml
wowss-*.xml
wowss-*.json
117 changes: 78 additions & 39 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ language: php
php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0

env:
- WP_VERSION=latest WP_MULTISITE=0
- WP_VERSION=latest WP_MULTISITE=1
- WP_VERSION=3.7 WP_MULTISITE=0
- WP_VERSION=3.7 WP_MULTISITE=1

before_script:
- bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
Expand Down
67 changes: 67 additions & 0 deletions inc/admin.php
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;
}
Loading

0 comments on commit 55614fd

Please sign in to comment.