Fragen\GitHub_Updater\Theme::wp_theme_update_row PHP Method

wp_theme_update_row() public method

Add custom theme update row, from /wp-admin/includes/update.php Display update details or rollback links for multisite installation.
Author: Seth Carstens
public wp_theme_update_row ( $theme_key, $theme )
$theme_key
$theme
    public function wp_theme_update_row($theme_key, $theme)
    {
        $current = get_site_transient('update_themes');
        $themes_allowedtags = array('a' => array('href' => array(), 'title' => array()), 'abbr' => array('title' => array()), 'acronym' => array('title' => array()), 'code' => array(), 'em' => array(), 'strong' => array());
        $theme_name = wp_kses($theme['Name'], $themes_allowedtags);
        $wp_list_table = _get_list_table('WP_MS_Themes_List_Table');
        $details_url = esc_attr(add_query_arg(array('tab' => 'theme-information', 'theme' => $theme_key, 'TB_iframe' => 'true', 'width' => 270, 'height' => 400), self_admin_url("theme-install.php")));
        $nonced_update_url = wp_nonce_url($this->get_update_url('theme', 'upgrade-theme', $theme_key), 'upgrade-theme_' . $theme_key);
        $enclosure = $this->update_row_enclosure($theme_key, 'theme');
        /*
         * Update transient if necessary.
         */
        if (empty($current->response) && empty($current->up_to_date)) {
            $this->pre_set_site_transient_update_themes($current);
        }
        if (isset($current->response[$theme_key])) {
            $response = $current->response[$theme_key];
            echo $enclosure['open'];
            printf(esc_html__('There is a new version of %s available.', 'github-updater'), $theme_name);
            printf(' <a href="%s" class="thickbox" title="%s"> ', $details_url, $theme_name);
            if (empty($response['package'])) {
                printf(esc_html__('View version %s details.', 'github-updater'), $response['new_version']);
                echo '</a><em>';
                esc_html_e('Automatic update is unavailable for this theme.', 'github-updater');
                echo '</em>';
            } else {
                printf(esc_html__('View version %1$s details%2$s or %3$supdate now%4$s.', 'github-updater'), $response['new_version'], '</a>', sprintf('<a href="' . $nonced_update_url . '" class="update-link" aria-label="' . esc_html__('Update %s now', 'github-updater') . '">', $theme_name), '</a>');
            }
            echo $enclosure['close'];
            do_action("in_theme_update_message-{$theme_key}", $theme, $response);
        }
    }