функция since 3.3.0

wp_welcome_panel()

Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.

Сигнатура

wp_welcome_panel()

Описание

Отображает приветственную панель, знакомящую пользователей с WordPress.

Исходный код

wp-admin/includes/dashboard.php:2073

function wp_welcome_panel() {
	list( $display_version ) = explode( '-', wp_get_wp_version() );
	$can_customize           = current_user_can( 'customize' );
	$is_block_theme          = wp_is_block_theme();
	?>
	<div class="welcome-panel-content">
	<div class="welcome-panel-header-wrap">
		<div class="welcome-panel-header">
			<div class="welcome-panel-header-image">
				<?php echo file_get_contents( dirname( __DIR__ ) . '/images/dashboard-background.svg' ); ?>
			</div>
			<h2><?php _e( 'Welcome to WordPress!' ); ?></h2>
			<p>
				<a href="<?php echo esc_url( admin_url( 'about.php' ) ); ?>">
				<?php
					/* translators: %s: Current WordPress version. */
					printf( __( 'Learn more about the %s version.' ), esc_html( $display_version ) );
				?>
				</a>
			</p>
		</div>
	</div>
	<div class="welcome-panel-column-container">
		<div class="welcome-panel-column">
			<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
				<rect width="48" height="48" rx="4" fill="#E1E1E"/>
				<path fill-rule="evenodd" clip-rule="evenodd" d="M32.0668 17.L28.8221 13.L18.2008 24.L16.8983 29.L21.4257 27.L32.0668 17.ZM16 32.H24V31.H16V32.Z" fill="white"/>
			</svg>
			<div class="welcome-panel-column-content">
				<h3><?php _e( 'Author rich content with blocks and patterns' ); ?></h3>
				<p><?php _e( 'Block patterns are pre-configured block layouts. Use them to get inspired or create new pages in a flash.' ); ?></p>
				<a href="<?php echo esc_url( admin_url( 'post-new.php?post_type=page' ) ); ?>"><?php _e( 'Add a new page' ); ?></a>
			</div>
		</div>
		<div class="welcome-panel-column">
			<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
				<rect width="48" height="48" rx="4" fill="#E1E1E"/>
				<path fill-rule="evenodd" clip-rule="evenodd" d="M18 h12a2 2 0 0 1 2 v12a2 2 0 0 1-2 H18a2 2 0 0 1-2-V18a2 2 0 0 1 2-zm12 1.H18a.5.5 0 0 0-.5.v3h13v-a.5.5 0 0 0-.5-.zm.5 H22v8h8a.5.5 0 0 0 .5-.v-7.zm-10 h-V30a.5.5 0 0 0 .5.h2.v-z" fill="#fff"/>
			</svg>
			<div class="welcome-panel-column-content">
			<?php if ( $is_block_theme ) : ?>
				<h3><?php _e( 'Customize your entire site with block themes' ); ?></h3>
				<p><?php _e( 'Design everything on your site — from the header down to the footer, all using blocks and patterns.' ); ?></p>
				<a href="<?php echo esc_url( admin_url( 'site-editor.php' ) ); ?>"><?php _e( 'Open site editor' ); ?></a>
			<?php else : ?>
				<h3><?php _e( 'Start Customizing' ); ?></h3>
				<p><?php _e( 'Configure your site’s logo, header, menus, and more in the Customizer.' ); ?></p>
				<?php if ( $can_customize ) : ?>
					<a class="load-customize hide-if-no-customize" href="<?php echo wp_customize_url(); ?>"><?php _e( 'Open the Customizer' ); ?></a>
				<?php endif; ?>
			<?php endif; ?>
			</div>
		</div>
		<div class="welcome-panel-column">
			<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
				<rect width="48" height="48" rx="4" fill="#E1E1E"/>
				<path fill-rule="evenodd" clip-rule="evenodd" d="M31 a7 7 0 0 1-7 V17a7 7 0 0 1 7 zm-7-a8 8 0 1 1 0 16 8 8 0 0 1 0-z" fill="#fff"/>
			</svg>
			<div class="welcome-panel-column-content">
			<?php if ( $is_block_theme ) : ?>
				<h3><?php _e( 'Switch up your site’s look & feel with Styles' ); ?></h3>
				<p><?php _e( 'Tweak your site, or give it a whole new look! Get creative — how about a new color palette or font?' ); ?></p>
				<a href="<?php echo esc_url( add_query_arg( 'p', rawurlencode( '/styles' ), admin_url( 'site-editor.php' ) ) ); ?>"><?php _e( 'Edit styles' ); ?></a>
			<?php else : ?>
				<h3><?php _e( 'Discover a new way to build your site.' ); ?></h3>
				<p><?php _e( 'There is a new kind of WordPress theme, called a block theme, that lets you build the site you’ve always wanted — with blocks and styles.' ); ?></p>
				<a href="<?php echo esc_url( __( 'https://wordpress.org/documentation/article/block-themes/' ) ); ?>"><?php _e( 'Learn about block themes' ); ?></a>
			<?php endif; ?>
			</div>
		</div>
	</div>
	</div>
	<?php
}

История изменений

ВерсияОписание
5.9.0 Send users to the Site Editor if the active theme is block-based.
3.3.0 Introduced.

Что будем искать? Например,Продвижение

Этот сайт использует куки-файлы. Оставаясь на сайте, Вы соглашаетесь на их использование. Для получения дополнительной информации, пожалуйста, ознакомьтесь с политикой в отношении персональных данных.