forked from SadeghPM/xmenplayer-wordpress
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsettings_video.php
57 lines (54 loc) · 1.77 KB
/
settings_video.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
<?php
trait settings_video
{
public function register_settings()
{
register_setting(
"xmenplayer_plugin_options",
"xmenplayer_plugin_api_token"
);
}
public function settings_page()
{
$data = [];
if (!empty($this->token)) {
$data = $this->request("/user");
if (empty($data)) {
add_settings_error(
"xmenplayer_plugin_options",
"settings_updated",
__("Error in getting token information", "xmenplayer"),
"error"
);
}
}
?>
<h1><?php _e("Settings Page", "xmenplayer"); ?></h1>
<?php settings_errors("xmenplayer_plugin_options"); ?>
<div><?= isset($data["name"])
? __("API user:", "xmenplayer") . " " . $data["name"]
: "" ?></div>
<form action="options.php" method="post">
<?php
settings_fields("xmenplayer_plugin_options");
do_settings_sections("xmenplayer_plugin_options");
?>
<table class="form-table">
<tr valign="top">
<th scope="row"><?php _e(
"API Token:",
"xmenplayer"
); ?></th>
<td>
<input type="text" name="xmenplayer_plugin_api_token" style="width: 80%" dir="ltr"
value="<?php echo esc_attr(
get_option("xmenplayer_plugin_api_token")
); ?>"/>
</td>
</tr>
</table>
<?php submit_button(__("Save Changes", "xmenplayer")); ?>
</form>
<?php
}
}