ooksanen / acf-focuspoint

ACF: FocusPoint
65 stars 16 forks source link

Field returns array with empty id when image gets deleted #8

Closed DenisLanz closed 3 years ago

DenisLanz commented 4 years ago

The field returns an array with the coordinates but without an image id. I would appreciate if the field aligns to the standard behaviour of the acf fields and return false if there is no image. This would make it easier to check for an empty field like

if ( get_field() ) {}
timbowen commented 4 years ago

Agreed Denis, that would be ideal. We used this workaround in the meantime: $focus_point = get_field('focus_point'); if ( !empty($focus_point['id']) ) {

DenisLanz commented 3 years ago

Yeah. I wrapped it into a function to avoid writing the check every time - still would appreciate if it is a part of the plugin.

ooksanen commented 3 years ago

Fixed in 1.1.5