Viewing 15 replies - 1 through 15 (of 20 total)
  • that’ll probably only work when you edit a core WordPress file like media.php or upload.php or something.
    Not advisable. Just inform your client to ignore the options.

    Thread Starter Alyson

    (@rn2web)

    My cliente want to remove this options for registred users ??

    Yes i try search in any archive , media.php, upload.php and much more and nothinq….

    thanks for your help =/

    To remove the first two option lines you can add the following lines to the functions.php of your theme (or to another plugin you have installed):

    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';
        }
        return $form_fields;
    }
    add_filter('attachment_fields_to_edit', 'ms_attachment_fields_to_edit', 11, 2);

    The third option line seems to be inserted by another plugin you are using. To remove it, search for
    <input type="radio" ...>
    in its php-files and add the corresponding lines to the above function.

    Works for me at least ??

    Michael

    Thread Starter Alyson

    (@rn2web)

    ok shoe, i will test and do feedback.

    Thanks so much ??

    Thread Starter Alyson

    (@rn2web)

    i try injet this function in functions.php of my template

    and i get this error:

    Warning: Cannot modify header information – headers already sent by (output started at /themes/Aspire/functions.php:19) in /blog/wp-includes/pluggable.php on line 770

    and i try in functions.php of wp-includes

    and:

    Fatal error: Call to undefined function add_filter() in /blog/wp-includes/functions.php on line 2339

    Hi rn2web

    I’m not a professionel but as far as I know

    • you should better not try to hack WP. Changing anything in wp-admin or in wp-includes is a hack!
    • If you place it in your themes functions.php you might also need one or both of the following lines:
      include_once('wp-config.php');
      include_once('wp-includes/wp-db.php');
    • It should work without errors if you put it in a standard plugin. Perhaps you could try to put it in the example plugin hello.php in “wp-content/plugins/”.
      … and then activate it – of course!

    good luck!

    Michael

    … in addition to my last message:

    I definitly know that it works in WP 2.6 if you place the code in the nice little upload plugin “photojar-base”!

    Michael

    Thread Starter Alyson

    (@rn2web)

    hi michael

    I hack almost all my wordpress 2.6 , lol
    Is because my client need a personal version for your project, but ok.
    Is everythinq perfect at this moment.
    About this little problem, is last problem to finish my work ^_^

    ————————–
    The plugin i am using is to do resize big images and do a thumbnail.
    Your name: flexible-upload

    ————————–

    I will try do your new instructions

    ( yes, my english is very poor )

    I also tried flexible-upload.

    For my needs WP 2.6 + photojar has the same functionality
    … and is much easier to change/hack!

    Thread Starter Alyson

    (@rn2web)

    I am confused, look like is my themes functions.php

    <?php
    if ( function_exists('register_sidebar') )
        register_sidebars(2, array(
            'before_widget' => '<div id="%1$s" class="sb-bot"><div class="sb-top"><div class="sb-right"><div class="sb-left"><div class="sb-rb"><div class="sb-lb"><div class="sb-rt"><div class="sb-lt">',
            'after_widget' => '</div></div></div></div></div></div></div></div>',
            'before_title' => '<h2>',
            'after_title' => '</h2>',
        ));
    ?>
    <?php function widget_search() {
    ?><?php
    }
    if ( function_exists('register_sidebar_widget') )
        register_sidebar_widget(__('Search'), 'widget_search');
    
    ?>

    I need add this lines correct?

    <?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';
        }
        return $form_fields;
    }
    add_filter('attachment_fields_to_edit', 'ms_attachment_fields_to_edit', 11, 2);
    
    ?>

    And:

    <?php
    
    include_once('wp-config.php');
    include_once('wp-includes/wp-db.php');
    ?>

    But i get a lot of erros.
    I am trying resolve the 2 first lines.

    No, i don′t modify the plugin flexive-upload yet with your instructions

    I will try use photojar with your instructions.

    Hi there

    I just tested my function putting it in my themes functions.php

    It works perfect together with photojar-base plugin.
    And you don’t even need the two include_once statements!

    If you still have problems, disable all of your other plugins – just for a test – write a post and upload an image.

    • There should be no errors.
    • And the two option button lines are gone!

    Michael

    Thread Starter Alyson

    (@rn2web)

    I thank you so much for your help michael, but not working for me, a lot of erros and conflict with outhers modifications ??

    You do not know where these menus in php files?

    align

    show

    https://img165.imageshack.us/img165/7515/menusfu9.jpg

    I am search in all wp-admin files and nothinq ??
    Yes, hack this menu is only way to me ??

    obs: this language is portuguese
    miniatura = thunbnail
    tamanho original = full size

    Thread Starter Alyson

    (@rn2web)

    i found somethinq in wp-includes/js/tinymce/langs/wp-langs.php

    I try remove:

    contextmenu:{
    align:"' . mce_escape( __('Alignment') ) . '",
    left:"' . mce_escape( __('Left') ) . '",
    center:"' . mce_escape( __('Center') ) . '",
    right:"' . mce_escape( __('Right') ) . '",
    full:"' . mce_escape( __('Full') ) . '"
    },
    size:"' . mce_escape( __('Size') ) . '",

    Nothinq happen…

    Copying the code to html editor i get:

    <table cellspacing="0" cellpadding="0">
      <tr>
        <th scope="row" valign="top"><label for="attachments[11][align]">Alinhamento <br />
        </label></th>
        <td><input name="attachments[11][align]" id="image-align-none-11" value="none" checked="checked" type="radio">
            <label for="image-align-none-11">Nenhuma</label>
            <input name="attachments[11][align]" id="image-align-left-11" value="left" type="radio">
            <label for="image-align-left-11">Esquerda</label>
            <input name="attachments[11][align]" id="image-align-center-11" value="center" type="radio">
            <label for="image-align-center-11">Centro</label>
            <input name="attachments[11][align]" id="image-align-right-11" value="right" type="radio">
            <label for="image-align-right-11">Direita</label>
        </td>
      </tr>
      <tr>
        <th scope="row" valign="top"><label for="attachments[11][image-size]">Tamanho <br />
        </label></th>
        <td><input name="attachments[11][image-size]" id="image-size-thumb-11" value="thumbnail" type="radio">
            <label for="image-size-thumb-11">Miniatura</label>
            <input name="attachments[11][image-size]" id="image-size-medium-11" value="medium" checked="checked" type="radio">
            <label for="image-size-medium-11">Médio</label>
            <input name="attachments[11][image-size]" id="image-size-full-11" value="full" type="radio">
            <label for="image-size-full-11">Tamanho original</label></td>
      </tr>
    </table>

    You can change almost everything in WP using filter and action hooks provided that you don’t hack anything in WP.
    All your changes should be located in the wp-content folder (themes or plugins).

    If you start hacking WP you will very likely get lots of error messages by the safety management of WP.

    Most of the lines you want to hack are in wp-admin/includes/media.php (1302-1314 and many others …) but it’s the wrong place to really change the output !!!

    My plugin function can only work if you have a clean (unhacked) WP-Installation.

    If you go on hacking I can’t help you.

    Michael

    Thread Starter Alyson

    (@rn2web)

    ??

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