acf_get_empty_block_form_html()ACF 6.0.0

Render the empty block form for when a block has no fields assigned.

Хуки из функции

Возвращает

Строку. The html that makes up a block form with no fields.

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

acf_get_empty_block_form_html( $block_name );
$block_name(строка) (обязательный)
The block name current being rendered.

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

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

Код acf_get_empty_block_form_html() ACF 6.0.4

function acf_get_empty_block_form_html( $block_name ) {
	$html = '<div class="acf-block-fields acf-fields acf-empty-block-fields">';

	$message = __( 'This block contains no editable fields.', 'acf' );

	if ( acf_current_user_can_admin() ) {
		$message .= ' ';
		$message .= sprintf(
			/* translators: %s: an admin URL to the field group edit screen */
			__( 'Assign a <a href="%s" target="_blank">field group</a> to add fields to this block.', 'acf' ),
			admin_url( 'edit.php?post_type=acf-field-group' )
		);
	}

	$html .= apply_filters( 'acf/blocks/no_fields_assigned_message', $message, $block_name );

	$html .= '</div>';
	return acf_esc_html( $html );
}