wrong result from EDD_Downloads_As_Services->is_service
-
Hello,
I have noticed that EDD_Downloads_As_Services->is_service returns true when I assign any download category to product (without any downloads). Checkbox This download is a service is not checked. In settings there is no categories marked as ‘SaaS’ categories. When I have added other category and marked it as ‘SaaS’ category and tested above scenario everything worked as it should. I guess this issue comes from taxonomy.php andif ( empty( $terms ) ) return ( !empty( $object_terms ) );
When has_term has empty array as first parameter and object has associated any other term (in this case other category not marked as SaaS category) it return true
if ( $is_service || has_term( $term_ids, 'download_category', $item_id ) ) { return true; }
$is_service is false but has_term with empty array as $terms_id returns true
Lukas
https://www.ads-software.com/plugins/edd-downloads-as-services/
- The topic ‘wrong result from EDD_Downloads_As_Services->is_service’ is closed to new replies.