translate_object_id

The WooCommerce Multilingual translate object id hook.

Description

apply_filters( 'translate_object_id', (unknown) $term_term_id, (string) $name, (bool) $false, (unknown) $lang ); 

Parameters (4)

0. $term_term_id (unknown)
The term term id.
1. $name (string)
The name.
2. $false (bool) => false
The false.
3. $lang (unknown)
The lang.

Usage

To run the hook, copy the example below.
  1. $term_term_id = apply_filters( 'translate_object_id', $term_term_id, $name, $false, $lang ); 
  2.  
  3. if ( !empty( $term_term_id ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the translate_object_id callback 
  2. function filter_translate_object_id( $term_term_id, $name, $false, $lang ) { 
  3. // make filter magic happen here... 
  4. return $term_term_id
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'translate_object_id', 'filter_translate_object_id', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'translate_object_id', 'filter_translate_object_id', 10, 4 ); 

Defined (165)

The filter is defined in the following location(s).

/inc/translation-editor/class-wcml-synchronize-variations-data.php  
  1. $term_id = apply_filters( 'translate_object_id', $term->term_id, $name, false, $lang ); 
  1. $trnsl_variation_id = apply_filters( 'translate_object_id', $variation->post_id, 'product_variation', false, $language ); 
/inc/translation-editor/class-wcml-synchronize-product-data.php  
  1. $post_id = apply_filters( 'translate_object_id', $post_id, 'product', false, $current_language ); 
  1. $tr_id = apply_filters( 'translate_object_id', $tt_id, $taxonomy, false, $language ); 
  1. $trnsl_up_sells[] = apply_filters( 'translate_object_id', $original_up_sell_product, get_post_type( $original_up_sell_product ), false, $lang ); 
  1. $trnsl_cross_sells[] = apply_filters( 'translate_object_id', $original_cross_sell_product, get_post_type( $original_cross_sell_product ), false, $lang ); 
  1. $tr_parent_id = apply_filters( 'translate_object_id', wp_get_post_parent_id( $duplicated_post_id ), 'product', false, $lang ); 
/inc/translation-editor/class-wcml-editor-ui-product-job.php  
  1. !is_null( apply_filters( 'translate_object_id', $term->term_id, $taxonomy, false, $this->get_target_language() ) ) 
  1. $trn_product_id = apply_filters( 'translate_object_id', $this->product_id, 'product', false, $this->get_target_language() ); 
  1. $trnsl_prod_image = apply_filters( 'translate_object_id', $image_id, 'attachment', false, $this->get_target_language() ); 
  1. $translated_variation_id = apply_filters( 'translate_object_id', $variation[ 'variation_id' ], 'product_variation', false, $this->get_target_language() ); 
  1. $trnsl_variation_id = apply_filters( 'translate_object_id', $post_id, 'product_variation', false, $this->get_target_language() ); 
  1. $tr_product_id = apply_filters( 'translate_object_id', $this->product_id, 'product', false, $this->get_target_language() ); 
  1. $product_parent = apply_filters( 'translate_object_id', $this->original_post->post_parent, 'product', false, $this->get_target_language() ); 
  1. $product_parent = apply_filters( 'translate_object_id', $this->original_post->post_parent, 'product', false, $this->get_target_language() ); 
  1. $trnsl_prod_image = apply_filters( 'translate_object_id', $image_id, 'attachment', false, $this->get_target_language() ); 
/inc/template-classes/store-urls/class-wcml-store-urls-translation-statuses-ui.php  
  1. $translated_base = apply_filters( 'translate_object_id', get_option('woocommerce_shop_page_id' ), 'page', false, $language['code'] ); 
/inc/template-classes/store-urls/class-wcml-store-urls-edit-base-ui.php  
  1. $translated_base = apply_filters( 'translate_object_id', $original_shop_id , 'page', false, $this->language ); 
/inc/template-classes/class-wcml-removed-cart-items-ui.php  
  1. $tr_product_id = apply_filters( 'translate_object_id', $product_id, 'product', false, $current_language ); 
/inc/rest-api-support/class-wcml-rest-api-support.php  
  1. $filtered_include[] = apply_filters( 'translate_object_id', $id, get_post_type($id), true ); 
  1. $translated_product_id = apply_filters( 'translate_object_id', $product_id, 'product', true, $lang ); 
/inc/rest-api-support/class-wcml-rest-api-support-v1.php  
  1. $filtered_include[] = apply_filters( 'translate_object_id', $id, get_post_type($id), true ); 
  1. $translated_product_id = apply_filters( 'translate_object_id', $product_id, 'product', true, $lang ); 
/inc/rest-api-support/class-wcml-rest-api-suport.php  
  1. $filtered_include[] = apply_filters( 'translate_object_id', $id, get_post_type($id), true ); 
  1. $translated_product_id = apply_filters( 'translate_object_id', $product_id, 'product', true, $lang ); 
/inc/currencies/class-wcml-multi-currency.php  
  1. if( !get_post_meta( apply_filters( 'translate_object_id', $child , get_post_type( $child ), true, $original_product_language ), '_wcml_custom_prices_status', true ) ) { 
  1. }elseif( !get_post_meta( apply_filters( 'translate_object_id', $current_product_id , get_post_type( $current_product_id ), true, $original_product_language ), '_wcml_custom_prices_status', true ) ) { 
/inc/currencies/class-wcml-multi-currency-prices.php  
  1. $original_object_id = apply_filters( 'translate_object_id', $object_id, get_post_type($object_id), false, $sitepress->get_default_language()); 
/inc/currencies/class-wcml-custom-prices.php  
  1. $matched_products[] = apply_filters( 'translate_object_id', $product->ID, 'product', true ); 
  1. $matched_products[] = apply_filters( 'translate_object_id', $product->post_parent, get_post_type( $product->post_parent ), true ); 
/inc/class-wcml-woocommerce-rest-api-support.php  
  1. $translated_product_id = apply_filters( 'translate_object_id', $item['product_id'], 'product', true, $lang ); 
  1. $translated_variation_id = apply_filters('translate_object_id', $item['variation_id'], 'product_variation', true, $lang); 
  1. $translated_term_id = apply_filters('translate_object_id', $term->term_id, $attribute_name, true, $lang); 
  1. $translated_term_id = apply_filters('translate_object_id', $term->term_id, $attribute_name, true, $lang); 
  1. $translated_term_id = apply_filters('translate_object_id', $term->term_id, $m->key, true, $lang); 
  1. $translated_product_id = apply_filters( 'translate_object_id', $item['product_id'], 'product', true, $lang ); 
/inc/class-wcml-wc-strings.php  
  1. $tr_product_id = apply_filters( 'translate_object_id', $values['product_id'], 'product', true ); 
  1. $tr_parent = apply_filters( 'translate_object_id', $parent, 'product', true ); 
  1. $tr_product_id = apply_filters( 'translate_object_id', WooCommerce_Functions_Wrapper::get_product_id( $product ), 'product', true, $this->current_language ); 
  1. $original_product_id = apply_filters( 'translate_object_id', $_GET['post'], 'product', true, $sitepress->get_default_language() ); 
/inc/class-wcml-url-translation.php  
  1. $default_shop_id = apply_filters( 'translate_object_id', $current_shop_id, 'page', true, $sitepress->get_default_language() ); 
  1. $translated_shop_id = apply_filters( 'translate_object_id', $original_shop_id, 'page', false, $language ); 
/inc/class-wcml-troubleshooting.php  
  1. $tr_product_id = apply_filters( 'translate_object_id', $product['id'], 'product', false, $language['code']); 
  1. update_woocommerce_term_meta( $translation->term_id, 'thumbnail_id', apply_filters( 'translate_object_id', $thumbnail_id, 'attachment', true, $translation->language_code) ); 
  1. $tr_id = apply_filters( 'translate_object_id', $term->term_id, $attr, false, $language['code']); 
  1. $original_parent_translated = apply_filters( 'translate_object_id', $term->parent, $attr, false, $language['code'] ); 
/inc/class-wcml-tp-support.php  
  1. $original_post_id = apply_filters( 'translate_object_id', $post_id, 'product', false, $original_post_language ); 
  1. $translated_variation_id = apply_filters( 'translate_object_id', $variation_id, 'product_variation', false, $language ); 
  1. $translated_prod_image = apply_filters( 'translate_object_id', $image_id, 'attachment', false, $language ); 
/inc/class-wcml-terms.php  
  1. update_woocommerce_term_meta( $translation->term_id, 'thumbnail_id', apply_filters( 'translate_object_id', esc_attr( $_POST['product_cat_thumbnail_id'] ), 'attachment', true, $translation->language_code)); 
  1. $term_id = apply_filters( 'translate_object_id', $term_id, $taxonomy, false, $this->sitepress->get_default_language()); 
  1. $term_id_original = apply_filters( 'translate_object_id', $term->term_id, $taxonomy, false, $default_language ); 
  1. $term_id_translated = apply_filters( 'translate_object_id', $term_id, $taxonomy, false, $language); 
  1. $terms = get_the_terms( apply_filters( 'translate_object_id', $post_id, get_post_type($post_id), true, $this->sitepress->get_current_language() ), 'product_shipping_class'); 
  1. $trnsl_term_id = apply_filters( 'translate_object_id', $term_obj->term_id, $taxonomy, true, $language ); 
  1. $tr_id = apply_filters( 'translate_object_id', $term_id, $taxonomy, false, $language ); 
/inc/class-wcml-store-pages.php  
  1. return apply_filters( 'translate_object_id', $id, 'page', true); 
  1. $front_id = apply_filters( 'translate_object_id', $this->front_page_id, 'page'); 
  1. $url = get_permalink( apply_filters( 'translate_object_id', $shop_id, 'page', true, $language['language_code']) ); 
  1. $post_parent = apply_filters( 'translate_object_id', $orig_page->post_parent, 'page', false, $mis_lang); 
  1. return get_permalink(apply_filters( 'translate_object_id', get_option('woocommerce_checkout_page_id'), 'page', true)); 
  1. $trnsl_id = apply_filters( 'translate_object_id', $page_id, 'page', false, $code ); 
/inc/class-wcml-reports.php  
  1. $default_product_id = apply_filters( 'translate_object_id', $row->product_id, 'product', false, $current_language); 
/inc/class-wcml-products.php  
  1. $original_product_id = apply_filters( 'translate_object_id', $product_id, get_post_type( $product_id ), true, $original_product_language ); 
  1. $current_prod_variation_id = apply_filters( 'translate_object_id', $product_variation->ID, 'product_variation', false, $lang_to ); 
/inc/class-wcml-orders.php  
  1. $tr_product_id = apply_filters( 'translate_object_id', $item_data, 'product', false, $language_to_filter ); 
  1. $tr_variation_id = apply_filters( 'translate_object_id', $item_data, 'product_variation', false, $language_to_filter ); 
  1. $tr_id = apply_filters( 'translate_object_id', $term_id, $key, false, $language_to_filter ); 
  1. $tr_product_id = apply_filters( 'translate_object_id', $item_product_id, 'product', false, $language_to_filter ); 
  1. $tr_variation_id = apply_filters( 'translate_object_id', $item->get_variation_id(), 'product_variation', false, $language_to_filter ); 
  1. $tr_id = apply_filters( 'translate_object_id', $term_id, $data->key, false, $language_to_filter ); 
  1. $item['variation_id'] = apply_filters( 'translate_object_id', $item['variation_id'], 'product_variation', false, $order_language ); 
  1. $item['product_id'] = apply_filters( 'translate_object_id', $item['product_id'], 'product', false, $order_language ); 
  1. $translated_id = apply_filters( 'translate_object_id', $download['product_id'], get_post_type( $download['product_id'] ), false, $this->sitepress->get_current_language() ); 
/inc/class-wcml-media.php  
  1. $trnsl_thumbnail = apply_filters( 'translate_object_id', $thumbnail_id, 'attachment', false, $lang ); 
  1. $duplicated_id = apply_filters( 'translate_object_id', $image_id, 'attachment', false, $translation->language_code ); 
/inc/class-wcml-endpoints.php  
  1. apply_filters( 'translate_object_id', $pid, 'page', false, $page_lang ) == $post->ID 
/inc/class-wcml-emails.php  
  1. $current_prod_variation_id = apply_filters( 'translate_object_id', $object->product->variation_id, 'product_variation', false ); 
  1. $tr_id = apply_filters( 'translate_object_id', $attr_term->term_id, $attribute, false, $this->sitepress->get_current_language() ); 
/inc/class-wcml-dependencies.php  
  1. $translated_shop_page_id = apply_filters( 'translate_object_id', $shop_page_id, 'page', false, $language['code']); 
/inc/class-wcml-cart.php  
  1. $tr_product_id = apply_filters( 'translate_object_id', $cart_item[ 'product_id' ], 'product', false, $current_language ); 
  1. $tr_variation_id = apply_filters( 'translate_object_id', $cart_item[ 'variation_id' ], 'product_variation', false, $current_language ); 
  1. $trnsl_term_id = apply_filters( 'translate_object_id', $term_id, $taxonomy, true, $current_language ); 
  1. $item[ 'product_id' ] = apply_filters( 'translate_object_id', $item[ 'product_id' ], 'product', true ); 
  1. $item[ 'variation_id' ] = apply_filters( 'translate_object_id', $item[ 'variation_id' ], 'product_variation', true ); 
  1. $translated_term_id = apply_filters( 'translate_object_id', $term_id, 'product_shipping_class', true); 
/inc/class-wcml-attributes.php  
  1. $trnsl_variation_id = apply_filters( 'translate_object_id', $variation->post_id, 'product_variation', false, $language['code'] ); 
  1. $trnsl_product_id = apply_filters( 'translate_object_id', $product->ID, 'product', false, $language['code'] ); 
  1. $tr_id = apply_filters( 'translate_object_id', $default_term_id, $attribute, false, $lang ); 
  1. $tr_post_id = apply_filters( 'translate_object_id', $product_id, 'product', false, $lang_code ); 
  1. $trnsl_term_id = apply_filters( 'translate_object_id', $term_obj->term_id, $tax, false, $lang ); 
/inc/class-wcml-ajax-setup.php  
  1. $ch_pages['translated_checkout_page_id'] = apply_filters( 'translate_object_id', $ch_pages['checkout_page_id'], 'page', false); 
  1. $ch_pages['translated_pay_page_id'] = apply_filters( 'translate_object_id', $ch_pages['pay_page_id'], 'page', false); 
  1. $ch_pages['translated_cart_page_id'] = apply_filters( 'translate_object_id', $ch_pages['cart_page_id'], 'page', false); 
/compatibility/class-wcml-wcexporter.php  
  1. $data->translation_of = apply_filters( 'translate_object_id', $data->term_taxonomy_id, 'tax_product_cat', true, $sitepress->get_default_language()); 
  1. $tags[$key]->translation_of = apply_filters( 'translate_object_id', $tag->term_taxonomy_id, 'tax_product_tag', true, $sitepress->get_default_language()); 
/compatibility/class-wcml-the-events-calendar.php  
  1. $original_product_id = apply_filters( 'translate_object_id', $post_id, 'product', false, $this->sitepress->get_default_language() ); 
  1. $event_id = apply_filters( 'translate_object_id', $original_event_id, 'tribe_events', false ); 
  1. $translated_rsvp_post_id = apply_filters( 'translate_object_id', $rsvp_post_id, 'tribe_rsvp_tickets', false, $job->language_code ); 
  1. $translated_event_id = apply_filters( 'translate_object_id', $event_id, 'tribe_events', false, $job->language_code); 
  1. $translated_ticket_post_id = apply_filters( 'translate_object_id', $ticket_post_id, 'product', false, $job->language_code ); 
  1. $translated_event_id = apply_filters( 'translate_object_id', $event_id, 'tribe_events', false, $job->language_code); 
  1. $translated_venue_id = apply_filters( 'translate_object_id', $venue_id, 'tribe_venue', false, $language_code ); 
  1. $translated_venue_id = apply_filters( 'translate_object_id', $original_venue_id, 'tribe_venue', false, $_GET['lang'] ); 
  1. $translated_venue_id = apply_filters( 'translate_object_id', $original_venue_id, 'tribe_venue', false, $job->language_code ); 
  1. $organizer_ids[$key] = apply_filters( 'translate_object_id', $organizer_id, 'tribe_organizer', true ); 
/compatibility/class-wcml-table-rate-shipping.php  
  1. $shipping_class_id = apply_filters( 'translate_object_id', $term->term_id, 'product_shipping_class', false, $shipp_class_language ); 
/compatibility/class-wcml-tab-manager.php  
  1. $tr_tab_id = apply_filters( 'translate_object_id', $orig_prod_tab['id'], 'wc_product_tab', true, $lang ); 
  1. $tr_tab_id = apply_filters( 'translate_object_id', $orig_prod_tab['id'], 'wc_product_tab', false, $lang ); 
  1. $translated_tab_product_id = apply_filters( 'translate_object_id', $tab['id'], 'wc_product_tab', false, $language ); 
  1. $trnsl_tab_id = apply_filters( 'translate_object_id', $default_tab[ 'id' ], 'wc_product_tab', true, $this->sitepress->get_current_language() ); 
/compatibility/class-wcml-sensei.php  
  1. $tr_lesson_id = apply_filters( 'translate_object_id', $lesson_id, 'lesson', false, $language ); 
  1. $tr_course_id = apply_filters( 'translate_object_id', $course_id, 'course', false, $language ); 
  1. $tr_lesson_id = apply_filters( 'translate_object_id', $lesson_id, 'lesson', false, $language ); 
  1. $tr_product_id = apply_filters( 'translate_object_id', $product_id, get_post_type( $product_id ), false, $language ); 
  1. $tr_course_id = apply_filters( 'translate_object_id', $course_id, 'course', false, $language ); 
  1. $tr_comment_id = apply_filters( 'translate_object_id', $comment_id, 'comment', false, $translation->language_code ); 
  1. $tr_product_id = apply_filters( 'translate_object_id', $product_id, get_post_type( $product_id ), false, $order_language ); 
/compatibility/class-wcml-product-bundles.php  
  1. $translated_product_id = apply_filters( 'translate_object_id', $item_meta['product_id'], get_post_type( $item_meta['product_id'] ), false, $target_lang ); 
  1. $translated_product = apply_filters( 'translate_object_id', $bundle_item->product_id, get_post_type( $bundle_item->product_id ), false, $obj->get_target_language() ); 
  1. $translated_product_id = apply_filters( 'translate_object_id', $product_id, get_post_type( $product_id ), false, $lang ); 
  1. $translated_product_id = apply_filters( 'translate_object_id', $product_id, get_post_type( $product_id ), false, $lang ); 
  1. $translated_product_id = apply_filters( 'translate_object_id', $product_id, get_post_type( $product_id ), false, $lang ); 
  1. $translated_var_id = apply_filters( 'translate_object_id', $var_id, get_post_type( $var_id ), true, $lang ); 
  1. $tr_def_id = apply_filters( 'translate_object_id', $term_id, $tax, true, $lang ); 
  1. $tr_var_id = apply_filters( 'translate_object_id', get_the_ID(), 'product_variation', true, $lang ); 
  1. $current_bundle_id = apply_filters( 'translate_object_id', $cart_item[ 'product_id' ], 'product', true ); 
  1. $translated_product_id = apply_filters( 'translate_object_id', $product_id, get_post_type( $product_id ), false, $job->language_code ); 
/compatibility/class-wcml-product-bundles-legacy.php  
  1. $tr_var_id = apply_filters( 'translate_object_id', $var_id, get_post_type( $var_id ), true, $lang ); 
  1. $tr_def_id = apply_filters( 'translate_object_id', $term_id, $tax, true, $lang ); 
  1. $tr_var_id = apply_filters( 'translate_object_id', get_the_ID(), 'product_variation', true, $lang ); 
  1. $current_bundle_id = apply_filters( 'translate_object_id', $cart_item[ 'product_id' ], 'product', true ); 
/compatibility/class-wcml-product-addons.php  
  1. $product_terms[ $key ] = apply_filters( 'translate_object_id', $product_term, 'product_cat', true, $this->sitepress->get_default_language() ); 
/compatibility/class-wcml-mix-and-match-products.php  
  1. $trnsl_prod = apply_filters( 'translate_object_id', $key, 'product', true, $product_translation->language_code ); 
/compatibility/class-wcml-dynamic-pricing.php  
  1. $cat_id = apply_filters( 'translate_object_id', $cat_id, 'product_cat', true, $this->sitepress->get_current_language() ); 
/compatibility/class-wcml-composite-products.php  
  1. apply_filters( 'translate_object_id', $assigned_id, 'product', true, $product_translation->language_code ); 
  1. apply_filters( 'translate_object_id', $assigned_id, 'product_cat', true, $product_translation->language_code ); 
  1. $assigned_id_current_language = apply_filters( 'translate_object_id', $assigned_id, get_post_type( $assigned_id ), false, $language ); 
  1. $trnsl_default_id = apply_filters( 'translate_object_id', $component[ 'default_id' ], get_post_type( $component[ 'default_id' ] ), false, $language ); 
  1. $trsl_term_id = apply_filters( 'translate_object_id', $assigned_id, 'product_cat', false, $language ); 
  1. $trnsl_default_id = apply_filters( 'translate_object_id', $component[ 'default_id' ], 'product_cat', false, $language ); 
  1. $trnsl_assigned_prod_id = apply_filters( 'translate_object_id', $assigned_prod_id, get_post_type( $assigned_prod_id ), false, $language ); 
  1. $trslt_assigned_cat_id = apply_filters( 'translate_object_id', $assigned_cat_id, 'product_cat', false, $language ); 
  1. apply_filters( 'translate_object_id', $assigned_id, 'product', true, $job->language_code ); 
  1. apply_filters( 'translate_object_id', $assigned_id, 'product_cat', true, $job->language_code ); 
/compatibility/class-wcml-bookings.php  
  1. $translated_resource_id = apply_filters( 'translate_object_id', $resource->resource_id, 'bookable_resource', false, $lang_code ); 
  1. $trnsl_person_id = apply_filters( 'translate_object_id', $person, 'bookable_person', false, $lang_code ); 
  1. $original_id = apply_filters( 'translate_object_id', wp_get_post_parent_id( $object_id ), 'product', true, $this->woocommerce_wpml->products->get_original_product_language( wp_get_post_parent_id( $object_id ) ) ); 
  1. $trns_resource_id = apply_filters( 'translate_object_id', $resource_id, 'bookable_resource', true, $this->sitepress->get_current_language() ); 
  1. $trns_resource_id = apply_filters( 'translate_object_id', $custom_costs_resource_id, 'bookable_resource', true, $language_code ); 
  1. $trns_resource_id = apply_filters( 'translate_object_id', $resource_id, 'bookable_resource', true, $language_code ); 
  1. $current_id = apply_filters( 'translate_object_id', $cart_item['product_id'], 'product', true, $current_language ); 
  1. $booking_info[ 'wc_bookings_field_persons_' . apply_filters( 'translate_object_id', $person_id, 'bookable_person', false, $current_language ) ] = $value; 
  1. $booking_info['wc_bookings_field_resource'] = apply_filters( 'translate_object_id', $cart_item['booking']['_resource_id'], 'bookable_resource', false, $current_language ); 
  1. $trns_resource_id = apply_filters( 'translate_object_id', $resource_id, 'bookable_resource', false, $lang ); 
  1. $trnsl_person_id = apply_filters( 'translate_object_id', $person_id, 'bookable_person', false, $lang ); 
  1. $resource_id = apply_filters( 'translate_object_id', $orig_resource_id, 'bookable_resource', false, $language ); 
  1. $person_id = apply_filters( 'translate_object_id', $original_person_id, 'bookable_person', false, $language ); 
  1. $translated_parent = apply_filters( 'translate_object_id', $booking_object->post_parent, get_post_type( $booking_object->post_parent ), false, $lang ); 
  1. $trnsl_person_id = apply_filters( 'translate_object_id', $person_id, 'bookable_person', false, $language['code'] ); 
  1. $trnsl_booking_product_id = apply_filters( 'translate_object_id', $booking_product_id, 'product', false, $language ); 
  1. $trnsl_booking_resource_id = apply_filters( 'translate_object_id', $booking_resource_id, 'bookable_resource', false, $language ); 
  1. $trnsl_person_id = apply_filters( 'translate_object_id', $person_id, 'bookable_person', false, $language ); 
  1. $person_id_translated = apply_filters( 'translate_object_id', $person_id, 'bookable_person', false, $job->language_code ); 
  1. $resource_id_translated = apply_filters( 'translate_object_id', $resource_id, 'bookable_resource', false, $job->language_code );