WooCommerce Admin Only Email Hook

The hook woocommerce_email_order_details has 4 parameters which can help you to identify the correct message. add_action( ‘woocommerce_email_order_details’, ‘so274215_add_transaction_id’, 10, 4); function so274215_add_transaction_id( $order, $sent_to_admin, $plain_text, $email ){ // decide here wether to show your transaction id if ( ! $sent_to_admin ) echo ‘<span style=”color:#555;font-size:1.5em;”>Transaction ID: ‘.get_post_meta( $order->id, “_transaction_id”, true ).'</span>’; } As far as I … Read more

display cart information within li of cart menu item

The items in the $fragments array will replace the html contents of the element you specify as the key. In your example $fragments[‘li.menu-item-type-woocommerce-cart’] = ‘some html’; some html will be inserted in the DOM element <li class=”menu-item-type-woocommerce-cart”> Here is the Javascript: $( ‘li.menu-item-type-woocommerce-cart’ ).replaceWith( ‘some html’ ); Is there already such an element in your … Read more

How to hook into creating a category?

There is a hook that can be used for any taxonomy, create_{$taxonomy}, which in your case, is a category. So, it would be create_category: add_action( ‘create_category’, ‘my_function’, 10, 1 ); This is triggered by wp_insert_term() at line 2142.