Title: Update add_image_size() function
Last modified: August 21, 2016

---

# Update add_image_size() function

 *  [nnnswordfish](https://wordpress.org/support/users/nnnswordfish/)
 * (@nnnswordfish)
 * [12 years ago](https://wordpress.org/support/topic/update-add_image_size-function/)
 * I want to dynamicaly update this function – add_image_size() when value of this
   variable ( $image_size ) is changed, as in example below. I can achieve that 
   with ‘Regenerate Thumbnails’ plugin, but I want to do without that.
 *  ` if ( $image_size === ‘200×200’ ) {
    add_image_size( ‘portfolio-isotope-200
   ×200’, 200,200,true ); } elseif ( $image_size === ‘700×700’ ) { add_image_size(‘
   portfolio-isotope-700×700’, 700,700, true ); } `

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [12 years ago](https://wordpress.org/support/topic/update-add_image_size-function/#post-4927131)
 * Are you sure you really want to do this? For each image size added, WP will start
   creating images of that size for EVERY image uploaded. I could imagine this sort
   of code could end up registering dozens (or more) of image sizes (unless you 
   very carefully limit image sises uploaded).
 * Eventually, for every upload, there could be hundreds of copies of various sizes
   created each time. If you explain what you are trying to achieve, perhaps someone
   could suggest a better approach.
 *  Thread Starter [nnnswordfish](https://wordpress.org/support/users/nnnswordfish/)
 * (@nnnswordfish)
 * [12 years ago](https://wordpress.org/support/topic/update-add_image_size-function/#post-4927134)
 * I know that, but in my case it not problem for my project, its hard to explain
   why it not problem, but if you can help please help 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Update add_image_size() function’ is closed to new replies.

## Tags

 * [image_size](https://wordpress.org/support/topic-tag/image_size/)
 * [regenerate](https://wordpress.org/support/topic-tag/regenerate/)
 * [thumbnail](https://wordpress.org/support/topic-tag/thumbnail/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 2 participants
 * Last reply from: [nnnswordfish](https://wordpress.org/support/users/nnnswordfish/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/update-add_image_size-function/#post-4927134)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
