• 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

    (@bcworkz)

    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

    (@nnnswordfish)

    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.