Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
code excerpt for restoring the FAQ section to responses in EDD Software Licensing API calls
<?php
//...
add_filter('edd_sl_license_readme_response', array($this, 'eddMaybeRestoreFAQ'), 10, 3);
/**
* maybe restore the FAQ section to the update info package
* @param array $response
* @param \EDD_SL_Download $download
* @param array $readme
* @return array
*/
public function eddMaybeRestoreFAQ($response, $download, $readme) {
$sections = unserialize($response['sections']);
if (empty($sections['faq']) && (!empty($readme['sections']['faq']))) {
$sections['faq'] = $readme['sections']['faq'];
$response['sections'] = serialize($sections);
}
return $response;
}
//...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment