Plugin Support
Daniel
(@danieldandu)
Hello @mashour06 ,
Thank you for your message.
You can use the following function to determine which TranslatePress tier is currently active on the website:
function my_get_translatepress_tier() {
if ( ! class_exists( 'TRP_Translate_Press' ) ) {
return 'not_active';
}
$product = TRP_Translate_Press::set_tp_product_name_static();
$tier = reset( $product ); // pulls the name string from the array
switch ( $tier ) {
case 'TranslatePress':
return 'free';
case 'TranslatePress Personal':
return 'personal';
case 'TranslatePress Business':
return 'business';
case 'TranslatePress Developer':
return 'developer';
default:
return 'unknown';
}
}
This will return not_active if TranslatePress is not active, or free, personal, business, or developer depending on the active TranslatePress tier.
I hope this helps!
Hello Daniel,
Thank you very much for your help, I really appreciate it. I’ll give it a try and let you know if something goes wrong.
Best regards.