Automattic\WooCommerce\Internal\Admin

Survey::get_url()public staticWC 1.0

Get a survey's URL from a path.

Method of the class: Survey{}

Hooks from the method

Return

String. Full URL to survey.

Usage

$result = Survey::get_url( $path, $query );
$path(string) (required)
Path of the survey.
$query(array)
Query arguments as key value pairs.
Default: array()

Survey::get_url() code WC 8.7.0

public static function get_url( $path, $query = array() ) {
	$url = self::SURVEY_URL . $path;

	$query_args = apply_filters( 'woocommerce_admin_survey_query', $query );

	if ( ! empty( $query_args ) ) {
		$query_string = http_build_query( $query_args );
		$url          = $url . '?' . $query_string;
	}

	return $url;
}