Skip to content

Instantly share code, notes, and snippets.

@SeanChDavis
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save SeanChDavis/068c9deee5223f46981f to your computer and use it in GitHub Desktop.

Select an option

Save SeanChDavis/068c9deee5223f46981f to your computer and use it in GitHub Desktop.
EDD Software Licensing Admin Notice Based on License State/Existence
<?php
/**
* If the license is not entered or is not valid, show notice. For use with EDD Software Licensing
*
* CHANGE sample_ TO YOUR FUNCTION PREFIX
*
* https://easydigitaldownloads.com/extensions/software-licensing/?ref=184
*/
function sample_admin_notice() {
$license_key = trim( get_option( 'sample_license_key' ) );
$status = get_option( 'sample_license_status' );
if ( false == $license_key || 'valid' != $status ) { ?>
<div class="update-nag">
<p>This should be a good start.</p>
</div>
<?php
}
}
add_action( 'admin_notices', 'sample_admin_notice' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment