Viewing 5 replies - 16 through 20 (of 20 total)
  • … but it’s your chance:

    • If you update WP you would have to do all the hacks again … and then they would be in other places …
    • If you use action and filter hooks you can update any time … your changes will be OK!!!
    • … and you can use other plugins (functions) with no errors !

    Why not give it a try ??
    WP Plugin API

    Michael

    Thread Starter Alyson

    (@rn2web)

    WOW!

    i got it!!!!!!

    thanks a lot!

    I put your code in my wp-admin/includes/media.php
    In first line and all right now!

    Thread Starter Alyson

    (@rn2web)

    my final code:

    <?php
    
    function ms_attachment_fields_to_edit($form_fields, $post) {
        if ( substr($post->post_mime_type, 0, 5) == 'image' ) {
    
    	// align: (radio)
    	$form_fields['align']['value'] = 'aligncenter';
    	$form_fields['align']['input'] = 'hidden';
    
    	// image-size: (radio)
    	$form_fields['image-size']['value'] = 'thumbnail';
    	$form_fields['image-size']['input'] = 'hidden';
    
    	// Caption: (radio)
    	$form_fields['image-caption']['value'] = 'caption';
    	$form_fields['image-caption']['input'] = 'hidden';
    
        }
        return $form_fields;
    }
    add_filter('attachment_fields_to_edit', 'ms_attachment_fields_to_edit', 11, 2);
    
    ?>

    ??

    Thread Starter Alyson

    (@rn2web)

    my final code:

    <?php
    
    function ms_attachment_fields_to_edit($form_fields, $post) {
        if ( substr($post->post_mime_type, 0, 5) == 'image' ) {
    
    	// align: (radio)
    	$form_fields['align']['value'] = 'aligncenter';
    	$form_fields['align']['input'] = 'hidden';
    
    	// image-size: (radio)
    	$form_fields['image-size']['value'] = 'thumbnail';
    	$form_fields['image-size']['input'] = 'hidden';
    
    	// Caption: (radio)
    	$form_fields['image-caption']['value'] = 'caption';
    	$form_fields['image-caption']['input'] = 'hidden';
    
        }
        return $form_fields;
    }
    add_filter('attachment_fields_to_edit', 'ms_attachment_fields_to_edit', 11, 2);
    
    ?>

    ??

    Hi rn2web and schoe, I found your correspondence very helpful since I faced a similar problem and the solution you came up with is almost perfect for me.
    The only thing is that for me the caption field won’t disappear, I also need your help to adjust the code to hide the description field as well.
    Sorry if this is basic tweaks, but i’m a bit of a newbie and your help will… well, help.
    Thanks
    Idanska

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘Removing options in upload table’ is closed to new replies.