Add "Hide if no translation" to the widget options
-
Hi guys, thanks for the good work.
I have an issue which I solved but don’t know if in the right way.
I put the language selector widget on my “Single Post” sidebar and I did not want it to show up if no translations are available for that post, so I wandered a bit in Polylang’s options and foundhide_if_no_translation
.So I edited
polylang/include/switcher.php
, functionget_switcher_options()
and appended:'hide_if_no_translation' => array('string' => __('Hides the widget if no translation exists', 'polylang'), 'default' => 0),
to the options array, it worked like a charm so now the option is showing up among the widget’s other options. Apparently it’s working fine.
I want to know if the solution is the right one and, if so, if you can add permanently the option to Polylang.
Many thanks!
Ciro.
- The topic ‘Add "Hide if no translation" to the widget options’ is closed to new replies.