Skip to content

Instantly share code, notes, and snippets.

View Hyperpolymath's full-sized avatar
🎯
Focusing

Jonathan Jewell Hyperpolymath

🎯
Focusing
View GitHub Profile
@bryanwillis
bryanwillis / licence activation.php
Last active October 18, 2021 23:52 — forked from mattradford/licence activation.php
ACF5 Pro ( Advanced Custom Fields ) licence activation. Could be adapted for any other plugin that requires a licence key, but doesn't yet support defining it in wp-config. Fires on theme activation.
// 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,