Skip to content

Instantly share code, notes, and snippets.

@ccbikai
Last active August 29, 2015 14:02
Show Gist options
  • Save ccbikai/00f810676207184a634e to your computer and use it in GitHub Desktop.
Save ccbikai/00f810676207184a634e to your computer and use it in GitHub Desktop.
WordPress快速插入虾米音乐代码
function wp_iframe_handler_xiami( $matches, $attr, $url, $rawattr ) {
$iframe = '<iframe width="430" height="200" src="http://miantiao.jd-app.com/xiamiplayer/'. esc_attr($matches[1]) . '" allowtransparency scrolling="0" frameborder="0" ></iframe>';
return apply_filters( 'iframe_xiami', $iframe, $matches, $attr, $url, $rawattr );
}
wp_embed_register_handler( 'xiami_iframe', '#http://www.xiami.com/song/([\d]+)(.*?)#i', 'wp_iframe_handler_xiami' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment