2019-05-07 18:42:42 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2019-08-12 21:52:09 +00:00
|
|
|
* Convenience functions for PageController.
|
2019-05-07 18:42:42 +00:00
|
|
|
*
|
2020-08-11 19:18:47 +00:00
|
|
|
* @package WooCommerce\Admin
|
2019-05-07 18:42:42 +00:00
|
|
|
*/
|
|
|
|
|
2019-08-12 21:52:09 +00:00
|
|
|
use Automattic\WooCommerce\Admin\PageController;
|
2019-07-31 18:16:56 +00:00
|
|
|
|
2019-05-08 14:41:35 +00:00
|
|
|
/**
|
|
|
|
* Connect an existing page to WooCommerce Admin.
|
2019-08-12 21:52:09 +00:00
|
|
|
* Passthrough to PageController::connect_page().
|
2019-05-08 14:41:35 +00:00
|
|
|
*
|
2019-08-12 21:52:09 +00:00
|
|
|
* @param array $options Options for PageController::connect_page().
|
2019-05-08 14:41:35 +00:00
|
|
|
*/
|
|
|
|
function wc_admin_connect_page( $options ) {
|
2019-08-12 21:52:09 +00:00
|
|
|
$controller = PageController::get_instance();
|
2019-05-08 14:41:35 +00:00
|
|
|
$controller->connect_page( $options );
|
|
|
|
}
|
|
|
|
|
2019-05-07 18:42:42 +00:00
|
|
|
/**
|
|
|
|
* Register JS-powered WooCommerce Admin Page.
|
2019-08-12 21:52:09 +00:00
|
|
|
* Passthrough to PageController::register_page().
|
2019-05-07 18:42:42 +00:00
|
|
|
*
|
2019-08-12 21:52:09 +00:00
|
|
|
* @param array $options Options for PageController::register_page().
|
2019-05-07 18:42:42 +00:00
|
|
|
*/
|
|
|
|
function wc_admin_register_page( $options ) {
|
2019-08-12 21:52:09 +00:00
|
|
|
$controller = PageController::get_instance();
|
2019-05-07 18:42:42 +00:00
|
|
|
$controller->register_page( $options );
|
|
|
|
}
|
2019-05-07 22:08:18 +00:00
|
|
|
|
2019-05-08 14:41:35 +00:00
|
|
|
/**
|
|
|
|
* Is this page connected to WooCommerce Admin?
|
2019-08-12 21:52:09 +00:00
|
|
|
* Passthrough to PageController::is_connected_page().
|
2019-05-08 14:41:35 +00:00
|
|
|
*
|
|
|
|
* @return boolean True if the page is connected to WooCommerce Admin.
|
|
|
|
*/
|
|
|
|
function wc_admin_is_connected_page() {
|
2019-08-12 21:52:09 +00:00
|
|
|
$controller = PageController::get_instance();
|
2019-05-08 14:41:35 +00:00
|
|
|
return $controller->is_connected_page();
|
|
|
|
}
|
|
|
|
|
2019-05-07 22:08:18 +00:00
|
|
|
/**
|
|
|
|
* Is this a WooCommerce Admin Page?
|
2019-08-12 21:52:09 +00:00
|
|
|
* Passthrough to PageController::is_registered_page().
|
2019-05-07 22:08:18 +00:00
|
|
|
*
|
|
|
|
* @return boolean True if the page is a WooCommerce Admin page.
|
|
|
|
*/
|
|
|
|
function wc_admin_is_registered_page() {
|
2019-08-12 21:52:09 +00:00
|
|
|
$controller = PageController::get_instance();
|
2019-05-07 22:08:18 +00:00
|
|
|
return $controller->is_registered_page();
|
|
|
|
}
|
2019-05-08 14:41:35 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get breadcrumbs for WooCommerce Admin Page navigation.
|
2019-08-12 21:52:09 +00:00
|
|
|
* Passthrough to PageController::get_breadcrumbs().
|
2019-05-08 14:41:35 +00:00
|
|
|
*
|
|
|
|
* @return array Navigation pieces (breadcrumbs).
|
|
|
|
*/
|
|
|
|
function wc_admin_get_breadcrumbs() {
|
2019-08-12 21:52:09 +00:00
|
|
|
$controller = PageController::get_instance();
|
2019-05-08 14:41:35 +00:00
|
|
|
return $controller->get_breadcrumbs();
|
|
|
|
}
|