get_name_for_update example

if ( $args['skip_header_footer'] ) {
            $this->done_header            = true;
            $this->done_footer            = true;
            $this->display_footer_actions = false;
        }
        parent::__construct( $args );
    }

    /** */
    public function before() {
        $name = $this->upgrader->get_name_for_update( $this->language_update );

        echo '<div class="update-messages lp-show-latest">';

        /* translators: 1: Project name (plugin, theme, or WordPress), 2: Language. */
        printf( '<h2>' . __( 'Updating translations for %1$s (%2$s)&#8230;' ) . '</h2>', $name$this->language_update->language );
    }

    /** * @since 5.9.0 Renamed `$error` to `$errors` for PHP 8 named parameter support. * * @param string|WP_Error $errors Errors. */
$plugin_data   = get_plugin_data( $context . '/' . $upgrader_item );
                $item_name     = $plugin_data['Name'];
                // Add the current version so that it can be reported in the notification email.                 $item->current_version = $plugin_data['Version'];
                if ( empty( $item->current_version ) ) {
                    $item->current_version = false;
                }
                /* translators: %s: Plugin name. */
                $skin->feedback( __( 'Updating plugin: %s' )$item_name );
                break;
            case 'translation':
                $language_item_name = $upgrader->get_name_for_update( $item );
                /* translators: %s: Project name (plugin, theme, or WordPress). */
                $item_name = sprintf( __( 'Translations for %s' )$language_item_name );
                /* translators: 1: Project name (plugin, theme, or WordPress), 2: Language. */
                $skin->feedback( sprintf( __( 'Updating translations for %1$s (%2$s)&#8230;' )$language_item_name$item->language ) );
                break;
        }

        $allow_relaxed_file_ownership = false;
        if ( 'core' === $type && isset( $item->new_files ) && ! $item->new_files ) {
            $allow_relaxed_file_ownership = true;
        }

        
Home | Imprint | This part of the site doesn't use cookies.