-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.php
executable file
·63 lines (53 loc) · 1.21 KB
/
settings.php
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
55
56
57
58
59
60
61
62
63
<?php
$token = get_option('ydapip_token');
if (isset($_POST['submit'])) {
if (!current_user_can('manage_options'))
die();
if (function_exists('check_admin_referer'))
check_admin_referer('ydapip_form');
$token = $_POST['token'];
update_option('ydapip_token', $token);
}
?>
<div class="wrap">
<h1><?php _e('Yandex.Disk API Provider Settings', 'ydapip'); ?></h1>
<form method="post">
<?php
if ( function_exists('wp_nonce_field') ) {
wp_nonce_field('ydapip_form');
}
?>
<p>
<?php echo sprintf(
__('You can learn about plugin setup on %splugin homepage%s.', 'ydapip'),
'<a href="https://github.com/aslanbaryshnikov/yd-api-provider" target="_blank">',
'</a>'
); ?>
</p>
<table class="form-table">
<tr valign="top">
<th scope="row">
<label for="token">
<?php _e('OAuth token', 'ydapip'); ?>:
</label>
</th>
<td>
<input
class="regular-text"
type="text"
id="token"
name="token"
value="<?php echo $token; ?>">
</td>
</tr>
</table>
<p class="submit">
<input
type="submit"
name="submit"
id="submit"
class="button button-primary"
value="<?php _e('Save changes'); ?>">
</p>
</form>
</div>