Created
October 15, 2014 21:36
-
-
Save zackkatz/239eba3b95f49471803f to your computer and use it in GitHub Desktop.
Get readme response from the readme.txt configuration in EDD Software Licensing
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
/** | |
* 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