Last active
March 22, 2023 03:06
-
-
Save polevaultweb/9cdf1b3bfeb054f13f221d4612bd8901 to your computer and use it in GitHub Desktop.
Define the Advanced Custom Fields Pro license key with a constant
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
<?php | |
function my_filter_acf_pro_license_option( $pre ) { | |
if ( ! defined( 'ACF_PRO_LICENSE' ) || empty( ACF_PRO_LICENSE ) ) { | |
return $pre; | |
} | |
$data = array( | |
'key' => ACF_PRO_LICENSE, | |
'url' => home_url(), | |
); | |
return base64_encode( serialize( $data ) ); | |
} | |
add_filter( 'pre_option_acf_pro_license', 'my_filter_acf_pro_license_option' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
// Place this in wp-config
define('ACF_PRO_LICENSE', 'yourkeyhere' );