WordPress filter hook
translate_object_id
Fired by 18 WordPress plugins, running on 331K+ sites between them.
How to use translate_object_id
It's a filter: your callback receives the value and 3 more arguments, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'translate_object_id', function( $posts, $post_type, $arg3, $lang ) {
// Change $posts here.
return $posts;
}, 10, 4 );Argument names come from Seraphinite Accelerator's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
18 plugins that fire translate_object_id
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
TI WooCommerce Wishlist100,000+ installs
apply_filters( 'translate_object_id', $post_data['product_variation'], 'product_variation', true, $original_product_language )integrations/woocommerce-multilingual.php:75 -
Customer Reviews for WooCommerce80,000+ installs
apply_filters( 'translate_object_id', $item['product_id'], 'product', true, $wpml_current_language )includes/emails/class-cr-email-func.php:89 -
Germanized for WooCommerce70,000+ installs
apply_filters( 'translate_object_id', $this->original_variation_id, 'product_variation', true, $lang )includes/compatibility/class-wc-gzd-compatibility-wpml.php:194 -
Seraphinite Accelerator50,000+ installs
apply_filters( 'translate_object_id', $posts[ 0 ] -> ID, $post_type, true, $lang )Cmn/Gen.php:5807 -
Advanced Dynamic Pricing and Discount Rules for WooCommerce20,000+ installs
apply_filters( 'translate_object_id', $productId, 'post', false, $this->languageCode )BaseVersion/Includes/Compatibility/Wpml/WpmlObjectInternationalization.php:27 -
Loyalty Points Rewards and Referral for WooCommerce3,000+ installs
apply_filters( 'translate_object_id', $prod_id, 'product', false, $current_lang )App/Helpers/Woocommerce.php:1122 -
WP Hotelier2,000+ installs
apply_filters( 'translate_object_id', $extra_id, 'extra', true )includes/admin/meta-boxes/views/reservation/html-meta-box-reservation-single-item.php:127 -
Carousel Horizontal Posts Content Slider2,000+ installs
apply_filters( 'translate_object_id', $id, get_post_type( $id ), true )carousel-horizontal-posts-content-slider.php:1196 -
OnSale Page for WooCommerce2,000+ installs
apply_filters( 'translate_object_id', $onsale_page, 'page', true, $language['language_code'] )public/class-woocommerce-onsale-page-public.php:253 -
Seraphinite Post .DOCX Source800+ installs
apply_filters( 'translate_object_id', $posts[ 0 ] -> ID, $post_type, true, $lang )Cmn/Gen.php:5627 -
DataFeedWatch Connector for WooCommerce600+ installs
apply_filters( 'translate_object_id', $a2cData['meta_data']['parent'], $termType, false, $currentLangCode )bridge2cart/bridge.php:2254 -
CDI200+ installs
apply_filters( 'translate_object_id', $item['product_id'], 'product', false, $language_to_filter )examples/CDI-filters-example.php:308 -
Splash Sync100+ installs
apply_filters( 'translate_object_id', $postId, 'post', true, $this->getDefaultLanguage() )src/Services/MultiLang/WpmlProvider.php:84 -
Api2Cart Bridge Connector40+ installs
apply_filters( 'translate_object_id', $a2cData['meta_data']['parent'], $termType, false, $currentLangCode )bridge2cart/bridge.php:2254 -
Seraphinite Alternative Slugs Manager20+ installs
apply_filters( 'translate_object_id', $posts[ 0 ] -> ID, $post_type, true, $lang )Cmn/Gen.php:4715 -
Seraphinite Bulk Discounts for WooCommerce20+ installs
apply_filters( 'translate_object_id', $posts[ 0 ] -> ID, $post_type, true, $lang )Cmn/Gen.php:5023 -
Seraphinite Downloads Statistics10+ installs
apply_filters( 'translate_object_id', $posts[ 0 ] -> ID, $post_type, true, $lang )Cmn/Gen.php:5462 -
Crypto Coin Market Prices10+ installs
apply_filters( 'translate_object_id', $post -> ID, $post -> post_type, true, $lang )Cmn/Gen.php:1364
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.