Hey @matthijscremers sorry you’re running into an issue! Can you confirm if you’re using the latest version? We released two in succession and the latest one should have fixed this issue. (But please confirm and send the version number!)
I checked the plugin source code to see where it’s coming from and in the array with allowed php and wordpress functions is_product_category, term_is_ancestor_of & get_queried_object_id are missing.
Is this done with a reason? We used above condition to determine if we are on Woocommerce product category X, or on a child-category of this parent product category.
Sorry to hear that you ran into these issues while moving your logic code to the new snippet system.
This error occurs because the functions you were using are not included in the list of allowed WordPress/PHP functions. To enable these functions again, please add the following filter to your functions.php file:
function add_extra_hooks( $allowed_functions ) { // Add your custom functions here $allowed_functions[] = 'is_product_category'; $allowed_functions[] = 'term_is_ancestor_of'; $allowed_functions[] = 'get_queried_object_id';
Please make sure to add this filter to your functions.php file before migrating or adding the code again in the Widget Options Snippets page.
I’ve also included a screenshot below for your reference, showing that the code you provided is no longer producing any errors.
We reduced the list of allowed WordPress and PHP functions to help prevent potential vulnerabilities, which is why some functions now need to be manually added through a filter.