Opened 15 months ago

Closed 14 months ago

Last modified 14 months ago

#20218 closed enhancement (fixed)

set_post_thumbnail(): update_post_meta() could fail

Reported by: webord Owned by: duck_
Priority: normal Milestone: 3.4
Component: Post Thumbnails Version: 3.4
Severity: normal Keywords: has-patch commit
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 15 months ago.
Changes

Download all attachments as: .zip

Change History (8)

Changes

  • Keywords has-patch added; dev-feedback removed

Makes sense.

comment:2 follow-up: ↓ 3   scribu15 months ago

  • Keywords commit added

comment:3 in reply to: ↑ 2   webord15 months 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.

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

Thanks!

  • 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.

  • 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.