Jump to content

Archived

This topic is now archived and is closed to further replies.

quinntinm

How to specify blog attachement display settings

Recommended Posts

quinntinm

Hi.

How do i specify the blog attachment display settings automatically?

I always have to specify these manually when uploading images to the blog.

  • Alignment: center
  • link to:none
  • size: full size

I seem to remember someone saying it can be set to do this in the functions but i have no idea how to do this and would appreciate any advice.

I think it was something like this:

function mytheme_setup() {
	// Set default values for the upload media box
	update_option('image_default_align', 'center' );
	update_option('image_default_link_type', 'media' );
	update_option('image_default_size', 'large' );

}
add_action('after_setup_theme', 'mytheme_setup');

Thank you.

Share this post


Link to post
Share on other sites
Danny

Hi,

 

I apologise, but I am not quite sure what you're trying to do.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
quinntinm

Hi Danny, this is what i mean.

http://screencast.com/t/XBkfNzwXtFlc

 

I want to set those options automatically to the following instead of the default:

  • Alignment: center
  • link to:none
  • size: full size

Share this post


Link to post
Share on other sites
Danny

You will need to ask this question on the WordPress support forums, as this is related to WordPress options and not a theme/DMS option.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
quinntinm

Just in case anyone else would like to know, here is the answer:

function wps_attachment_display_settings() {
        update_option( 'image_default_align', 'center' );
        update_option( 'image_default_link_type', 'none' );
        update_option( 'image_default_size', 'full' );
}
add_action( 'after_setup_theme', 'wps_attachment_display_settings' );

Here are the options for each:

 

image_default_align

  • left
  • right
  • center
  • none

image_default_link_type

  • file
  • post
  • custom
  • none

image_default_size

  • thumbnail
  • medium
  • large
  • full

 

 

 

Share this post


Link to post
Share on other sites

×