wppaste
WordPress

wp_theme_update_row( string $theme_key, WP_Theme $theme ): void|false

Since
3.1.0
Source
wp-admin/includes/update.php:676
Displays update information for a theme.

Parameters

$theme_keystring
Theme stylesheet.
$themeWP_Theme
Theme object.

Return

void|false

Hooks fired · 1

One hook fires while wp_theme_update_row() runs, in this order:

  1. do_action( in_theme_update_message-{$theme_key} )actionline 839 (+163 into the body)

    Fires at the end of the update message container in each row of the themes list table.

Uses · 15

Show all 15

Source

function wp_theme_update_row( $theme_key, $theme ) {	$current = get_site_transient( 'update_themes' ); 	if ( ! isset( $current->response[ $theme_key ] ) ) {		return false;	} 	$response = $current->response[ $theme_key ]; 	$details_url = add_query_arg(		array(			'TB_iframe' => 'true',			'width'     => 1024,			'height'    => 800,		),		$current->response[ $theme_key ]['url']	); 	/** @var WP_MS_Themes_List_Table $wp_list_table */	$wp_list_table = _get_list_table( 'WP_MS_Themes_List_Table' ); 	$active = $theme->is_allowed( 'network' ) ? ' active' : ''; 	$requires_wp  = isset( $response['requires'] ) ? $response['requires'] : null;	$requires_php = isset( $response['requires_php'] ) ? $response['requires_php'] : null; 	$compatible_wp  = is_wp_version_compatible( $requires_wp );	$compatible_php = is_php_version_compatible( $requires_php ); 	printf(		'<tr class="plugin-update-tr%s" id="%s" data-slug="%s">' .		'<td colspan="%s" class="plugin-update colspanchange">' .		'<div class="update-message notice inline notice-warning notice-alt"><p>',		$active,		esc_attr( $theme->get_stylesheet() . '-update' ),		esc_attr( $theme->get_stylesheet() ),		$wp_list_table->get_column_count()	); 	if ( $compatible_wp && $compatible_php ) {		if ( ! current_user_can( 'update_themes' ) ) {			printf(				/* translators: 1: Theme name, 2: Details URL, 3: Additional link attributes, 4: Version number. */				__( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>.' ),				$theme['Name'],				esc_url( $details_url ),				sprintf(					'class="thickbox open-plugin-details-modal" aria-label="%s"',					/* translators: 1: Theme name, 2: Version number. */					esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme['Name'], $response['new_version'] ) )				),				$response['new_version']			);		} elseif ( empty( $response['package'] ) ) {			printf(				/* translators: 1: Theme name, 2: Details URL, 3: Additional link attributes, 4: Version number. */				__( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>' ),				$theme['Name'],				esc_url( $details_url ),				sprintf(					'class="thickbox open-plugin-details-modal" aria-label="%s"',					/* translators: 1: Theme name, 2: Version number. */					esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme['Name'], $response['new_version'] ) )				),				$response['new_version']			);		} else {			printf(				/* translators: 1: Theme name, 2: Details URL, 3: Additional link attributes, 4: Version number, 5: Update URL, 6: Additional link attributes. */				__( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a> or <a href="%5$s" %6$s>update now</a>.' ),				$theme['Name'],				esc_url( $details_url ),				sprintf(					'class="thickbox open-plugin-details-modal" aria-label="%s"',					/* translators: 1: Theme name, 2: Version number. */					esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme['Name'], $response['new_version'] ) )				),				$response['new_version'],				wp_nonce_url( self_admin_url( 'update.php?action=upgrade-theme&theme=' ) . $theme_key, 'upgrade-theme_' . $theme_key ),				sprintf(

History

Introduced in 3.1.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.7.7 tag, from src/wp-admin/includes/update.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.