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

WP_MS_Themes_List_Table::column_description() public WP 4.3.0

Handles the description column output.

Ищем WP-разработчика! Фулл-тайм, удаленка, хорошая зарплата, соц. пакет. Подробности.
Компания Boosta.

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

Хуки из метода

Возвращает

null. Ничего.

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

$WP_MS_Themes_List_Table = new WP_MS_Themes_List_Table();
$WP_MS_Themes_List_Table->column_description( $theme );
$theme(WP_Theme) (обязательный)
The current WP_Theme object.

Заметки

  • Global. Строка. $status
  • Global. Массив. $totals

Список изменений

С версии 4.3.0 Введена.

Код WP_MS_Themes_List_Table::column_description() WP 5.8.1

public function column_description( $theme ) {
	global $status, $totals;

	if ( $theme->errors() ) {
		$pre = 'broken' === $status ? __( 'Broken Theme:' ) . ' ' : '';
		echo '<p><strong class="error-message">' . $pre . $theme->errors()->get_error_message() . '</strong></p>';
	}

	if ( $this->is_site_themes ) {
		$allowed = $theme->is_allowed( 'site', $this->site_id );
	} else {
		$allowed = $theme->is_allowed( 'network' );
	}

	$class = ! $allowed ? 'inactive' : 'active';
	if ( ! empty( $totals['upgrade'] ) && ! empty( $theme->update ) ) {
		$class .= ' update';
	}

	echo "<div class='theme-description'><p>" . $theme->display( 'Description' ) . "</p></div>
		<div class='$class second theme-version-author-uri'>";

	$stylesheet = $theme->get_stylesheet();
	$theme_meta = array();

	if ( $theme->get( 'Version' ) ) {
		/* translators: %s: Theme version. */
		$theme_meta[] = sprintf( __( 'Version %s' ), $theme->display( 'Version' ) );
	}

	/* translators: %s: Theme author. */
	$theme_meta[] = sprintf( __( 'By %s' ), $theme->display( 'Author' ) );

	if ( $theme->get( 'ThemeURI' ) ) {
		/* translators: %s: Theme name. */
		$aria_label = sprintf( __( 'Visit %s homepage' ), $theme->display( 'Name' ) );

		$theme_meta[] = sprintf(
			'<a href="%s" aria-label="%s">%s</a>',
			$theme->display( 'ThemeURI' ),
			esc_attr( $aria_label ),
			__( 'Visit Theme Site' )
		);
	}

	if ( $theme->parent() ) {
		$theme_meta[] = sprintf(
			/* translators: %s: Theme name. */
			__( 'Child theme of %s' ),
			'<strong>' . $theme->parent()->display( 'Name' ) . '</strong>'
		);
	}

	/**
	 * Filters the array of row meta for each theme in the Multisite themes
	 * list table.
	 *
	 * @since 3.1.0
	 *
	 * @param string[] $theme_meta An array of the theme's metadata, including
	 *                             the version, author, and theme URI.
	 * @param string   $stylesheet Directory name of the theme.
	 * @param WP_Theme $theme      WP_Theme object.
	 * @param string   $status     Status of the theme.
	 */
	$theme_meta = apply_filters( 'theme_row_meta', $theme_meta, $stylesheet, $theme, $status );

	echo implode( ' | ', $theme_meta );

	echo '</div>';
}