Forums

[Plugin: WordPress Navigation List Plugin NAVT] NAVT does not work with xlanguage plugin (1 post)

  1. igor.fruehauf
    Member
    Posted 4 years ago #

    In order to make NAVT to make work with xlanguage
    I have got the hint to use the following function, to apply the localization logic over the string.
    apply_filters('localization', $some_string_to_be_displayed)

    Does anybody have an Idea what have to be done?
    Thanks for any tip.
    Igor
    See also the FAQ from xlanguage page http://hellosam.net/project/xlanguage/4

    Widget Title Customization

    You might have already found that Single Line Syntax does not work on the widgets’ title. In fact, most widgets’ title is not passed to any filter and hence nothing can be done without modifying the code. The good thing is that, hacking the code is usually a relative easy task —

    1. Open the php file that contains the widget code
    2. locate the widget code responsible for rendering, usually the handling function is specified by the wp_register_sidebar_widget invoked in the code.
    3. In the rendering function found, locate the $before_title variable.
    4. Wrap the title variable with the apply_filters: localization, so it might look like this: apply_filters('localization', $title)
    5. Done

    By filtering through the localization, xLanguage will do it jobs and apply the filtering logic.

    Great thing is that even if you have xLanguage uninstalled later, the code will not breaking the site. Another similar language plugin can also register its own localization filter to provide similar functionality, no solution lock-in. You might want to pushed the author of the widgets to put this line of code into their widgets, so everyone benefits.

Topic Closed

This topic has been closed to new replies.

About this Topic