Automattic\WooCommerce\Admin

WCAdminHelper::get_url_from_wpprivate staticWC 1.0

Builds the relative URL from the WP instance.

Method of the class: WCAdminHelper{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = WCAdminHelper::get_url_from_wp( $wp );
$wp(WP) (required)
WordPress environment instance.

WCAdminHelper::get_url_from_wp() code WC 9.9.4

private static function get_url_from_wp( \WP $wp ) {
	// Initialize query vars if they haven't been set.
	if ( empty( $wp->query_vars ) || empty( $wp->request ) ) {
		$wp->parse_request();
	}

	return home_url( add_query_arg( $wp->query_vars, $wp->request ) );
}