Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On update_value check if value is string #35

Merged
merged 3 commits into from
Oct 14, 2022
Merged

Conversation

zcuric
Copy link
Contributor

@zcuric zcuric commented Apr 8, 2022

This PR

  • 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.

@Log1x
Copy link
Owner

Log1x commented Apr 8, 2022

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.

@zcuric
Copy link
Contributor Author

zcuric commented Apr 11, 2022

@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.

@Log1x Log1x merged commit 468c8a8 into Log1x:master Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants