Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am developing a plugin to customize wordpress administration.

Creating / Editing an article, when i user insert an image from media library or uploading it, i want to clear the image title, as default is set as image file name, and i want to set Big as image size.

I am looking for the hook to work on it, i tried by using jquery but i guess the view button load the content in ajax.

add_action('admin_head-media-upload-popup','set_form_fields');

function set_form_fields() {
    echo"<script type=\"text/javascript\">
    jQuery(document).ready( function($) {
        alert('ciao');
        jQuery('tr.post-title td.field input').attr('value','');
    });
    </script>";
}

i am looking for how to set image post title='' and big radio button to "checked"

share|improve this question
    
Show the code so we can integrate easier? –  kaiser Aug 29 '11 at 7:37
    
it's really long and it sets other changes. I'm looking on how to set form values in the media box. thanks for you help –  Mike Aug 29 '11 at 7:45
1  
@TrustWeb kaiser is not asking for your entire plugin code, but only the code related to your problem. if you explore more, you will solve your problems, else .... –  ntechi Aug 29 '11 at 8:23
    
ok, i edited the post but i know it is not the right way to do it –  Mike Aug 29 '11 at 8:36
add comment

1 Answer

Not sure about the title part, but you should be able to set some defaults for images using update_option(). You can try adding the following to your functions.php to set the default size to large - you should be able to take it back out after it's been called once so you're not updating the option every single time something loads:

update_option('image_default_size','large');
share|improve this answer
    
Or filter option_image_default_size and replace the size if it doesn't exist with large. –  chrisguitarguy Sep 22 '12 at 0:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.