PHP Class Inpsyde\MultilingualPress\Module\UserAdminLanguage\LocaleFilter

Since: 3.0.0
Show file Open project: inpsyde/multilingual-press

Public Methods

Method Description
__construct ( Inpsyde\MultilingualPress\Module\UserAdminLanguage\LanguageRepository $language_repository ) Constructor. Sets up the properties.
disable ( ) : boolean Removes the filter.
enable ( ) : boolean Adds the filter.
filter_locale ( string $locale ) : string Filters the locale and returns the user admin language of the current user, if set.

Method Details

__construct() public method

Constructor. Sets up the properties.
Since: 3.0.0
public __construct ( Inpsyde\MultilingualPress\Module\UserAdminLanguage\LanguageRepository $language_repository )
$language_repository Inpsyde\MultilingualPress\Module\UserAdminLanguage\LanguageRepository Language repository object.

disable() public method

Removes the filter.
Since: 3.0.0
public disable ( ) : boolean
return boolean Whether or not the filter was removed successfully.

enable() public method

Adds the filter.
Since: 3.0.0
public enable ( ) : boolean
return boolean Whether or not the filter was added successfully.

filter_locale() public method

Filters the locale and returns the user admin language of the current user, if set.
Since: 3.0.0
public filter_locale ( string $locale ) : string
$locale string The current locale.
return string The (filtered) locale.