Created
May 8, 2014 05:59
-
-
Save sudar/222576755d9cbd889b1c to your computer and use it in GitHub Desktop.
Code to automatically update version number from readme file in EDD Software licensing addon
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 | |
add_filter( 'edd_sl_license_readme_response', function( $response, $download, $readme ) { | |
$meta_version = get_post_meta( $download->ID, '_edd_sl_version', true ); | |
if ( '' != $readme['stable_tag'] && $meta_version != $readme['stable_tag'] ) { | |
update_post_meta( $download->ID, '_edd_sl_version', $readme['stable_tag']); | |
} | |
return $response; | |
}, 10, 3 ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment