-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions-admin.php
More file actions
executable file
·54 lines (43 loc) · 1.73 KB
/
functions-admin.php
File metadata and controls
executable file
·54 lines (43 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
* Admin
*
*/
function sebl_settings() {
add_options_page('Simple Eventbrite List settings', 'Eventbrite', 'administrator', 'simple-eventbrite-list', 'sebl_settings_page');
}
function sebl_settings_data() {
register_setting('sebl_settings_group', 'sebl_token');
register_setting('sebl_settings_group', 'sebl_organiser');
}
function sebl_settings_page()
{
// admin
?>
<div class="wrap">
<h2>Simple Eventbrite List settings</h2>
<h3>Eventbrite Organiser ID and API token</h3>
<a href="https://www.eventbrite.com/developer/v3/quickstart/" target="_blank">Eventbrite API quick start documentation</a><br>
<a href="https://www.eventbrite.com/developer/v3/api_overview/authentication/" target="_blank">Eventbrite API token documentation</a>
<form method="post" action="options.php" novalidate="novalidate">
<?php settings_fields( 'sebl_settings_group' ); ?>
<?php do_settings_sections( 'sebl_settings_group' ); ?>
<table class="form-table">
<tr valign="top">
<th scope="row"><label for="sebl_organiser">Organiser ID</label></th>
<td><input type="text" name="sebl_organiser" value="<?php echo esc_attr( get_option('sebl_organiser') ); ?>" /></td>
</tr>
<tr valign="top">
<th scope="row"><label for="sebl_token">API token</label></th>
<td><input type="text" name="sebl_token" value="<?php echo esc_attr( get_option('sebl_token') ); ?>" /></td>
</tr>
</table>
<?php submit_button(); ?>
</form>
<h3>Usage</h3>
<p>Default (Displays 6 events): [simple-eventbrite]</p>
<p>Number of events displayed: [simple-eventbrite numberevents=12]</p>
<p>Category: [simple-eventbrite numberevents=12 category=115]</p>
</div>
<?php
}