Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

On my custom tab, I copied media-form from media_upload_gallery_form, only changed form id and action-url to reflect my tab's name. The form displayed as expected, but after click "Save All Changes", the post data is not saved. Please note unlike custom fields that we add filter to "attachment_field_save", this time it is the entire media-form. It can be saved on either Gallery tab or Library tab, so I guess there has to be a way to be saved on my custom tab?

share|improve this question
    
@toscho ,Could you please check this question? –  Jenny Jun 28 '12 at 12:38
add comment

1 Answer 1

up vote 0 down vote accepted

Just figured out this one-- in the function that load the iframe, add this:

if ( !empty($_POST) ) {
    $return = media_upload_form_handler();

    if ( is_string($return) )
        return $return;
    if ( is_array($return) )
        $errors = $return;
}

Then, all the form data get saved as normal.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.