PHP Error in WP hook function 7.3.5
-
Hello,
Issue found in 7.3.5
In mollie-payments-for-woocommerce/src/Gateway/Voucher/VoucherModule.php
you added an action for both ‘edited_product_cat’ and ‘create_product_cat’ and run the voucherTaxonomyCustomMetaSave method as callback for the hook.
in the voucherTaxonomyCustomMetaSave method you also have the following line of code:
$metaOption = sanitize_text_field(wp_unslash($_POST([‘_mollie_voucher_category’])));
line 204 in the file.
This has an error in it, if we split the code we can see this:
$_POST([‘_mollie_voucher_category’]) in which you use $_POST as a function not as a variable so the ( ) are extra ( and cause an error ).
It should most likely be $_POST[‘_mollie_voucher_category’].
Also in this method you should probably check if $_POST has the key you are trying to use before using it as it might throw warnings in the logs.
Thank you.
- The topic ‘PHP Error in WP hook function 7.3.5’ is closed to new replies.