• I want to remove some fields from the media upload thickbox which I am using in the theme options page. I’m trying the following code, it removes the fields successfully however it removes from the thickbox used in the posts as well.
    So I want to remove fields only in the thickbox being used on the theme options page. CAn someone tell me how I can do that? Thanks.

    add_filter('attachment_fields_to_edit', 'remove_media_upload_fields', 10000, 2);
    function remove_media_upload_fields( $form_fields, $post ) {
    
        // remove unnecessary fields
        unset( $form_fields['image-size'] );
        unset( $form_fields['post_excerpt'] );
        unset( $form_fields['post_content'] );
        unset( $form_fields['url'] );
        unset( $form_fields['image_url'] );
        unset( $form_fields['align'] );
    
        return $form_fields;
    }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Remove fields from Media upload box’ is closed to new replies.