Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 15 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| Admin_Page | |
0.00% |
0 / 15 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 1 |
| enqueue | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| register | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
2 | |||
| render | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Automattic\Jetpack_Inspect; |
| 4 | |
| 5 | class Admin_Page { |
| 6 | public function enqueue() { |
| 7 | wp_enqueue_script( 'jetpack-inspect-main', plugins_url( '../app-ui/build/jetpack-inspect.js', __FILE__ ), array(), '1.0.0', true ); |
| 8 | wp_enqueue_style( 'jetpack-inspect-css', plugins_url( '../app-ui/build/jetpack-inspect.css', __FILE__ ), array(), '1.0.0' ); |
| 9 | } |
| 10 | |
| 11 | /** |
| 12 | * Create an admin menu item for Jetpack Boost Svelte edition. |
| 13 | */ |
| 14 | public function register() { |
| 15 | $title = __( 'Jetpack Inspect', 'jetpack-inspect' ); |
| 16 | |
| 17 | $page = add_menu_page( |
| 18 | $title, |
| 19 | $title, |
| 20 | 'manage_options', |
| 21 | 'jetpack-inspect', |
| 22 | array( $this, 'render' ), |
| 23 | 'dashicons-hammer', |
| 24 | 50 |
| 25 | ); |
| 26 | |
| 27 | add_action( 'load-' . $page, array( $this, 'enqueue' ) ); |
| 28 | } |
| 29 | |
| 30 | public function render() { |
| 31 | ?> |
| 32 | <div id="jetpack-inspect"></div> |
| 33 | <?php |
| 34 | } |
| 35 | } |