Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#20218 closed enhancement (fixed)

set_post_thumbnail(): update_post_meta() could fail

Reported by: webord's profile webord Owned by: duck_'s profile duck_
Milestone: 3.4 Priority: normal
Severity: normal Version: 3.4
Component: Post Thumbnails Keywords: has-patch commit
Focuses: Cc:

Description

So I'm in a project where the defined thumbnail must always be bigger then a certain size, and my problem is whether I can filter to check the size of the image, using a filter on the update_{$meta_type}_metadata, the function set_post_thumbnail(), always return true, so my change is really small so the developer can filter and return false if it pleases;

In my case I would filter that and the content on admin_post_thumbnail_html to Warn the user that he cannot set a thumbnail with this size.

Check out the .diff, and if there any other place that I can change something, to make it better warn me.

Attachments (1)

post.diff (577 bytes) - added by webord 13 years ago.
Changes

Download all attachments as: .zip

Change History (8)

@webord
13 years ago

Changes

#1 @scribu
13 years ago

  • Keywords has-patch added; dev-feedback removed

Makes sense.

#2 follow-up: @scribu
13 years ago

  • Keywords commit added

#3 in reply to: ↑ 2 @webord
13 years ago

Replying to scribu:
Question, what I should do now? I should: patch -p0 < post.diff ?

I don't really know how to patch something I did. Thanks a lot.

#4 @scribu
13 years ago

Now you wait for someone with commit access to commit your patch.

#5 @webord
13 years ago

Thanks!

#6 @duck_
13 years ago

  • Owner set to duck_
  • Resolution set to fixed
  • Status changed from new to closed

In [20172]:

Use return value of update_post_meta() in set_post_thumbnail() instead of always returning true. Props webord. Fixes #20218.

#7 @duck_
13 years ago

  • Milestone changed from Awaiting Review to 3.4
  • Summary changed from Filter set_post_thumbnail() to set_post_thumbnail(): update_post_meta() could fail
Note: See TracTickets for help on using tickets.