WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WP_Theme_Install_List_Table::install_theme_info() public WP 1.0

Prints the info for a theme (to be used in the theme installer modal).

Это метод класса: WP_Theme_Install_List_Table{}

Хуков нет.

Возвращает

Null. Ничего.

Использование

$WP_Theme_Install_List_Table = new WP_Theme_Install_List_Table();
$WP_Theme_Install_List_Table->install_theme_info( $theme );
$theme(объект) (обязательный)
- A WordPress.org Theme API object.

Заметки

  • Global. Массив. $themes_allowedtags

Код WP_Theme_Install_List_Table::install_theme_info() WP 5.5.1

wp-admin/includes/class-wp-theme-install-list-table.php
<?php
public function install_theme_info( $theme ) {
	global $themes_allowedtags;

	if ( empty( $theme ) ) {
		return;
	}

	$name   = wp_kses( $theme->name, $themes_allowedtags );
	$author = wp_kses( $theme->author, $themes_allowedtags );

	$install_url = add_query_arg(
		array(
			'action' => 'install-theme',
			'theme'  => $theme->slug,
		),
		self_admin_url( 'update.php' )
	);

	$update_url = add_query_arg(
		array(
			'action' => 'upgrade-theme',
			'theme'  => $theme->slug,
		),
		self_admin_url( 'update.php' )
	);

	$status = $this->_get_theme_status( $theme );

	?>
	<div class="install-theme-info">
	<?php
	switch ( $status ) {
		case 'update_available':
			printf(
				'<a class="theme-install button button-primary" href="%s" title="%s">%s</a>',
				esc_url( wp_nonce_url( $update_url, 'upgrade-theme_' . $theme->slug ) ),
				/* translators: %s: Theme version. */
				esc_attr( sprintf( __( 'Update to version %s' ), $theme->version ) ),
				__( 'Update' )
			);
			break;
		case 'newer_installed':
		case 'latest_installed':
			printf(
				'<span class="theme-install" title="%s">%s</span>',
				esc_attr__( 'This theme is already installed and is up to date' ),
				_x( 'Installed', 'theme' )
			);
			break;
		case 'install':
		default:
			printf(
				'<a class="theme-install button button-primary" href="%s">%s</a>',
				esc_url( wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) ),
				__( 'Install' )
			);
			break;
	}
	?>
		<h3 class="theme-name"><?php echo $name; ?></h3>
		<span class="theme-by">
		<?php
			/* translators: %s: Theme author. */
			printf( __( 'By %s' ), $author );
		?>
		</span>
		<?php if ( isset( $theme->screenshot_url ) ) : ?>
			<img class="theme-screenshot" src="<?php echo esc_url( $theme->screenshot_url ); ?>" alt="" />
		<?php endif; ?>
		<div class="theme-details">
			<?php
			wp_star_rating(
				array(
					'rating' => $theme->rating,
					'type'   => 'percent',
					'number' => $theme->num_ratings,
				)
			);
			?>
			<div class="theme-version">
				<strong><?php _e( 'Version:' ); ?> </strong>
				<?php echo wp_kses( $theme->version, $themes_allowedtags ); ?>
			</div>
			<div class="theme-description">
				<?php echo wp_kses( $theme->description, $themes_allowedtags ); ?>
			</div>
		</div>
		<input class="theme-preview-url" type="hidden" value="<?php echo esc_url( $theme->preview_url ); ?>" />
	</div>
	<?php
}