Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save soderlind/ff0335605a8c4bc93a71f05560c28faa to your computer and use it in GitHub Desktop.
Save soderlind/ff0335605a8c4bc93a71f05560c28faa to your computer and use it in GitHub Desktop.

Revisions

  1. @mattradford mattradford revised this gist Apr 27, 2016. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions licence activation.php
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,10 @@
    // Place this in wp-config
    define('ACF_5_KEY','yourkeyhere');
    define( 'ACF_5_KEY', 'yourkeyhere' );

    // Set ACF 5 license key on theme activation. Stick in your functions.php or equivalent.
    function auto_set_license_keys() {

    if ( !get_option('acf_pro_license') && defined('ACF_5_KEY') ) {
    if ( ! get_option( 'acf_pro_license' ) && defined( 'ACF_5_KEY' ) ) {

    $save = array(
    'key' => ACF_5_KEY,
    @@ -14,7 +14,7 @@ function auto_set_license_keys() {
    $save = maybe_serialize($save);
    $save = base64_encode($save);

    update_option('acf_pro_license', $save);
    update_option( 'acf_pro_license', $save );
    }
    }
    add_action('after_switch_theme', 'auto_set_license_keys');
    add_action( 'after_switch_theme', 'auto_set_license_keys' );
  2. @mattradford mattradford revised this gist Nov 12, 2015. No changes.
  3. @mattradford mattradford revised this gist Nov 12, 2015. No changes.
  4. @mattradford mattradford revised this gist Nov 12, 2015. No changes.
  5. @mattradford mattradford revised this gist Nov 12, 2015. No changes.
  6. @mattradford mattradford revised this gist Nov 4, 2015. No changes.
  7. @mattradford mattradford revised this gist Nov 4, 2015. No changes.
  8. @mattradford mattradford created this gist Nov 4, 2015.
    20 changes: 20 additions & 0 deletions licence activation.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    // Place this in wp-config
    define('ACF_5_KEY','yourkeyhere');

    // Set ACF 5 license key on theme activation. Stick in your functions.php or equivalent.
    function 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', 'auto_set_license_keys');