Created
July 28, 2014 06:24
-
-
Save ccbikai/6b85829db7749cc196ab to your computer and use it in GitHub Desktop.
WordPress快速插入网易云音乐
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wp_iframe_handler_m163( $matches, $attr, $url, $rawattr ) { | |
$iframe = '<iframe width="430" height="200" src="http://miantiao.jd-app.com/m163player/'. esc_attr($matches[1]) . '" allowtransparency scrolling="0" frameborder="0" ></iframe>'; | |
return apply_filters( 'iframe_m163', $iframe, $matches, $attr, $url, $rawattr ); | |
} | |
wp_embed_register_handler( 'm163_iframe', '#http://music.163.com/\#/song\?id=([\d]+)(.*?)#i', 'wp_iframe_handler_m163' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment