Skip to content

Commit 63c297f

Browse files
authored
Merge pull request #362 from lloc/refactoring-2-9
Gato GraphQL first implementation
2 parents d09401d + 134dcf0 commit 63c297f

File tree

2 files changed

+43
-6
lines changed

2 files changed

+43
-6
lines changed

MultisiteLanguageSwitcher.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,5 +152,46 @@ function msls_options(): \lloc\Msls\MslsOptions {
152152
return \lloc\Msls\MslsOptions::instance();
153153
}
154154

155+
/**
156+
* Retrieves the MslsOptionsPost instance.
157+
*
158+
* @param int $id
159+
* @return \lloc\Msls\MslsOptionsPost
160+
*/
161+
function msls_get_post( int $id ): \lloc\Msls\MslsOptionsPost {
162+
return new \lloc\Msls\MslsOptionsPost( $id );
163+
}
164+
165+
/**
166+
* Retrieves the MslsOptionsTax instance.
167+
*
168+
* Determines the current query based on conditional tags:
169+
* - is_category
170+
* - is_tag
171+
* - is_tax
172+
*
173+
* @param int $id
174+
* @return \lloc\Msls\MslsOptionsTax
175+
*/
176+
function msls_get_tax( int $id ): \lloc\Msls\MslsOptionsTax {
177+
return \lloc\Msls\MslsOptionsTax::create( $id );
178+
}
179+
180+
/**
181+
* Retrieves the MslsOptionsQuery instance.
182+
*
183+
* Determines the current query based on conditional tags:
184+
* - is_day
185+
* - is_month
186+
* - is_year
187+
* - is_author
188+
* - is_post_type_archive
189+
*
190+
* @return ?\lloc\Msls\MslsOptionsQuery
191+
*/
192+
function msls_get_query(): ?\lloc\Msls\MslsOptionsQuery {
193+
return \lloc\Msls\MslsOptionsQuery::create();
194+
}
195+
155196
lloc\Msls\MslsPlugin::init();
156197
}

readme.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ Please check the add-on [MslsMenu](https://wordpress.org/plugins/mslsmenu/) out.
6666

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

69-
= I don't want to upload the same media files for every site. What can I do? =
70-
71-
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.
72-
7369
= Can I call a function to get the language of the page the user is viewing? =
7470

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

82-
= How can I move from WPML to MSLS? =
78+
= If I have another question, where can I ask? =
8379

84-
There is a [plugin](http://wordpress.org/plugins/wpml2wpmsls/) which comes in handy here.
80+
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.
8581

8682
== Screenshots ==
8783

0 commit comments

Comments
 (0)