How to exclude woocommerece product category in search results?

function exclude_product_category( $query ) { if ($query->is_search()) { $tax_query = (array) $query->get(‘tax_query’); $tax_query[] = array( ‘taxonomy’ => ‘product_cat’, ‘field’ => ‘slug’, ‘terms’ => array(‘excluded-category’), ‘operator’ => ‘NOT IN’ ); $query->set(‘tax_query’, $tax_query); } return $query; }

Remove text after a dot and a colon in Woocommerce product title

Try using following code: add_filter(‘the_title’, ‘mod_product__title’, 10, 2); function mod_product__title($title, $id) { if( is_product() ) { if(preg_match(‘/[^(:|.)]*/’, $title, $matches)){ return trim($matches[0]); }else{ return $title; } } return $title; } Here I’m using regex to match . or : . Regex will match only the first occurrence and return the text before it. Then I’m using … Read more

Change password notification email

Yes, the email properties are filtered through wp_password_change_notification_email before it is sent (code here), which you can hook to modify them e.g. function set_password_change_notification_email_to( $email, $user, $blogname ) { $email[ ‘to’ ] = ‘[email protected]’; return $email; } add_filter( ‘wp_password_change_notification_email’, ‘set_password_change_notification_email_to’, 10, 3 );