Title: Array of language + link
Last modified: September 12, 2018

---

# Array of language + link

 *  [bdvllrd](https://wordpress.org/support/users/bdvllrd/)
 * (@bdvllrd)
 * [8 years ago](https://wordpress.org/support/topic/array-of-language-link/)
 * How can I get (which function) an array with the language and the links for all
   the linked pages of a current page ?
 * Thanks for your answer.

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Dennis Ploetner](https://wordpress.org/support/users/realloc/)
 * (@realloc)
 * [8 years ago](https://wordpress.org/support/topic/array-of-language-link/#post-10685312)
 * If you need the id of the linked object just try
 * `$values = MslsOptions::create()->get_arr();`
 * To get an array of the linked pages:
 * `$links = ( new MslsOutput() )->get( 0, true );`
 *  [seo90](https://wordpress.org/support/users/seo90/)
 * (@seo90)
 * [7 years, 12 months ago](https://wordpress.org/support/topic/array-of-language-link/#post-10714261)
 * Hello, Dennis.
 * I’ve been trying for days to have an array with the language + link but including
   the current language, i.e. if I’m in the Italian wordpress, it only shows me 
   the US and Russian wordpress, but not the Italian… How can I make it even show
   me the current?
 * Thanks.
 *  Plugin Author [Dennis Ploetner](https://wordpress.org/support/users/realloc/)
 * (@realloc)
 * [7 years, 12 months ago](https://wordpress.org/support/topic/array-of-language-link/#post-10714748)
 * I guess that you can just use get_permalink without any parameters.
 *  [seo90](https://wordpress.org/support/users/seo90/)
 * (@seo90)
 * [7 years, 12 months ago](https://wordpress.org/support/topic/array-of-language-link/#post-10715516)
 * But in your code I saw the following, includes/MslsBlogCollection.php:
 *     ```
       	public function get_filtered( $filter = false ) {
       		if ( ! $filter && $this->current_blog_output ) {
       			return $this->get_objects();
       		}
   
       		return $this->get();
       	}
       ```
   
 * If $filter was supposed to be false, it should be executed.
 * `return $this->get_objects();`
 * And this does show all, including the current language… but it does not work,
   I must modify it this way:
 *     ```
       	public function get_filtered( $filter = false ) {
       		if ( $filter == false ) {
       			return $this->get_objects();
       		}
   
       		return $this->get();
       	}
       ```
   
 * And use
 *     ```
       $links = ( new MslsOutput() )->get( 0, false );
   
       print_r($links);
       ```
   
 * With this it does show all the languages… But I don’t want to modify the code
   of your plugin and then I would lose the changes once updated. Could you fix 
   it in the next version, please?
 * It seems that you had it in your code but it should not work, since there is 
   a class css that is added to the current language “current_language” but never
   shows the current language… So I figured it was a bug
 *     ```
       					$arr[] = sprintf(
       						'<a href="%s" title="%s"%s>%s</a>',
       						$url,
       						$link->txt,
       						( $current ? ' class="current_language"' : '' ),
       						$link
       					);
       ```
   
 * Thanks.
 *  Plugin Author [Dennis Ploetner](https://wordpress.org/support/users/realloc/)
 * (@realloc)
 * [7 years, 12 months ago](https://wordpress.org/support/topic/array-of-language-link/#post-10715573)
 * Did you activate the link to the current language in the dashboard?
 *  [seo90](https://wordpress.org/support/users/seo90/)
 * (@seo90)
 * [7 years, 12 months ago](https://wordpress.org/support/topic/array-of-language-link/#post-10715689)
 * Oh, thank you, that was it. Lol… I’ve been doing this for days and look how simple
   it was.

Viewing 6 replies - 1 through 6 (of 6 total)

 The topic ‘Array of language + link’ is closed to new replies.

 * ![](https://ps.w.org/multisite-language-switcher/assets/icon-256x256.png?rev=
   2793358)
 * [Multisite Language Switcher](https://wordpress.org/plugins/multisite-language-switcher/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/multisite-language-switcher/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/multisite-language-switcher/)
 * [Active Topics](https://wordpress.org/support/plugin/multisite-language-switcher/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/multisite-language-switcher/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/multisite-language-switcher/reviews/)

 * 6 replies
 * 3 participants
 * Last reply from: [seo90](https://wordpress.org/support/users/seo90/)
 * Last activity: [7 years, 12 months ago](https://wordpress.org/support/topic/array-of-language-link/#post-10715689)
 * Status: not resolved