Automattic\WooCommerce\Internal\LegacyAssets
LegacySelect2UsageTracker::get_current_page_type
Get the current page type.
Method of the class: LegacySelect2UsageTracker{}
No Hooks.
Returns
string.
Usage
// private - for code of main (parent) class only $result = $this->get_current_page_type( $context ): string;
- $context(string) (required)
- The request context.
LegacySelect2UsageTracker::get_current_page_type() LegacySelect2UsageTracker::get current page type code WC 11.2.1
private function get_current_page_type( string $context ): string {
if ( self::CONTEXT_ADMIN === $context ) {
return $this->get_current_screen_id();
}
if ( self::CONTEXT_FRONTEND === $context ) {
return $this->get_current_frontend_page_type();
}
return '';
}