Skip to content

Instantly share code, notes, and snippets.

@jacobdubail jacobdubail/php
Created Jan 30, 2017

Embed
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
You can’t perform that action at this time.