Skip to content

Instantly share code, notes, and snippets.

@zackkatz
Created October 15, 2014 21:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zackkatz/239eba3b95f49471803f to your computer and use it in GitHub Desktop.
Save zackkatz/239eba3b95f49471803f to your computer and use it in GitHub Desktop.
Get readme response from the readme.txt configuration in EDD Software Licensing
/**
* Get readme response from the readme.txt configuration in EDD Software Licensing
*
* @param int $id Download ID
* @return array|boolean Readme array if exists; NULL if not exists
*/
function get_edd_sl_readme( $id = NULL ) {
if( !empty( $id ) && function_exists('_edd_sl_get_readme_data') ) {
$readme_url = get_post_meta( $id, '_edd_readme_location', true );
// If the URL doesn't exist, get outta here.
if( empty( $readme_url) ) { return NULL; }
$readme = _edd_sl_get_readme_data( $readme_url, gvtheme_get_gravityiew_id() );
if( !empty( $readme ) ) {
return $readme;
}
}
return NULL;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment