WordPress: Adding a form parameter to media uploads

Say you want to get a form parameter to pass to the media uploader so you can test for it in the $_POST on your wp_handle_upload filter…

Getting the form field in is no problem but you also need to hack into the SWFUploader instance’s post parameters. This MUST be done via the setPostParams() method. Setting swfu.settings.post_params directly doesn’t work.

You might also wish to set a default value on load. WordPress provides a suitable hook…

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to LinkedIn Post to StumbleUpon Post to Technorati