WC_Admin_Addons::get_extension_data( string $category, string $term, string $country )

Call API to get extensions


Description Description


Parameters Parameters

$category

(Required) Addon (sub) category.

$term

(Required) Search terms.

$country

(Required) Store country.


Top ↑

Return Return

(array) of extensions


Top ↑

Source Source

File: includes/admin/class-wc-admin-addons.php

	public static function get_extension_data( $category, $term, $country ) {
		$parameters     = self::build_parameter_string( $category, $term, $country );
		$raw_extensions = wp_remote_get(
			'https://woocommerce.com/wp-json/wccom-extensions/1.0/search' . $parameters
		);
		if ( ! is_wp_error( $raw_extensions ) ) {
			$addons = json_decode( wp_remote_retrieve_body( $raw_extensions ) )->products;
		}
		return $addons;
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.