Guest User

Untitled

a guest
Aug 24th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. // Place this in wp-config
  2. define('ACF_5_KEY','yourkeyhere');
  3.  
  4. // Set ACF 5 license key on theme activation. Stick in your functions.php or equivalent.
  5. function auto_set_license_keys() {
  6.  
  7. if ( !get_option('acf_pro_license') && defined('ACF_5_KEY') ) {
  8.  
  9. $save = array(
  10. 'key' => ACF_5_KEY,
  11. 'url' => home_url()
  12. );
  13.  
  14. $save = maybe_serialize($save);
  15. $save = base64_encode($save);
  16.  
  17. update_option('acf_pro_license', $save);
  18. }
  19. }
  20. add_action('after_switch_theme', 'auto_set_license_keys');
Add Comment
Please, Sign In to add comment