acf-editor-palette icon indicating copy to clipboard operation
acf-editor-palette copied to clipboard

On update_value check if value is string

Open zcuric opened this issue 3 years ago • 2 comments

This PR

  • [x] Adds a check if value is_string

Context

In some cases when copying flexible layouts, value would default to white, because instead of actual $value which is a slug, $color object would be sent.

With this case if value is not empty and it's not string we can be sure that the value is color object and we can pull the slug which will result in correct result.

zcuric avatar Apr 08 '22 13:04 zcuric

Thanks for the PR.

I assume you have tested this? You mentioned "in some cases" so I'm not sure how to reproduce the issue on my end to confirm the fix.

Log1x avatar Apr 08 '22 20:04 Log1x

@Log1x Sorry for the lack of context. I've used your plugin in combination with ACF Flexible Layouts Manager, and that plugin uses update_value when importing other layouts, which under the hood uses acf_update_value which picks up the entire object and sends it to update_value of your plugin.

zcuric avatar Apr 11 '22 16:04 zcuric