Support » Plugin: qTranslate X » Content filter

  • Is there a setting to disable the content filter:
    qtranxf_useCurrentLanguageIfNotFoundShowAvailable running at priority 100?

    I love the Editor raw mode, but there are instances where i need the same functionality at the front-end ( editing name and description of an album in plugin wp-photo-album-plus ).

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Gunu


    Hello Jacob,

    I do not know if this helps you, if not @john clause must give you an answer.

    Settings – Languages – General
    Untranslated Content
    Hide Content which is not available for the selected language.

    Thank you for your reply, but that is not what i meant.

    I just want text like
    [:en]First album[:nl]Eerste album[:fr]Premier album[:de]Erstes Album[:]
    to be displayed as it is when i do not pass it by __().

    Currently the conten filter i mentioned above replaces it by the text in the current language.

    Plugin Author John Clause


    We currently do not support admin functions for editing of multilingual text at front end. You may remove that filter programmatically under your own theme when it is applicable, but it is rather complex.

    To edit a multilingual string at front end you would need to bring the whole stack of java scripts needed to serve this function to front end, which is not currently possible in any easy way. I would say qtx would need to undergo a significant re-design to achieve that.

    I am not sure what can be advised for your problem at this point. If you make it work somehow for your specific plugin, feel free to submit a pull request on GitHub with code modifications you need. Please, make sure your modifications are encapsulated not to affect the normal qtx operation for other people. Maybe it all has to go only if a specific new option is turned on, so that the current code is unaffected, if that option is off.

    If the absence of that filter is somehow the only thing you need, we can move that filter into i18n-config.json, where it actually belongs to. It is currently in qtranslate_hooks.php as a remnant from old qTranslate. Then you could alter the configuration through filters as described in Integration Guide. And you can remove that filter through the same filters as well.

    Please, continue this discussion with an issue at GitHub, if needed. It is much easier to track it at GitHub.

    Thanx for your reply. However, a few remarks:

    To my opinion, the filter should normally run on a default priority <= 10.
    You changed it to 100:

    add_filter('the_content', 'qtranxf_useCurrentLanguageIfNotFoundShowAvailable', 100);
    // since 3.1 changed priority from 0 to 100, since other plugins, like generate additional content, which also needs to be translated.

    There are also other plugins that do NOT want this filter to be run on priority 100, e.g. wp-photo-album-plus.

    This is the reason i ask for a checkbox on the advanced settings admin panel to set the priority to 100 optionally. Also, to be backward compatible with qTranslate.

    Because there are many theme and plugin builders that create content filters on priorities higher than the do_shortcode() priority ( 11 ), and therefor creating unwanted filtering of the html created during processing shortcodes ( a real pain in the … for plugin writers!! ), i have a setting in my plugin wp-photo-album-plus to set the do_shortcode() priority. I set it to 101 and everything works again.

    So, a workaround is simply available, but a switch would still be appreciated, always in cases of content filters above do_shortcode() priority.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Content filter’ is closed to new replies.