Skip to content
Advertisement

Tag: wordpress

How to append meta data to a third party coupon, dynamically?

I need to add a meta_data field to a coupon of a third party plugin, dynamically when it’s loaded. WooCommerce uses the filter woocommerce_get_shop_coupon_data so another plugin can react to it. In class-wc-cart.php the coupon is returned like this: $code is the coupon code as string. So in class-wc-coupon.php (WC_Coupon class) it will apply the filter woocommerce_get_shop_coupon_data and set the

wpdb query gives back a wrong result

I’ve written some code in my PHP snippet which is on my WordPress page and the wpdb query gives me always a wrong result. In WordPress In SQL phpmyadmin displayed 3 which is the correct result for that query What did I do wrong? May you help me in someway? Answer The reason why you’re getting 1 as a result

Multiple Toggles In A Post Loop

I’ve created a simple toggle to reveal and close a food menu. However as this is in a Wordpress Loop only the first one works. I’m guessing because as the page builds itself out there then become multiple ID’s. However I can’t find anyway to tweak the JQuery / JS to not use ID’s. Any Ideas?? The foodMenuName just swaps

Advertisement