Automattic\WooCommerce\Admin
WCAdminHelper::get_url_from_wp
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() WCAdminHelper::get url from wp code WC 10.7.0
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 ) );
}