• Resolved medinlu

    (@medinlu)


    Hello,

    I’m using your plugin, and I would like to know if it’s possible to integrate with WPML. I mean, now BOP is only giving results in the default language when I search for something…

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter medinlu

    (@medinlu)

    Plugin Author joe_bopper

    (@joe_bopper)

    Hi medinlu,

    As there are many different plugins for multilingual wp, I haven’t coded this plugin for any particular one. Instead, I have left action/filter hooks to allow site developers to customise this plugin’s output to their content. In your case, I believe you need there to be an extra hidden input field specifying the current language (not the way I would’ve done it, but I guess it’s fair enough for WPML to choose this fashion). It seems WPML currently does this through a sort of reverse action hook, i.e., they are hooking a function into an action and the site developer determines when the action should occur.

    I’m not 100% certain, but I think you need to use this code in your theme’s functions.php (or other suitable location):

    add_action('bop_nav_search_hidden_inputs', function( $item, $depth, $args ){
        do_action( 'wpml_add_language_form_field' );
        //or
        //echo '<input type="hidden" name="lang" value="YOUR_DESIRED_LANG_CODE"/>';
    }, 10, 3 );

    Hope this helps.

    Cheers,
    Joe

    Plugin Author joe_bopper

    (@joe_bopper)

    I’m marking this topic as resolved. If this is not the case, please feel free to get back in touch.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Search and WPML’ is closed to new replies.