wp-papi/papi

Oembed cache is broken if content is empty

rasmusbe opened this issue · 0 comments

What I expected

Youtube-embed

What happened instead

Youtube link

Steps to reproduce

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

How to fix

Flush oembed cache when updating the post meta (WP only does this when post content is updated)
See https://developer.wordpress.org/reference/classes/wp_embed/delete_oembed_caches/