Skip to content

Instantly share code, notes, and snippets.

@sudar
Created May 8, 2014 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sudar/222576755d9cbd889b1c to your computer and use it in GitHub Desktop.
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
<?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