@@ -203,15 +203,15 @@ public static function verify_cookie( $value ) {
203
203
* Attempts to switch to the given locale.
204
204
*
205
205
* This is a wrapper around `switch_to_locale()` which is safe to call at any point, even
206
- * before the `$wp_locale_switcher` global is initialised or if the function does not exist .
206
+ * before the `$wp_locale_switcher` global is initialised.
207
207
*
208
208
* @param string $locale The locale.
209
209
* @return bool True on success, false on failure.
210
210
*/
211
211
public static function switch_to_locale ( $ locale ) {
212
212
global $ wp_locale_switcher ;
213
213
214
- if ( function_exists ( ' switch_to_locale ' ) && ( $ wp_locale_switcher instanceof WP_Locale_Switcher ) ) {
214
+ if ( $ wp_locale_switcher instanceof WP_Locale_Switcher ) {
215
215
return switch_to_locale ( $ locale );
216
216
}
217
217
@@ -222,14 +222,14 @@ public static function switch_to_locale( $locale ) {
222
222
* Attempts to restore the previous locale.
223
223
*
224
224
* This is a wrapper around `restore_previous_locale()` which is safe to call at any point, even
225
- * before the `$wp_locale_switcher` global is initialised or if the function does not exist .
225
+ * before the `$wp_locale_switcher` global is initialised.
226
226
*
227
227
* @return string|false Locale on success, false on error.
228
228
*/
229
229
public static function restore_previous_locale () {
230
230
global $ wp_locale_switcher ;
231
231
232
- if ( function_exists ( ' restore_previous_locale ' ) && ( $ wp_locale_switcher instanceof WP_Locale_Switcher ) ) {
232
+ if ( $ wp_locale_switcher instanceof WP_Locale_Switcher ) {
233
233
return restore_previous_locale ();
234
234
}
235
235
0 commit comments