PHP Class Inpsyde\MultilingualPress\Module\UserAdminLanguage\Setting

Since: 3.0.0
Inheritance: implements Inpsyde\MultilingualPress\Common\Setting\User\UserSettingViewModel
Datei anzeigen Open project: inpsyde/multilingual-press

Public Methods

Method Description
__construct ( string $meta_key, Inpsyde\MultilingualPress\Common\Nonce\Nonce $nonce, Inpsyde\MultilingualPress\Module\UserAdminLanguage\LanguageRepository $language_repository ) Constructor. Sets up the properties.
markup ( WP_User $user ) : string Returns the markup for the user setting.
title ( WP_User $user ) : string Returns the title of the user setting.

Private Methods

Method Description
get_language_option ( string $text, string $value, string $selected ) : string Returns the HTML of the option element according to the given arguments.
get_language_options ( array $language_files, string $selected ) : string Returns the HTML of the option elements according to the given available languages and the selected one.

Method Details

__construct() public method

Constructor. Sets up the properties.
Since: 3.0.0
public __construct ( string $meta_key, Inpsyde\MultilingualPress\Common\Nonce\Nonce $nonce, Inpsyde\MultilingualPress\Module\UserAdminLanguage\LanguageRepository $language_repository )
$meta_key string User meta key.
$nonce Inpsyde\MultilingualPress\Common\Nonce\Nonce Nonce validator object.
$language_repository Inpsyde\MultilingualPress\Module\UserAdminLanguage\LanguageRepository Language repository object.

markup() public method

Returns the markup for the user setting.
Since: 3.0.0
public markup ( WP_User $user ) : string
$user WP_User User object.
return string The markup for the user setting.

title() public method

Returns the title of the user setting.
Since: 3.0.0
public title ( WP_User $user ) : string
$user WP_User User object.
return string The markup for the user setting.