Title: Dennis Ploetner's Replies - page 3 | WordPress.org

---

# Dennis Ploetner

  [  ](https://wordpress.org/support/users/realloc/)

 *   [Profile](https://wordpress.org/support/users/realloc/)
 *   [Topics Started](https://wordpress.org/support/users/realloc/topics/)
 *   [Replies Created](https://wordpress.org/support/users/realloc/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/realloc/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/realloc/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/realloc/engagements/)
 *   [Favorites](https://wordpress.org/support/users/realloc/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 31 through 45 (of 2,033 total)

[←](https://wordpress.org/support/users/realloc/replies/page/2/?output_format=md)
[1](https://wordpress.org/support/users/realloc/replies/?output_format=md) [2](https://wordpress.org/support/users/realloc/replies/page/2/?output_format=md)
3 [4](https://wordpress.org/support/users/realloc/replies/page/4/?output_format=md)…
[134](https://wordpress.org/support/users/realloc/replies/page/134/?output_format=md)
[135](https://wordpress.org/support/users/realloc/replies/page/135/?output_format=md)
[136](https://wordpress.org/support/users/realloc/replies/page/136/?output_format=md)
[→](https://wordpress.org/support/users/realloc/replies/page/4/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Multisite Language Switcher] How to add to subheader menu](https://wordpress.org/support/topic/how-to-add-to-subheader-menu/)
 *  Plugin Author [Dennis Ploetner](https://wordpress.org/support/users/realloc/)
 * (@realloc)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/how-to-add-to-subheader-menu/#post-18210593)
 * I would suggest a slight change, because it would give you more flexibility and
   it is a bit more future-proof. You could use [do_action](https://developer.wordpress.org/reference/functions/do_action/)
   when you want to print the output of MSLS in various parts of your templates.
   Let’s assume you just put this in your subheader:
 *     ```wp-block-code
       <?php$args = array(); // this could held some configdo_action( 'zwibasti_language_switcher_output', $args ); // this triggers an action
       ```
   
 * In the functions.php (or in a custom plugin) you could have something like this:
 *     ```wp-block-code
       <?phpfunction zwibasti_msls_print( array $args ): void {    if ( ! function_exists( 'the_msls' ) ) {        return;    }    $tags array(        'before_item'   => '<li>',        'after_item'    => '</li>',        'before_output' => '<ul class="your-css-class">,        'after_output'  => '</ul>',    );    the_msls( wp_parse_args( $tags, $args ) );}add_action( 'zwibasti_language_switcher_output', 'zwibasti_msls_print' );
       ```
   
 * What is the advantage? You can do it without looking in all files whenever you
   decide to change something or even use another solution. Also, with the centralized
   functionality, you can decide the minimal setup.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Multisite Language Switcher] Manually create association](https://wordpress.org/support/topic/manually-create-association/)
 *  Plugin Author [Dennis Ploetner](https://wordpress.org/support/users/realloc/)
 * (@realloc)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/manually-create-association/#post-18210138)
 * Great! We can maybe give the importer some of the love it deserves. I will see
   what I can do there.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Multisite Language Switcher] How to add to subheader menu](https://wordpress.org/support/topic/how-to-add-to-subheader-menu/)
 *  Plugin Author [Dennis Ploetner](https://wordpress.org/support/users/realloc/)
 * (@realloc)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/how-to-add-to-subheader-menu/#post-18210134)
 * Where did you add the code? To a functions.php file in your theme or a custom
   plugin?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Multisite Language Switcher] Manually create association](https://wordpress.org/support/topic/manually-create-association/)
 *  Plugin Author [Dennis Ploetner](https://wordpress.org/support/users/realloc/)
 * (@realloc)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/manually-create-association/#post-18208323)
 * I wrote something in the past that can illustrate a bit what you want to achieve:
   [Msls Importer](https://github.com/lloc/msls-importer/tree/master)
 * It is quite outdated code but it wanted to backup the MSLS options in a JSON 
   file and provides also functionality to import those files back.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Multisite Language Switcher] msls with custom post type](https://wordpress.org/support/topic/msls-with-custom-post-type/)
 *  Plugin Author [Dennis Ploetner](https://wordpress.org/support/users/realloc/)
 * (@realloc)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/msls-with-custom-post-type/#post-18208295)
 * I guess that your code has a small flaw. The expected input for that function
   is an integer not an array:
 *     ```wp-block-code
       <?php$post_id = get_queried_object_id(); // or any number of your choice$msls_post = msls_get_post( $post_id );print_r( $msls_post );
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Multisite Language Switcher] How to add to subheader menu](https://wordpress.org/support/topic/how-to-add-to-subheader-menu/)
 *  Plugin Author [Dennis Ploetner](https://wordpress.org/support/users/realloc/)
 * (@realloc)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/how-to-add-to-subheader-menu/#post-18208275)
 * The MslsMenu add-on is doing this for classical NavMenus. Here an [example](https://msls.co/developer-docs/snippets-examples/)(
   taken from the msls.co website):
 *     ```wp-block-code
       function my_custom_menu_item( $items, $args ) {    if ( function_exists ( 'msls_output' ) && 'primary' == $args->theme_location ) {        $arr = msls_output()->get( 2 );        if ( !empty( $arr ) ) {            $items .= '<li>' . implode( '</li><li>', $arr ) . '</li>';        }    }    return $items;}add_filter( 'wp_nav_menu_items', 'my_custom_menu_item', 10, 2 );
       ```
   
 * And yes, you can also use the API functions provided by the plugin. You can pass
   an array to the function to the function _the\_msls()_ that gives you even more
   flexibility:
 *     ```wp-block-code
       <?php$tags array(    'before_item'   => '<li>',    'after_item'    => '</li>',    'before_output' => '<ul class="your-css-class">,    'after_output'  => '</ul>',);the_msls( $tags );
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Multisite Language Switcher] msls with custom post type](https://wordpress.org/support/topic/msls-with-custom-post-type/)
 *  Plugin Author [Dennis Ploetner](https://wordpress.org/support/users/realloc/)
 * (@realloc)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/msls-with-custom-post-type/#post-18205835)
 * You should be able to see an icon whenever you write a post (or other type of
   content) like in my example here: [https://imgur.com/a/3Ck7ZPe](https://imgur.com/a/3Ck7ZPe)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Multisite Language Switcher] Content import not working.](https://wordpress.org/support/topic/content-import-not-working/)
 *  Plugin Author [Dennis Ploetner](https://wordpress.org/support/users/realloc/)
 * (@realloc)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/content-import-not-working/#post-18194107)
 * If you also see a Japanese flag (or label) on the English website and vice versa,
   yes. This means it is configured.
 * With Twenty Twenty Five you should be able to use the plugins’ block to show 
   the flags in the frontend too. I will try to setup a website with the settings
   you mentioned and see what is happening.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Multisite Language Switcher] Content import not working.](https://wordpress.org/support/topic/content-import-not-working/)
 *  Plugin Author [Dennis Ploetner](https://wordpress.org/support/users/realloc/)
 * (@realloc)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/content-import-not-working/#post-18192360)
 * The most important things are that you have at least 2 websites with different
   languages, and that you configured them in the settings for the Multisite Language
   Switcher: [https://msls.co/](https://msls.co/)
 * Can you confirm that this has been done?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Multisite Language Switcher] Content import not working.](https://wordpress.org/support/topic/content-import-not-working/)
 *  Plugin Author [Dennis Ploetner](https://wordpress.org/support/users/realloc/)
 * (@realloc)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/content-import-not-working/#post-18190770)
 * I will try to reproduce it. Is there anything I should know: What theme is active
   for example…
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Multisite Language Switcher] Call to undefined method lloc\Msls\MslsPlugin::get_output()](https://wordpress.org/support/topic/call-to-undefined-method-llocmslsmslspluginget_output/)
 *  Plugin Author [Dennis Ploetner](https://wordpress.org/support/users/realloc/)
 * (@realloc)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/call-to-undefined-method-llocmslsmslspluginget_output/#post-18161695)
 * With version 2.9.2, I did start to provide more API functions and less access
   to the internals of various objects/classes. The API function that you’re looking
   for is called **msls_output** in would be safe to use in future versions too:
 *     ```wp-block-code
       /**
        * Gets the MslsOutput instance
        *
        * @return \lloc\Msls\MslsOutput
        */
       function msls_output(): \lloc\Msls\MslsOutput {
           return \lloc\Msls\MslsOutput::create();
       }
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Multisite Language Switcher] Hreflang tag issues](https://wordpress.org/support/topic/hreflang-tag-issues/)
 *  Plugin Author [Dennis Ploetner](https://wordpress.org/support/users/realloc/)
 * (@realloc)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/hreflang-tag-issues/#post-18149304)
 * I guess I answered that here: [https://wordpress.org/support/topic/i-wanted-to-add-x-default-tag-to-every-page-of-my-website/](https://wordpress.org/support/topic/i-wanted-to-add-x-default-tag-to-every-page-of-my-website/)
   
   But I don’t know what you want to do with CSV.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Multisite Language Switcher] peebam.com home page can’t switch to English language](https://wordpress.org/support/topic/peebam-com-home-page-cant-switch-to-english-language/)
 *  Plugin Author [Dennis Ploetner](https://wordpress.org/support/users/realloc/)
 * (@realloc)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/peebam-com-home-page-cant-switch-to-english-language/#post-18149294)
 * It looks like some JS is not working as expected. At least I see some warning
   in the console that lets me think that. Another possibility could be an incorrect
   redirect rule.
 * But those are things that are not coming from the plugin.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Multisite Language Switcher] International SEO](https://wordpress.org/support/topic/international-seo-2/)
 *  Plugin Author [Dennis Ploetner](https://wordpress.org/support/users/realloc/)
 * (@realloc)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/international-seo-2/#post-18148325)
 * Please, remain in the thread that you started already: [https://wordpress.org/support/topic/i-wanted-to-add-x-default-tag-to-every-page-of-my-website/](https://wordpress.org/support/topic/i-wanted-to-add-x-default-tag-to-every-page-of-my-website/)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Multisite Language Switcher] i wanted to add x-default tag to every page of my website](https://wordpress.org/support/topic/i-wanted-to-add-x-default-tag-to-every-page-of-my-website/)
 *  Plugin Author [Dennis Ploetner](https://wordpress.org/support/users/realloc/)
 * (@realloc)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/i-wanted-to-add-x-default-tag-to-every-page-of-my-website/#post-18143330)
 * **How can you conditionally check if a translation exists? How can you retrieve
   the URL of the translation of the current page in another language?**
 * You can probably hook into _msls\_filter\_string_ (read on here [https://msls.co/developer-docs/hook-reference/](https://msls.co/developer-docs/hook-reference/))
   or use an API function like _get\_msls\_permalink() _(read on here [https://msls.co/developer-docs/api-functions/](https://msls.co/developer-docs/api-functions/)).

Viewing 15 replies - 31 through 45 (of 2,033 total)

[←](https://wordpress.org/support/users/realloc/replies/page/2/?output_format=md)
[1](https://wordpress.org/support/users/realloc/replies/?output_format=md) [2](https://wordpress.org/support/users/realloc/replies/page/2/?output_format=md)
3 [4](https://wordpress.org/support/users/realloc/replies/page/4/?output_format=md)…
[134](https://wordpress.org/support/users/realloc/replies/page/134/?output_format=md)
[135](https://wordpress.org/support/users/realloc/replies/page/135/?output_format=md)
[136](https://wordpress.org/support/users/realloc/replies/page/136/?output_format=md)
[→](https://wordpress.org/support/users/realloc/replies/page/4/?output_format=md)