Skip to content

Instantly share code, notes, and snippets.

@EmranAhmed
Forked from manchumahara/custom_embed.php
Created October 21, 2018 10:47
Show Gist options
  • Save EmranAhmed/103044701d49dbb07c629dd1fa381d30 to your computer and use it in GitHub Desktop.
Save EmranAhmed/103044701d49dbb07c629dd1fa381d30 to your computer and use it in GitHub Desktop.

Revisions

  1. @manchumahara manchumahara renamed this gist Oct 21, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @manchumahara manchumahara created this gist Oct 21, 2018.
    4 changes: 4 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@

    $url = 'https://www.youtube.com/watch?v=08f0tiLdk7w'; //a youtube video url
    $autoembed = new WP_Embed(); //initialize the wordpress oEmbed helper class
    $content = $autoembed->autoembed($url); //let's parse the url and get the embeded content