The first parameter of the filter gets its value from function wc_get_product_term_ids:
http://hookr.io/filters/woocommerce_get_related_product_tag_terms/
This function returns an array of term_id
s instead of objects:
https://docs.woocommerce.com/wc-apidocs/source-function-wc_get_product_term_ids.html#860-871
So you can match the term id values directly or you can use get_term_by to get one of the term objects in the comparison.
e.g. getting the term on the right hand side of the comparison:
$termnames = array(
'Đồng Hồ Thụy Sỹ',
'Đồng Hồ 6 Kim',
'Citizen Eco-Drive',
'Seiko Kinetic',
'Seiko Solar',
'Đồng Hồ Dây Da Nam Nữ'
);
foreach($terms as $key => $term) {
$t = get_term_by('id', $term, 'product_tag');
if(in_array($t->name, $termnames, true) || 'dong-ho-thuy-sy' === $t->slug) {
unset($terms[$key]);
}
}
Related Posts:
- Edit tag cloud widget number
- How to automatically apply woocommerce product title to all product images alt tags?
- Display product attributes for current product
- How to change product title color in shop page if product has specific product tag (Woocommerce)?
- How to add product in woocommerce with php code [closed]
- How to correctly add Javascript in functions.php
- How to check if a plugin (WooCommerce) is active?
- How to trigger WooCommerce order complete email?
- How to check if woocommerce is activated in theme
- How to get Woocommerce order product info
- Woocommerce get selected shipping zone id for the current user
- How to add date range in woocommerce with code
- Remove Woocommerce product link
- Query WooCommerce orders grouped by several order statuses
- Creating custom Woocommerce attribute taxonomies from a plugin
- get product attributes for current product and store it in a variable
- remove tags from posts in php
- Display sorting options dropdown when using WooCommerce product category shortcode
- retrieve thumbnail from post ID of best selling product in category
- Display a selected custom product option in WooCommerce cart
- How to have a custom display for both woocommerce archive and product-category pages? [closed]
- WooCommerce: How to display item meta data in email confirmation using woocommerce_order_item_meta_end
- How to get the original price of the product in woocommerce?
- Woocommerce auto cancel On-Hold after X days
- How to change “Shipping Calculator “field label on Cart Page – woocommerce? [closed]
- How to remove “out of stock” variation options from size dropdown in woocommerce?
- WP_Query | Help me create a search term with an ‘OR’ relation?
- tag search using WP_Query
- Hide a menu-item and its submenus and display a ‘Log in’ link if the user is logged out
- Using Cookie Data For WP_Query Loop
- WooCommerce – Customer Order History Pagination
- How to get Woocommerce Variation ID? [closed]
- Cleanest/Fastest way to avoid calling and retrieving data from the database multiple times?
- Automatically check the option “Enable stock management at product level” on product creation
- The values of custom fields are not available functions.php
- How to show order data by multiple ID?
- Use wc_enqueue_js only on specific pages – nested add_action
- How to Remove a Filter from the Admin List Table?
- show limited tags in an article
- display most popular tags in two columns
- Problem with Woocommerce REST API Authentication
- Woocommerce: How to override core functions in functions.php?
- Woocommerce, recognize the loop of related products
- Replace existing content from specific WooCommerce admin orders list column
- Remove commas from WooCommerce checkout addresses fields
- Add product tag names to WooCommerce new order email subject
- WooCommerce Link to Product Category
- How to add a post or page tag to the list of classes appearing in the body tag’s class attribute?
- Remove General Tab and Plugin Tab in Settings in Woocommerce
- Get WooCommerce shipping methods programmatically
- WooCommerce – Display variation custom field value [closed]
- How to display product cropped thumbnail (150×150) for WooCommerce product categories
- Add a custom text field to WooCommerce admin product data “Variations”
- Add to checkout total lines an additional line below shipping in WooCommerce
- Woocommerce – How to get products which have a sale between 20% to 40%? [closed]
- Translating add to cart woocommerce button [closed]
- Displaying Only Certain Tags in Loop
- query if on page/2/?
- Output a WooCommerce product custom field in WooCommerce using get_post_meta()
- Append a term to WooCommerce product existing product category terms
- Woocommerce: Is it possible to overide the settings for allowing to purchase out of stock products [closed]
- Woocommerce HTML email option unavailable
- using woocommerce_template_single_add_to_cart in shop-loop – javascript issues [closed]
- How to add SVG icon above product tab title
- How does WooCommerce ensure that a product doesn’t run out of stock during payment? [closed]
- How To Change The Html of Products filtration sidebar in Woocommerce?
- Display related products with custom output
- How To add custom radio boxes to WooCommerce Billing page and change total price by this field?
- WooCommerce: update custom fields after checkout validation failure
- Add attribute / custom attribute to product in woocommerce
- Trigger Woocommerce New User Email
- Listing and displaying WooCommerce Shipping Zones in the frontend? [closed]
- Woocommerce filter cart and category specific quantity [closed]
- Use is_product_category() properly
- Highlight Current Tag in wp_tag_cloud
- How to change / delete product short description in Woocommerce
- Add relevant tag to search results
- How to trash multiple post/product programmatically
- Writing scripts using WordPress / WooCommerce classes?
- My Own layout in WooCommerce pages [closed]
- How to get woocommerce cart content without an action?
- WooCommerce: Add Payment Gateway Field to Webhooks [closed]
- Must Use Plugin Causing Query Error
- Woocommerce – remove product from category
- How to make custom total price reactive in navigation
- Inject PHP code into “sidebar-content” – code before my WooCommerce sidebar widget?
- OrderItem get_total() returns lower value than $order_item->get_product()->get_price() * quantity
- Change description on specific WooCommerce product status change
- Add the Name of Products Ordered to Admin New Order Email WooCommerce
- Changing Woocommerce flat rate every nth number of items
- How to prevent those PHP variables from being cached on WordPress?
- Woocommerce product download URL
- How to select WooCommerce products by post_meta and order them
- Setting All Drafts to ‘exclude-from-catalog’ in WooCommerce
- Woocommerce – Filter Variable Products by Variation Attributes and Variations Regular Price
- woocommerce – hide payment method in new order email
- Limiting woocommerce line_total decimal length
- Help with some php math in WordPress
- How to add a second ‘place order’ button in WooCommerce [closed]
- How to create a linked tag list in my sidebar