WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#39524 closed defect (bug) (duplicate)

WP_Embed cache broken if post content is empty

Reported by: rasmusbe Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.7
Component: Embeds Keywords:
Focuses: Cc:

Description

Steps to reproduce:

  1. Create a post with empty post content and a metafield containing a Youtube link
  2. Run apply_filters('the_content', $meta_field_content);

Expected result:
Youtube-embed code

Actual result:
Youtube link (not embed)

Possible cause:
Invalid if-state on line 221 in class-wp-embed.php
Should be $this->usecache && $cached_recentlynot $this->usecache || $cached_recently

Change History (2)

#1 @swissspidy
3 years ago

See #37597 on why this line is intentional.

#2 @ocean90
3 years ago

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

Duplicate of #37597.

Hello @rasmusbe, thanks for your report.

This is by design, see ticket:37597:2 for the reasoning.

Note: See TracTickets for help on using tickets.