Problems with PHP code
-
Ok so I’m having some trouble with some php code. I mean it works fine when it’s in a template overide file directly. But if I try to add it to my functions.php with with an add_action and custom function it null’s out. I don’t understand what’s going on but maybe someone can help me here.
So below is the specific line of code I’m having trouble with. If place directly in to woocommerce order-details.php template file or email-order-details.php it works perfectly fine but one used in functions.php with an add_action it nulls out.
$totalVal = preg_replace('/[^0-9.]/u', '', html_entity_decode($total['value']));
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Problems with PHP code’ is closed to new replies.