-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclass-admin.php
More file actions
84 lines (78 loc) · 2.13 KB
/
Copy pathclass-admin.php
File metadata and controls
84 lines (78 loc) · 2.13 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
/**
* Admin class.
*
* @package WebberZone\Settings_API\Admin
*/
namespace WebberZone\Settings_API\Admin;
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
/**
* Class to initialise reusable admin features.
*
* @since 2.10.1
*/
class Admin {
/**
* Admin banner helper instance.
*
* @since 2.10.1
*
* @var Admin_Banner
*/
public Admin_Banner $admin_banner;
/**
* Main constructor class.
*
* @since 2.10.1
*/
public function __construct() {
$this->admin_banner = new Admin_Banner( $this->get_admin_banner_config() );
}
/**
* Retrieve the configuration array for the admin banner.
*
* @since 2.10.1
*
* @return array<string, mixed>
*/
private function get_admin_banner_config(): array {
return array(
'capability' => 'manage_options',
'prefix' => 'settings_api',
'style' => array(
'version' => Settings\Settings_API::VERSION,
),
'screen_ids' => array(
'settings_page_settings_api_options_page',
),
'page_slugs' => array(
'settings_api_options_page',
),
'strings' => array(
'region_label' => esc_html__( 'Settings API quick links', 'settings-api' ),
'nav_label' => esc_html__( 'Settings API admin shortcuts', 'settings-api' ),
'eyebrow' => esc_html__( 'WebberZone Settings API', 'settings-api' ),
'title' => esc_html__( 'Build consistent WordPress settings pages.', 'settings-api' ),
'text' => esc_html__( 'Manage plugin settings and explore more WebberZone plugins.', 'settings-api' ),
),
'sections' => array(
'settings' => array(
'label' => esc_html__( 'Settings', 'settings-api' ),
'url' => admin_url( 'options-general.php?page=settings_api_options_page' ),
'screen_ids' => array( 'settings_page_settings_api_options_page' ),
'page_slugs' => array( 'settings_api_options_page' ),
),
'plugins' => array(
'label' => esc_html__( 'WebberZone Plugins', 'settings-api' ),
'url' => 'https://webberzone.com/plugins/',
'type' => 'secondary',
'target' => '_blank',
'rel' => 'noopener noreferrer',
),
),
);
}
}