Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions MultisiteLanguageSwitcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,46 @@ function msls_options(): \lloc\Msls\MslsOptions {
return \lloc\Msls\MslsOptions::instance();
}

/**
* Retrieves the MslsOptionsPost instance.
*
* @param int $id
* @return \lloc\Msls\MslsOptionsPost
*/
function msls_get_post( int $id ): \lloc\Msls\MslsOptionsPost {
return new \lloc\Msls\MslsOptionsPost( $id );
}

/**
* Retrieves the MslsOptionsTax instance.
*
* Determines the current query based on conditional tags:
* - is_category
* - is_tag
* - is_tax
*
* @param int $id
* @return \lloc\Msls\MslsOptionsTax
*/
function msls_get_tax( int $id ): \lloc\Msls\MslsOptionsTax {
return \lloc\Msls\MslsOptionsTax::create( $id );
}

/**
* Retrieves the MslsOptionsQuery instance.
*
* Determines the current query based on conditional tags:
* - is_day
* - is_month
* - is_year
* - is_author
* - is_post_type_archive
*
* @return ?\lloc\Msls\MslsOptionsQuery
*/
function msls_get_query(): ?\lloc\Msls\MslsOptionsQuery {
return \lloc\Msls\MslsOptionsQuery::create();
}

lloc\Msls\MslsPlugin::init();
}
8 changes: 2 additions & 6 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ Please check the add-on [MslsMenu](https://wordpress.org/plugins/mslsmenu/) out.

Please check the add-on [MslsSelect](https://wordpress.org/plugins/mslsselect/) out.

= I don't want to upload the same media files for every site. What can I do? =

You could try the plugin [Network Shared Media](http://wordpress.org/plugins/network-shared-media/). It adds a new tab to the "Add Media" window, allowing you to access the media files on the other sites in your multisite.

= Can I call a function to get the language of the page the user is viewing? =

Yes, you should use the WordPress API function `get_locale()` but you could also use code like that
Expand All @@ -79,9 +75,9 @@ Yes, you should use the WordPress API function `get_locale()` but you could also
$blog = MslsBlogCollection::instance()->get_current_blog();
$language = $blog->get_language();`

= How can I move from WPML to MSLS? =
= If I have another question, where can I ask? =

There is a [plugin](http://wordpress.org/plugins/wpml2wpmsls/) which comes in handy here.
Please visit the [MSLS website](https://msls.co/) or use the [WordPress support forum](https://wordpress.org/support/plugin/multisite-language-switcher) for more information.

== Screenshots ==

Expand Down