Automattic\WooCommerce\Admin
PageController::get_current_page
Get the current page.
Method of the class: PageController{}
No Hooks.
Returns
Array|true|false. Current page or false if not registered with this controller.
Usage
$PageController = new PageController(); $PageController->get_current_page();
PageController::get_current_page() PageController::get current page code WC 10.4.3
public function get_current_page() {
// If 'current_screen' hasn't fired yet, the current page calculation
// will fail which causes `false` to be returned for all subsequent calls.
if ( ! did_action( 'current_screen' ) ) {
_doing_it_wrong( __FUNCTION__, esc_html__( 'Current page retrieval should be called on or after the `current_screen` hook.', 'woocommerce' ), '0.16.0' );
}
if ( is_null( $this->current_page ) ) {
$this->determine_current_page();
}
return $this->current_page;
}