block-supports
2 years ago
compat
2 years ago
experimental
2 years ago
README.md
2 years ago
block-editor-settings.php
2 years ago
blocks.php
2 years ago
class-wp-duotone-gutenberg.php
2 years ago
class-wp-theme-json-data-gutenberg.php
2 years ago
class-wp-theme-json-gutenberg.php
2 years ago
class-wp-theme-json-resolver-gutenberg.php
2 years ago
client-assets.php
2 years ago
demo.php
2 years ago
experiments-page.php
2 years ago
global-styles-and-settings.php
2 years ago
init.php
2 years ago
load.php
2 years ago
script-loader.php
2 years ago
theme-i18n.json
2 years ago
theme.json
2 years ago
upgrade.php
2 years ago
init.php
60 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Init hooks. |
| 4 | * |
| 5 | * @package gutenberg |
| 6 | */ |
| 7 | |
| 8 | /** |
| 9 | * Gutenberg's Menu. |
| 10 | * |
| 11 | * Adds a new wp-admin menu page for the Gutenberg editor. |
| 12 | * |
| 13 | * @since 0.1.0 |
| 14 | */ |
| 15 | function gutenberg_menu() { |
| 16 | add_menu_page( |
| 17 | 'Gutenberg', |
| 18 | 'Gutenberg', |
| 19 | 'edit_posts', |
| 20 | 'gutenberg', |
| 21 | '', |
| 22 | 'dashicons-edit' |
| 23 | ); |
| 24 | |
| 25 | add_submenu_page( |
| 26 | 'gutenberg', |
| 27 | __( 'Demo', 'gutenberg' ), |
| 28 | __( 'Demo', 'gutenberg' ), |
| 29 | 'edit_posts', |
| 30 | 'gutenberg' |
| 31 | ); |
| 32 | |
| 33 | if ( current_user_can( 'edit_posts' ) ) { |
| 34 | add_submenu_page( |
| 35 | 'gutenberg', |
| 36 | __( 'Support', 'gutenberg' ), |
| 37 | __( 'Support', 'gutenberg' ), |
| 38 | 'edit_posts', |
| 39 | __( 'https://wordpress.org/support/plugin/gutenberg/', 'gutenberg' ) |
| 40 | ); |
| 41 | add_submenu_page( |
| 42 | 'gutenberg', |
| 43 | __( 'Documentation', 'gutenberg' ), |
| 44 | __( 'Documentation', 'gutenberg' ), |
| 45 | 'edit_posts', |
| 46 | 'https://developer.wordpress.org/block-editor/' |
| 47 | ); |
| 48 | } |
| 49 | |
| 50 | add_submenu_page( |
| 51 | 'gutenberg', |
| 52 | __( 'Experiments Settings', 'gutenberg' ), |
| 53 | __( 'Experiments', 'gutenberg' ), |
| 54 | 'edit_posts', |
| 55 | 'gutenberg-experiments', |
| 56 | 'the_gutenberg_experiments' |
| 57 | ); |
| 58 | } |
| 59 | add_action( 'admin_menu', 'gutenberg_menu', 9 ); |
| 60 |