Automattic\WooCommerce\Internal\Admin

Homescreen::register_page()publicWC 1.0

Registers home page.

Метод класса: Homescreen{}

No Hooks.

Return

null. Nothing.

Usage

$Homescreen = new Homescreen();
$Homescreen->register_page();

Code of Homescreen::register_page() WC 7.1.0

public function register_page() {
	// Register a top-level item for users who cannot view the core WooCommerce menu.
	if ( ! self::is_admin_user() ) {
		wc_admin_register_page(
			array(
				'id'         => 'woocommerce-home',
				'title'      => __( 'WooCommerce', 'woocommerce' ),
				'path'       => self::MENU_SLUG,
				'capability' => 'read',
			)
		);
		return;
	}

	wc_admin_register_page(
		array(
			'id'         => 'woocommerce-home',
			'title'      => __( 'Home', 'woocommerce' ),
			'parent'     => 'woocommerce',
			'path'       => self::MENU_SLUG,
			'order'      => 0,
			'capability' => 'read',
		)
	);
}