Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
66.67% covered (warning)
66.67%
4 / 6
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
DIFM_Lite_Admin_Menu
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 reregister_menu_items
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2/**
3 * DIFM Lite (Express) Admin Menu file.
4 *
5 * @package automattic/jetpack-masterbar
6 */
7
8namespace Automattic\Jetpack\Masterbar;
9
10if ( ! defined( 'ABSPATH' ) ) {
11    exit( 0 );
12}
13
14/**
15 * Class DIFM_Lite_Admin_Menu.
16 *
17 * The admin menu shown while a DIFM Express build is still awaiting the
18 * customer's content. It is the domain-only menu plus Posts, Media and Pages:
19 * the customer needs to read their existing content to fill in the content
20 * form, but the site is otherwise locked for the duration of the build.
21 *
22 * Once the content is submitted the build is under way and
23 * Domain_Only_Admin_Menu applies instead.
24 */
25class DIFM_Lite_Admin_Menu extends Domain_Only_Admin_Menu {
26    /**
27     * Create the desired menu output.
28     */
29    public function reregister_menu_items() {
30        parent::reregister_menu_items();
31
32        // @phan-suppress-next-line PhanTypeMismatchArgumentProbablyReal -- Core should ideally document null for no-callback arg. https://core.trac.wordpress.org/ticket/52539.
33        add_menu_page( esc_attr__( 'Posts', 'jetpack-masterbar' ), __( 'Posts', 'jetpack-masterbar' ), 'edit_posts', 'edit.php', null, 'dashicons-admin-post' );
34        // @phan-suppress-next-line PhanTypeMismatchArgumentProbablyReal -- Core should ideally document null for no-callback arg. https://core.trac.wordpress.org/ticket/52539.
35        add_menu_page( esc_attr__( 'Media', 'jetpack-masterbar' ), __( 'Media', 'jetpack-masterbar' ), 'upload_files', 'upload.php', null, 'dashicons-admin-media' );
36        // @phan-suppress-next-line PhanTypeMismatchArgumentProbablyReal -- Core should ideally document null for no-callback arg. https://core.trac.wordpress.org/ticket/52539.
37        add_menu_page( esc_attr__( 'Pages', 'jetpack-masterbar' ), __( 'Pages', 'jetpack-masterbar' ), 'edit_pages', 'edit.php?post_type=page', null, 'dashicons-admin-page' );
38    }
39}