Remove fields on media uploader for custom page type – not working for “From Computer” or “From Url” tabs?
Version 1 Deals with filtering based on Post ID *From Computer* tab we need to retrieve the $attachment_parent_id: add_filter(‘attachment_fields_to_edit’, ‘wpse_53600_remove_media_upload_fields’, 10000, 2); function wpse_53600_remove_media_upload_fields( $form_fields, $post ) { $our_page_id = 4; $post_id = !empty( $_GET[‘post_id’] ) ? (int) $_GET[‘post_id’] : 0; $attachment_parent_id = !empty($post->post_parent) ? $post->post_parent : 0; if( $post_id == $our_page_id || $attachment_parent_id == … Read more