Programmatically setting ACF license key

EDIT – 2022-04-12

This code doesn’t actually work. I think it did while I was testing because of some glitches elsewhere. Instead, you can now just set the constant ACF_PRO_LICENSE.

You can use the following code to inject the Advanced Custom Fields Pro license key automatically:

    function ($value, $option, $default) {
        return base64_encode(
                        'key' => '...',
                        'url' =>  home_url(),

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.