WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 3 years ago

#26951 closed enhancement (fixed)

Add has_image_size()

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

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 7 years ago.
Adds has_image_size()

Download all attachments as: .zip

Change History (11)

@mordauk
7 years ago

Adds has_image_size()

#1 @mordauk
7 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 7 years ago by SergeyBiryukov (previous) (diff)

#2 @SergeyBiryukov
7 years ago

  • Description modified (diff)
  • Version changed from trunk to 3.8

#3 @nacin
7 years ago

  • Keywords commit added

#4 @wonderboymusic
7 years ago

  • Milestone changed from Awaiting Review to 3.9

#5 @wonderboymusic
7 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to 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
7 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
7 years ago

Thanks guys!

#8 @DrewAPicture
7 years ago

In 27139:

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

See #26951.

#9 @nacin
7 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.


3 years ago

Note: See TracTickets for help on using tickets.