acf_field_message::render_field_settings()publicACF 3.6

Create extra options for your field. This is rendered when editing a field. The value of $field['name'] can be used (like bellow) to save extra data to the $field

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

Хуков нет.

Возвращает

null. Ничего.

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

$acf_field_message = new acf_field_message();
$acf_field_message->render_field_settings( $field );
$field (обязательный)
-

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

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

Код acf_field_message::render_field_settings() ACF 5.10.2

function render_field_settings( $field ) {

	// default_value
	acf_render_field_setting(
		$field,
		array(
			'label'        => __( 'Message', 'acf' ),
			'instructions' => '',
			'type'         => 'textarea',
			'name'         => 'message',
		)
	);

	// formatting
	acf_render_field_setting(
		$field,
		array(
			'label'        => __( 'New Lines', 'acf' ),
			'instructions' => __( 'Controls how new lines are rendered', 'acf' ),
			'type'         => 'select',
			'name'         => 'new_lines',
			'choices'      => array(
				'wpautop' => __( 'Automatically add paragraphs', 'acf' ),
				'br'      => __( 'Automatically add <br>', 'acf' ),
				''        => __( 'No Formatting', 'acf' ),
			),
		)
	);

	// HTML
	acf_render_field_setting(
		$field,
		array(
			'label'        => __( 'Escape HTML', 'acf' ),
			'instructions' => __( 'Allow HTML markup to display as visible text instead of rendering', 'acf' ),
			'name'         => 'esc_html',
			'type'         => 'true_false',
			'ui'           => 1,
		)
	);

}