Language_Pack_Upgrader::get_name_for_update()
Gets the name of an item being updated.
Метод класса: Language_Pack_Upgrader{}
Хуков нет.
Возвращает
Строку
. The name of the item being updated.
Использование
$Language_Pack_Upgrader = new Language_Pack_Upgrader(); $Language_Pack_Upgrader->get_name_for_update( $update );
- $update(объект) (обязательный)
- The data for an update.
Список изменений
С версии 3.7.0 | Введена. |
Код Language_Pack_Upgrader::get_name_for_update() Language Pack Upgrader::get name for update WP 6.7.1
public function get_name_for_update( $update ) { switch ( $update->type ) { case 'core': return 'WordPress'; // Not translated. case 'theme': $theme = wp_get_theme( $update->slug ); if ( $theme->exists() ) { return $theme->Get( 'Name' ); } break; case 'plugin': $plugin_data = get_plugins( '/' . $update->slug ); $plugin_data = reset( $plugin_data ); if ( $plugin_data ) { return $plugin_data['Name']; } break; } return ''; }