функция
since 6.8.0
wp_render_empty_block_template_warning()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
wp_render_empty_block_template_warning( WP_Block_Template $block_template ): string
Описание
Отображает экран предупреждения для пустых шаблонов блоков.
Параметры
$block_template
WP_Block_Template
обязательный
Объект шаблона блока.
Возвращаемое значение
string
Исходный код
wp-includes/block-template.php:28
function wp_render_empty_block_template_warning( $block_template ) {
wp_enqueue_style( 'wp-empty-template-alert' );
return sprintf(
/* translators: %1$s: Block template title. %2$s: Empty template warning message. %3$s: Edit template link. %4$s: Edit template button label. */
'<div id="wp-empty-template-alert">
<h2>%1$s</h2>
<p>%2$s</p>
<a href="%3$s" class="wp-element-button">
%4$s
</a>
</div>',
esc_html( $block_template->title ),
__( 'This page is blank because the template is empty. You can reset or customize it in the Site Editor.' ),
get_edit_post_link( $block_template->wp_id, 'site-editor' ),
__( 'Edit template' )
);
}
История изменений
| Версия | Описание |
|---|---|
| 6.8.0 | Introduced. |

