Automattic\WooCommerce\Internal\Admin\WCPayPromotion
WCPayPromotionDataSourcePoller::get_data_sources
Get data sources.
Method of the class: WCPayPromotionDataSourcePoller{}
No Hooks.
Returns
Array.
Usage
$result = WCPayPromotionDataSourcePoller::get_data_sources();
WCPayPromotionDataSourcePoller::get_data_sources() WCPayPromotionDataSourcePoller::get data sources code WC 10.5.0
public static function get_data_sources() {
$data_sources = array(
WC_Helper::get_woocommerce_com_base_url() . 'wp-json/wccom/payment-gateway-suggestions/2.0/payment-method/promotions.json',
);
// Add country query param to data sources.
$base_location = wc_get_base_location();
$data_sources_with_country = array_map(
function ( $url ) use ( $base_location ) {
return add_query_arg(
'country',
$base_location['country'],
$url
);
},
$data_sources
);
return $data_sources_with_country;
}