PHP Класс WP_CLI\CommandWithTranslation

Наследование: extends WP_CLI_Command
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$obj_fields
$obj_type

Открытые методы

Метод Описание
activate ( $args, $assoc_args ) Activate a given language.
install ( $args, $assoc_args ) Install a given language.
list_ ( $args, $assoc_args ) List all available languages.
uninstall ( $args, $assoc_args ) Uninstall a given language.
update ( $args, $assoc_args ) Update installed languages.

Защищенные методы

Метод Описание
get_all_languages ( ) : array Return a list of all languages
get_formatter ( array &$assoc_args ) : Formatter Get Formatter object based on supplied parameters.
get_installed_languages ( ) : array Return a list of installed languages.
sort_translations_callback ( $a, $b ) Callback to sort array by a 'language' key.

Приватные методы

Метод Описание
download_language_pack ( string $download ) : string | WP_Error Download a language pack.
get_translation_updates ( ) : array Get all updates available for all translations
wp_clean_update_cache ( ) Replicates wp_clean_update_cache() for use in WP 4.0

Описание методов

activate() публичный Метод

: Language code to activate. ## EXAMPLES $ wp core language activate ja Success: Language activated.
public activate ( $args, $assoc_args )

get_all_languages() защищенный Метод

Return a list of all languages
protected get_all_languages ( ) : array
Результат array

get_formatter() защищенный Метод

Get Formatter object based on supplied parameters.
protected get_formatter ( array &$assoc_args ) : Formatter
$assoc_args array Parameters passed to command. Determines formatting.
Результат Formatter

get_installed_languages() защищенный Метод

Return a list of installed languages.
protected get_installed_languages ( ) : array
Результат array

install() публичный Метод

Downloads the language pack from WordPress.org. : Language code to install. [--activate] : If set, the language will be activated immediately after install. ## EXAMPLES # Install the Japanese language. $ wp core language install ja Success: Language installed.
public install ( $args, $assoc_args )

list_() публичный Метод

[--field=] : Display the value of a single field [--=] : Filter results by key=value pairs. [--fields=] : Limit the output to specific fields. [--format=] : Accepted values: table, csv, json. Default: table ## AVAILABLE FIELDS These fields will be displayed by default for each translation: * language * english_name * native_name * status * update * updated These fields are optionally available: * version * package ## EXAMPLES # List language,english_name,status fields of available languages. $ wp core language list --fields=language,english_name,status +----------------+-------------------------+-------------+ | language | english_name | status | +----------------+-------------------------+-------------+ | ar | Arabic | uninstalled | | ary | Moroccan Arabic | uninstalled | | az | Azerbaijani | uninstalled |
public list_ ( $args, $assoc_args )

sort_translations_callback() защищенный Метод

Callback to sort array by a 'language' key.
protected sort_translations_callback ( $a, $b )

uninstall() публичный Метод

: Language code to uninstall. ## EXAMPLES $ wp core language uninstall ja Success: Language uninstalled.
public uninstall ( $args, $assoc_args )

update() публичный Метод

Updates installed languages for core, plugins and themes. [--dry-run] : Preview which translations would be updated. ## EXAMPLES $ wp core language update Updating 'Japanese' translation for Akismet 3.1.11... Downloading translation from https://downloads.wordpress.org/translation/plugin/akismet/3.1.11/ja.zip... Translation updated successfully. Updating 'Japanese' translation for Twenty Fifteen 1.5... Downloading translation from https://downloads.wordpress.org/translation/theme/twentyfifteen/1.5/ja.zip... Translation updated successfully. Success: Updated 2/2 translations.
public update ( $args, $assoc_args )

Описание свойств

$obj_fields защищенное свойство

protected $obj_fields

$obj_type защищенное свойство

protected $obj_type