forked from fxbenard/test1
/
options.php
48 lines (45 loc) · 968 Bytes
/
options.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
<?php
defined( 'ABSPATH' ) or die( 'Cheatin’ uh?' );
/**
* Add plugin page
*
* @since 1.0
*/
if ( ! function_exists( 'fx_trads_license_menu' ) ) {
function fx_trads_license_menu() {
add_plugins_page(
__( 'FX Trads License Options', 'test1' ),
__( 'FX Trads', 'test1' ),
'manage_options',
'fx-trads-license',
'fx_trads_license_page'
);
}
add_action( 'admin_menu', 'fx_trads_license_menu' );
}
/**
* Register section / field for plugin page
*
* @since 1.2
*/
add_action( 'admin_init', 'test_1_license_init_page' );
function test_1_license_init_page() {
register_setting(
'fx_trads_license',
'test_1_license_key',
'test_1_sanitize_license'
);
add_settings_section(
'section-test-1',
'',
'',
'fx-trads-license'
);
add_settings_field(
'test_1_key',
TEST_1_ITEM_NICE_NAME,
'test_1_key_callback',
'fx-trads-license',
'section-test-1'
);
}