Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 9 years ago

#26951 closed enhancement (fixed)

Add has_image_size()

Reported by: mordauk Owned by: wonderboymusic
Priority: normal Milestone: 3.9
Component: Media Version: 3.8
Severity: normal Keywords: has-patch commit
Cc: Focuses:

Description (last modified by SergeyBiryukov)

The remove_image_size() function is proposed as being introduced in #26768.

​markoheijnen suggested that has_image_size() also be added.

I can recall a few scenarios when I've needed to check if an image size exists, so I'm all for it.

Attachments (1)

26951.patch​ (588 bytes ) - added by mordauk 13 years ago.
Adds has_image_size()

Download all attachments as: .zip

Change History (11)

@mordauk
13 years ago

Adds has_image_size()

#1 @mordauk
13 years ago

Unit tests for this (also add_image_size() and remove_image_size()) added in ticket:26768:26768-tests.patch​ on #26768

Last edited 13 years ago by SergeyBiryukov (previous) (diff)

#2 @SergeyBiryukov
13 years ago

  • Description modified (diff)
  • Version trunk → 3.8

#3 @nacin
13 years ago

  • Keywords commit added

#4 @wonderboymusic
13 years ago

  • Milestone Awaiting Review → 3.9

#5 @wonderboymusic
13 years ago

  • Owner set to wonderboymusic
  • Resolution → fixed
  • Status new → closed

In 27128:

Introduce has_image_size( $name ), a utility function that helps avoid loading the $_wp_additional_image_sizes global.

Props mordauk.
Fixes #26951.

#6 @nacin
13 years ago

In 27129:

Add remove_image_size() and tests for it and has_image_size(), added in [27128].

props mordauk, markoheijnen.
fixes #26768. see #26951.

#7 @mordauk
13 years ago

Thanks guys!

#8 @DrewAPicture
13 years ago

In 27139:

Inline documentation tweaks for has_image_size() and remove_image_size().

See #26951.

#9 @nacin
13 years ago

In 27140:

has_image_size()'s parameter should be required. see [27139], see #26951.

This ticket was mentioned in ​Slack in #core-media by desrosj. ​View the logs.


9 years ago

Note: See TracTickets for help on using tickets.