-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
init.php
59 lines (55 loc) · 1.12 KB
/
init.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
<?php
/**
* Init hooks.
*
* @package gutenberg
*/
/**
* Gutenberg's Menu.
*
* Adds a new wp-admin menu page for the Gutenberg editor.
*
* @since 0.1.0
*/
function gutenberg_menu() {
add_menu_page(
__( 'Gutenberg', 'gutenberg' ),
__( 'Gutenberg', 'gutenberg' ),
'edit_posts',
'gutenberg',
'',
'dashicons-edit'
);
add_submenu_page(
'gutenberg',
__( 'Demo', 'gutenberg' ),
__( 'Demo', 'gutenberg' ),
'edit_posts',
'gutenberg'
);
if ( current_user_can( 'edit_posts' ) ) {
add_submenu_page(
'gutenberg',
__( 'Support', 'gutenberg' ),
__( 'Support', 'gutenberg' ),
'edit_posts',
__( 'https://wordpress.org/support/plugin/gutenberg/', 'gutenberg' )
);
add_submenu_page(
'gutenberg',
__( 'Documentation', 'gutenberg' ),
__( 'Documentation', 'gutenberg' ),
'edit_posts',
'https://developer.wordpress.org/block-editor/'
);
}
add_submenu_page(
'gutenberg',
__( 'Experiments Settings', 'gutenberg' ),
__( 'Experiments', 'gutenberg' ),
'manage_options',
'gutenberg-experiments',
'the_gutenberg_experiments'
);
}
add_action( 'admin_menu', 'gutenberg_menu', 9 );