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.

Looking at the documentation for Cropping Thumbnails when adding new image-sizes makes me confused.

Set the image size by cropping the image and defining a crop position:

add_image_size( 'custom-size', 220, 220, array( top, left ) ); // Hard crop top left

When setting a crop position, the first value in the array is the x axis crop position, the second is the y axis crop position.

x_crop_position accepts 'left' 'center', or 'right'. y_crop_position accepts 'top', 'center', or 'bottom'.

By this array(top, left) wouldn't be "allowed" because top is only allowed by y-crop position ?

share|improve this question
    
Please add quotes from pages in blockquote, and don't use bold wording unnecessary, it is taken as shouting if used inappropriately. –  Pieter Goosen Apr 30 at 9:47
    
Ok. Thanks for pointing that out. –  bestprogrammerintheworld Apr 30 at 10:15
1  
You actually have a valid point here. According to what the $crop parameter say, it should be array(left, top), not array(top, left). Can anyone collaborate on this? –  Pieter Goosen Apr 30 at 19:34
    
Just a note to the moderators, I've added the tag wordpress.org as this is codex related question that I feel is valid, check my previous comment –  Pieter Goosen Apr 30 at 19:38

1 Answer 1

up vote 3 down vote accepted

As @PieterGoosen said, your point is valid. A look into the source confirms that the codex description of add_image_size was wrong there. It was, because I changed it to be correct. That said, everyone can help improving the codex, you just need to register. You might want to take a look at Contributing to WordPress for a introduction on how to do that, the first section is about the documentation aka codex.

share|improve this answer
    
Ok. Thanks a lot! I would probably register for improving the codex as well. –  bestprogrammerintheworld May 1 at 12:02
    
Thanks for clearing this up, I wasn't hundred percent sure. +1 for this and the extra info you provided –  Pieter Goosen May 1 at 12:59
1  
My pleasure, I guess I was just a little bit quicker. Besides that, this just proofs once gain the beauty of open information collaborating systems. @bestprogrammerintheworld –  ialocin May 1 at 17:36
    
@PieterGoosen Sure thing, this just made me curious, so took a closer look. Otherwise the same as I said in the previous comment..don't want to repeat myself here. –  ialocin May 1 at 17:40
    
HAHAHA Understood! –  Pieter Goosen May 1 at 17:49

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.