WP do_shortcode to embed video


/ Published in: PHP
Save to your folder(s)

Embed a video via PHP without using `the_content` filter in WordPress. From luckykind at http://wordpress.org/support/topic/call-function-called-by-embed-shortcode-direct


Copy this code and paste it in your HTML
  1. <?php
  2. $wp_embed = new WP_Embed();
  3. $post_embed = $wp_embed->run_shortcode('[embed]your-video-url[/embed]');
  4. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.