acf_inline_editing_field_is_empty()ACF 1.0

Helper function for block render templates to check if an acf field has a value. This is relevant when autoInlineEditing is enabled for a block, because empty fields will have acf_auto_inline_editing_field_name_ + field_name as their value if they are empty.

No Hooks.

Returns

true|false. True if the field is empty, false if it has a value.

Usage

acf_inline_editing_field_is_empty( $field_name );
$field_name(string) (required)
True if the field is empty, false if it has a value.

acf_inline_editing_field_is_empty() code ACF 6.8.8

function acf_inline_editing_field_is_empty( $field_name ) {
	$field_value = get_field( $field_name );

	if ( empty( $field_value ) || $field_value === 'acf_auto_inline_editing_field_name_' . $field_name ) {
		return true;
	}

	return false;
}