this plugin is useless
why would 3000+ active live sites use this plugin if it was useless?
Did you debug your code to see what is the output result of your php snippet?
My friend, don’t offend.
I’m sorry, I was in a hurry, so I missed the if statement.
Here is a working code:
<?php
// Getting all langs
$languages = pll_the_languages(array('raw' => 1));
// Looping
foreach ($languages as $language) {
// check if is current one
if ($language['current_lang'] == true) {
// check it slug
if ($language['slug'] == "ua") {
// this is ua? Ok, let's show UA contact form
echo do_shortcode("[contact-form-7 id=\"412\"]");
}else if($language['slug'] == "ru"){
// or maybe it's russian? Ok, let's show RU contact form
echo do_shortcode("[contact-form-7 id=\"4\"]");
}else{
// nope? Let's show the English one, it's international language anyway :)
echo do_shortcode("[contact-form-7 id=\"330\"]");
}
}
}
?>
There are more than 3 000 websites based on WP that installed by begginers that even don’t know the php. So this number is not great. Checkout All In One SEO Pack or Yoast SEO, Contact form or WP polylang.
No offence, I’m just asking is there any profit to use this plugin, because there is no any explanation how to use it in template. Ok, you’ve made a great video of using ADMIN section and how to create new forms as posts. But I didn’t see the template work etc.
If it works the same way and I need to set form ID for each language – there is no need for this plugin (for me).
Note: there are always a customer for ANY good and if someone is not your customer – it’s not meaning that this is a bad product. I’m JUST asking.
-
This reply was modified 8 years, 6 months ago by
Nikita_Sp. Reason: clear php code
-
This reply was modified 8 years, 6 months ago by
Nikita_Sp.
No offence, I’m just asking is there any profit to use this plugin
none taken, but if you wish to get free support (as in free beer) then the best approach is to remain polite and not tell authors their plugin is useless. If you pay for the plugin then you can complain as much as you want.
Now, if I understand you want to automatically set the corresponding form translation ID and build the shortcode dynamically. For this you need to read up about polylang and how it stores translations.
Then you need to set up only 1 template with your default language form id, and detect which language is being requested so that you can get the translated form id from polylang to setup your shortcode correctly.
I hope that is clear.
I was just asking, because there is no info and also I already apologized in first post.
As I understand from your post you mean that with your plugin I can just set form ID on any lang and it will output correct form depending the current language, right?
Or it just helping to connect forms to groups for language?
I can just set form ID on any lang and it will output correct form
yes, as long as the form ID is the translation ID from polylang