Skip to content

Instantly share code, notes, and snippets.

View JayWood's full-sized avatar
:octocat:
Levelling up, one commit at a time.

JayWood

:octocat:
Levelling up, one commit at a time.
View GitHub Profile
<?php
function get_oembed( $url, $post_id, $args = array() ) {
global $wp_embed;
$oembed_url = esc_url( $url );
// Sanitize object_id
$post_id = absint( $post_id );