Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#46566 closed defect (bug) (duplicate)

get_post_thumbnail() is not working with transition_post_status hook

Reported by: ratnaraju's profile ratnaraju Owned by:
Milestone: Priority: normal
Severity: critical Version: 5.0
Component: Post Thumbnails Keywords: needs-codex
Focuses: Cc:

Description

from the latest version of WordPress, the function get_post_thumbnail_url is not working. Even if we write a wpdb query to fetch featured image not working. please suggest with solution.

Change History (1)

#1 @peterwilsoncc
6 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Version changed from 5.1 to 5.0

Hi @ratnaraju and welcome to trac!

This is due to the issue detailed in #45114, post meta (included featured images) and terms (tags, categories, custom taxonomies) are not updated until after wp_update_post() runs so the details are not available when saving via the REST API, which the new editor uses.

Some ideas have been presented but a way forward hasn't been decided yet, I am afraid.

I'm marking this ticket as duplicate so discussion can continue in one place on #45114.

Note: See TracTickets for help on using tickets.