Send a custom notification to customer on WooCommerce cancelled order status

A better solution will be to use all arguments included in woocommerce_order_status_cancelled hooked function, so the missing $order variable. Also as the action hook woocommerce_order_status_cancelled is triggered when order status change to “cancelled”, so in your code, if ($order->has_status(‘cancelled’)) { is not needed. Then your code will be: add_filter(‘woocommerce_order_status_cancelled’, ‘woocommerce_send_mail_abandonned_order’, 10, 2 ); function woocommerce_send_mail_abandonned_order( … Read more

NextGEN Gallery: Adding drop-down menu widget to gallery view without modifying plugin code [closed]

There aren’t really any good filters/hooks that are going to allow you to place the custom drop down control where you’d like. What you should do instead is create a new template from an existing one, then add your widget code in. I’m going to edit “gallery.php”, but you must edit album.php or whichever gallery … Read more

How do I change TinyMCE button “i” to create a i tag rather than em? [duplicate]

Here’s a simple function that will replace <em> with <i> on your post/page: function replace_em_with_i($content) { $content = str_replace(‘<em>’, ‘<i>’, $content); $content = str_replace(‘</em>’, ‘</i>’, $content); return $content; } add_filter(‘the_content’, ‘replace_em_with_i’); Warning: I have tested the code to check if it works (and it does work), but you might want to do some serious testing … Read more

Best hook for a function which adds shortcodes to the system?

If I’m following things correctly, I think the problem is that your shortcode callback echoes, rather than returns its content – and that you have it set up that way in order for the shortcode content to output outside of the post content. If that’s the case, you’re taking the wrong approach. Your shortcode callback … Read more