-
Notifications
You must be signed in to change notification settings - Fork 384
/
Copy pathclass-amp-analytics-options-submenu.php
61 lines (54 loc) · 1.27 KB
/
class-amp-analytics-options-submenu.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
<?php
/**
* Class AMP_Analytics_Options_Submenu
*
* @package AMP
*/
/**
* Class AMP_Analytics_Options_Submenu
*/
class AMP_Analytics_Options_Submenu {
private $parent_menu_slug;
private $menu_slug;
private $menu_page;
public function __construct( $parent_menu_slug ) {
$this->parent_menu_slug = $parent_menu_slug;
$this->menu_slug = 'amp-analytics-options';
$this->menu_page = new AMP_Analytics_Options_Submenu_Page();
}
public function init() {
$this->add_submenu();
add_action(
'admin_print_styles-amp_page_' . $this->menu_slug,
array( $this, 'amp_options_styles' )
);
}
private function add_submenu() {
add_submenu_page(
$this->parent_menu_slug,
__( 'AMP Analytics Options', 'amp' ),
__( 'Analytics', 'amp' ),
'manage_options',
$this->menu_slug,
array( $this->menu_page, 'render' )
);
}
public function amp_options_styles() {
?>
<style>
.analytics-data-container .button.delete,
.analytics-data-container .button.delete:hover,
.analytics-data-container .button.delete:active,
.analytics-data-container .button.delete:focus {
background: red;
border-color: red;
text-shadow: 0 0 0;
margin: 0 5px;
}
.amp-analytics-options.notice {
width: 300px;
}
</style>;
<?php
}
}