Insert Media struggle with ‘attachment_fields_to_edit’ filter
-
To remove some fields in media upload area when using thickbox (something like
tb_show('', 'media-upload.php?post_id=0&type=image&TB_iframe=true&referer=alter', false);
this filter:
add_filter('attachment_fields_to_edit', 'profilextra_style_umedia', 10000, 2); function profilextra_style_umedia($form_fields,$post) { unset( $form_fields['align'] ); unset( $form_fields['post_title'] ); unset( $form_fields['image_alt'] ); unset( $form_fields['post_excerpt'] ); unset( $form_fields['post_content'] ); unset( $form_fields['url'] ); return $form_fields; }
do it well. The problem is that when this code is present Media Library stops (do not show images at upload.php) and the same for Insert Media on posts and pages editor (when clicked on “Add Media” button).
What could be wrong here?
Thanks in advance for your answers.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Insert Media struggle with ‘attachment_fields_to_edit’ filter’ is closed to new replies.