Tag Info

Hot answers tagged

1

The syntax for adding an action in WordPress WITHIN a class is somewhat different. Your code will have to look somewhat more like the following... class MyPluginClass { public function __construct() { add_action( 'init', array( $this, 'sample_insert_category') ); } public function sample_insert_category() { ...


1

Not sure what the WC_Email class does exactly, but if the $headers argument is an array of headers, then you're almost there. To interpolate a variable value into a string in PHP you don't have to do the <?php ... stuff because it'll be rendered as is. Instead, you can use: $headers = array( "Reply-To: {$order->billing_email}" ); Or: $headers = ...


1

It's on the Tax settings page and is wp_options.woocommerce_price_display_suffix in the database. Please use the official site for WooCommerce and third-party plugin support, rather than StackExchange.


1

I just made it for a client, you'll have to do it on the pre_get_posts action. That means you will add parameters to the Wordpress query before it returns the posts. Add this to functions.php: // advanced search functionality function advanced_search_query($query) { if($query->is_search()) { // category terms search. if ...


1

Another option would be to use the current_screen hook add_action( 'current_screen', 'my_admin_listing_custom_styles' ); function my_admin_listing_custom_styles() { $current_screen = get_current_screen(); if( 'edit' == $current_screen->base && 'product' == $current_screen->post_type) { // Run some code, only on the admin ...


1

I finally tried using var_dump() on $item and $_product, which are both used in the email-order-items.php template. $_product revealed a post object, which itself has a post_excerpt property, which looks like it holds the contents of the "Product Short Description" from the WooCommerce product form. So, to add the description beneath the item name, I added ...



Only top voted, non community-wiki answers of a minimum length are eligible