acf-focuspoint icon indicating copy to clipboard operation
acf-focuspoint copied to clipboard

Coordinates 0,0 should not be considered "unset"

Open avioli opened this issue 10 months ago • 2 comments

Using empty() ~or isset()~ has the downside of considering 0 (zero) falsy, but when top is 0 and left is 0 and someone wants to use that as the focus-point - it goes back to the center.

https://github.com/ooksanen/acf-focuspoint/blob/8b8b361dd94443257c19c3372fca8bc864909ba6/fields/class-acffp-acf-field-focuspoint-v5.php#L498

There are other places that this is affected.

Edit: isset() treats 0 correctly.

avioli avatar Apr 18 '24 06:04 avioli

Thanks for reporting @avioli, I'll check this as soon as possible.

ooksanen avatar Apr 18 '24 06:04 ooksanen

Made a PR #16

avioli avatar Apr 18 '24 23:04 avioli