| 1 |
<?php |
| 2 |
|
| 3 |
defined( 'ABSPATH' ) || exit; |
| 4 |
|
| 5 |
/** |
| 6 |
* Removes the tracking ID field for specific affiliate networks. |
| 7 |
* |
| 8 |
* Filters whether a network supports tracking IDs by checking if the network's |
| 9 |
* group ID is in a predefined list of networks that should not show the |
| 10 |
* tracking ID field. |
| 11 |
* |
| 12 |
* @since 1.3.23 |
| 13 |
* |
| 14 |
* @param bool $supports_tracking_id Whether the network supports tracking IDs. |
| 15 |
* @param array $network The network data array. |
| 16 |
* |
| 17 |
* @return bool Whether the network should support tracking IDs. |
| 18 |
*/ |
| 19 |
function dfrapi_remove_tracking_id_field_for_specific_networks( bool $supports_tracking_id, array $network ): bool { |
| 20 |
|
| 21 |
$group_ids = [ |
| 22 |
10055, // PriceRunner |
| 23 |
]; |
| 24 |
|
| 25 |
if ( in_array( $network['group_id'], $group_ids ) ) { |
| 26 |
$supports_tracking_id = false; |
| 27 |
} |
| 28 |
|
| 29 |
return $supports_tracking_id; |
| 30 |
} |
| 31 |
|
| 32 |
add_filter( 'dfrapi_network_supports_tracking_id', 'dfrapi_remove_tracking_id_field_for_specific_networks', 10, 2 ); |
| 33 |
|