I have removed the Full size image option from the media upload window see Code:

function theme_t_wp_set_image_size_options( $sizes ){

  $sizes = array(
    'thumbnail' => 'Thumbnail',
    'medium'    => 'Medium',
    'large'     => 'Large'

  return $sizes;

add_filter( 'image_size_names_choose', 'theme_t_wp_set_image_size_options' );

This code removes the full size image option. But there is a problem I am using AdRotate plugin and now I can't select Full size for my ads because I have removed the option. I would like to have full size option available only if someone is putting an ad on the site. Or a working custom image size option.

The ad is 900 x auto height

add_image_size( 'footer-ad', 899, 99999, true );

This code works but I think it's a little hacky. Wordpress thinks it's not a full size image and allows me to select this option but if I would to make it (900, 99999, true) it wouldn't let me select it anymore.

Is there a way to fix this? Or is there another way to achieve this with completely different code or way?

UPDATE 29.07.2013

I have removed the option to use Full size images for clients that they don't put too large images on the web site posts. But because I have removed the option Wordpress doesn't allow me to add advertising images that are full size (it tries to crop them) I am using AdRotate (I manually need to upload the ads with wordpress media uploader and put them in place with the plugin). And if I try to override it by creating a new image size with add_image_size for the ads it doesn't work because Wordpress thinks that the new image sizes are "full size" and I have removed the option. It works if I create a new image size that is 1% smaller than the image I try to upload.

What i would like to happen is that Wordpress blocks the usage of full size images in default Article posts but allows them in the plugin (AddRotate) taht I and the client could add ads to the site that are 100%.

The ad sizes are 900px x auto and 275px x 200px

AdRotate code is in sidebar.php

<div class="first-ad ad-275"><?php echo adrotate_ad(1); ?></div>
  • How do you detect "someone is putting ad on the site" ? – Rarst Jul 29 '13 at 14:03
  • @Rarst AdRotate code in sidebar.php <div class="first-ad ad-900"><?php echo adrotate_ad(1); ?></div> – Pullapooh Jul 29 '13 at 16:14
  • That is not quite explaining it. You formulated question in form of I want X unless Y. It cannot really be answered without technically detailed of explanation what Y is. – Rarst Jul 29 '13 at 16:18
  • @Rarst I have updated the question. I hope this helps :). If this is not explaining good enough i could make a small video of the problem. – Pullapooh Jul 29 '13 at 17:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.