Last active
August 29, 2015 14:02
-
-
Save ccbikai/00f810676207184a634e 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_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