awesomemotive / easy-digital-downloads

Sell digital downloads through WordPress
https://easydigitaldownloads.com
GNU General Public License v2.0
863 stars 474 forks source link

Pass full `$_POST` in `'edd_metabox_save_' . $field` hook #9738

Open goncalovf opened 3 weeks ago

goncalovf commented 3 weeks ago

Enhancement Request

Explain your enhancement (please be detailed)

Add $_POST as a second argument passed in the 'edd_metabox_save_' . $field hook:

https://github.com/awesomemotive/easy-digital-downloads/blob/252a23ae294fa390bfc620c452bab755eacb0775/includes/admin/downloads/metabox.php#L231

Justification or use case

I'm creating a custom download type which has a custom meta. I would like to clear the meta value if the download type changes. For that, I need to have access to the full $_POST in my edd_metabox_save_ filter to check for the value of _edd_product_type.