Language_Pack_Upgrader::get_name_for_update() – Get the name of an item being updated.

You appear to be a bot. Output may be restricted

Description

Get the name of an item being updated.

Usage

$string = Language_Pack_Upgrader::get_name_for_update( $update );

Parameters

$update
( object ) required – The data for an update.

Returns

string The name of the item being updated.

Source

File name: wordpress/wp-admin/includes/class-language-pack-upgrader.php
Lines:

1 to 21 of 21
  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 '';
  }
 

 View on GitHub View on Trac