-
-
Save jacobdubail/d5b5e76e6daca8a3258518fe710ed102 to your computer and use it in GitHub Desktop.
Function to auto-set your ACF5 Pro license key
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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