Support

Account

Home Forums Add-ons User Submitted ACF: UUID

Unread

ACF: UUID

Tagged: 

    • cjke7777

    • December 21, 2016 at 10:16 pm

    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.

    If you have feedback do let me know.

    It is a simple field wrapper for the fantastic UUID library ramsey/uuid, found here: https://github.com/ramsey/uuid

    I have only tested it with php7 and ACFPro.

    https://github.com/cjke/acf-uuid

    Background:

    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.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.