Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save propertyhive/5e3c3f0d2aae9d80fa9d91f747cd4824 to your computer and use it in GitHub Desktop.

Select an option

Save propertyhive/5e3c3f0d2aae9d80fa9d91f747cd4824 to your computer and use it in GitHub Desktop.
Set EPC certificate ID in RTDF requests
add_filter( 'ph_rtdf_send_request_data', 'set_rtdf_epc_certificate_id', 10, 2 );
function set_rtdf_epc_certificate_id( $request_data, $post_id )
{
$epc_certificate_id = get_post_meta($post_id, '_epc_certificate_id', true);
if ( !empty($epc_certificate_id) )
{
$request_data['property']['details']['epc_information'] = array(
'epc_certificate_id' => trim($epc_certificate_id)
);
}
return $request_data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment