How to change the oembed “type”?
How to change the oembed “type”?
How to change the oembed “type”?
You should be doing some sort of check at the beginning of your function to ensure you’re in an oembed that you actually want to mod. something like if (strpos($url, youtube.com) === false && strpos($url, vimeo.com) === false) { return $cache; } Although you might want to elaborate on that to catch shortened urls like … Read more
In order for oEmbeds to work when embedding another WordPress site, the single template must have discovery links enabled. WordPress uses these to retrieve the oEmbed endpoint where the content is retrieved. These endpoints are a part of the REST API, so make sure that’s enabled and working as well. wp-includes/embed.php v5.1.1 if ( is_singular() … Read more
How to register a embed handler as a fallback to a oEmbed handler?
How to set up front end editor to autoembed media for non-logged in users?
In your test, you can create a post, start output buffering with ob_start(), output post content as usual, get output buffer into your variable with ob_end_clean(). Now your can process real post output string and compare it with the expected value.
How can I grab the video id of youtube?
Worrisome oembed hits
I think the problem is the way you use the foreach with HTML inside. I usually use this way, so try perhaps to modify your code like this : <?php if (have_posts()) { while (have_posts()) { the_post(); the_content(); // get_template_part( ‘template-parts/content’,’article’ ); $args = array( ‘post_type’ => ‘attachment’, ‘numberposts’ => -1, ‘post_status’ => null, ‘post_parent’ … Read more
I think your oEmbed implementation is wrong. You can see in the WP-oEmbed class that WordPress supports four type values: photo, video, link and rich; whereas you’re returning type=image. From the spec section 2.3.4 it looks like that’s WordPress’s list is complete and ‘image’ isn’t generally supported. You possibly meant type=photo, but those aren’t generally … Read more