Skip to content

Instantly share code, notes, and snippets.

Created January 30, 2017 23:44
What would you like to do?
Function to auto-set your ACF5 Pro license key
function jtd_acf_auto_set_license_keys() {
if ( !get_option('acf_pro_license') && defined('ACF_5_KEY') ) {
$save = array(
'key' => ACF_5_KEY,
'url' => home_url()
$save = maybe_serialize($save);
$save = base64_encode($save);
update_option('acf_pro_license', $save);
add_action('after_switch_theme', 'jtd_acf_auto_set_license_keys');
// you may want to add additional actions here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment