I recently had the need for a UUID v4 field, so I have put together a small addon to handle that. I’ve marked it as v0.0.1 as I will refine it based on a) how it ends up getting used in my application/s (I will most likely hit certain improvements/bugs that could be added/fixed) and b) feedback here.
I’m putting it up at quite a preliminary stage to gauge interest in a much smaller setting. The ACF community is smaller than say PHP in general.
My use case was the need for the (near) guaranteed uniqueness that UUID provides while transporting ACF data between WP environments. Relying on auto-incrementing wasn’t ideal as the current auto-increment value might vary from environment to environment. With a UUID, I can assign a UUID value directly to a post (or custom post type) in any environment, and when migrated to another it maintains that UUID. Unfortunately (but understandably) the UUID is stored in postmeta.meta_value, so even though UUID is (kind of) used as a unique identifier, it won’t reap the benefits of indexing.
Viewing 1 post (of 1 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users