wp-papi / papi

:rocket: WordPress Page Type API with custom fields
https://wp-papi.github.io
MIT License
263 stars 32 forks source link

Oembed cache is broken if content is empty #210

Closed rasmusbe closed 7 years ago

rasmusbe commented 7 years ago

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/