', esc_attr( $matches['video_id'] ) ); return apply_filters( 'embed_tudou', $embed, $matches, $attr, $url, $rawattr ); } wp_embed_register_handler( 'tudou', '#https?://(?:www\.)?tudou\.com/(?:programs/view|listplay/(?[a-z0-9_=\-]+))/(?[a-z0-9_=\-]+)#i', 'wp_embed_handler_tudou' ); /** * 56.com wp_embed handler * * Embed code last updated: * Tue, 05 Jun 2012 23:03:29 -0400 * * Feel free to submit or correct URL formats here: * http://cn.wordpress.org/contact/ * * @since 3.4.0 */ function wp_embed_handler_56com( $matches, $attr, $url, $rawattr ) { $matches['video_id'] = $matches['video_id1'] == '' ? $matches['video_id2'] : $matches['video_id1']; $embed = sprintf( "", esc_attr( $matches['video_id'] ) ); return apply_filters( 'embed_56com', $embed, $matches, $attr, $url, $rawattr ); } wp_embed_register_handler( '56com', '#https?://(?:www\.)?56\.com/[a-z0-9]+/(?:play_album\-aid\-[0-9]+_vid\-(?[a-z0-9_=\-]+)|v_(?[a-z0-9_=\-]+))#i', 'wp_embed_handler_56com' ); /** * Youku wp_embed handler * * Embed code last updated: * Wed, 06 Jun 2012 00:36:11 -0400 * * Feel free to submit or correct URL formats here: * http://cn.wordpress.org/contact/ * * @since 3.4.0 */ function wp_embed_handler_youku( $matches, $attr, $url, $rawattr ) { $embed = sprintf( '', esc_attr( $matches['video_id'] ) ); return apply_filters( 'embed_youku', $embed, $matches, $attr, $url, $rawattr ); } wp_embed_register_handler( 'youku', '#https?://v\.youku\.com/v_show/id_(?[a-z0-9_=\-]+)#i', 'wp_embed_handler_youku' ); /** * Chinese administration screens style - enqueue stylesheet * * This patch serves as a work-around to fix the font-size and font-style. * * Submit better CSS rules here: * http://cn.wordpress.org/contact/ * * @since 3.3.0 */ function zh_cn_l10n_patch_admin_screens_style_enqueue_stylesheet() { wp_register_style( 'zh-cn-l10n-administration-screens', content_url( ( WP_DEBUG ? '/languages/zh_CN-administration-screens.dev.css' : '/languages/zh_CN-administration-screens.css' ) ), array( 'wp-admin' ), '20111120'); wp_enqueue_style( 'zh-cn-l10n-administration-screens' ); } add_action( 'admin_init', 'zh_cn_l10n_patch_admin_screens_style_enqueue_stylesheet' ); /** * Chinese character count - register script * * This patch serves as a work-around to fix the built-in word-count.js. * * The sum of Chinese characters and English words will show up in "word count" * field once enabled. * * @since 3.3.0 */ function zh_cn_l10n_patch_character_count_register_script() { wp_deregister_script( 'word-count' ); wp_register_script( 'word-count', content_url( ( WP_DEBUG ? '/languages/zh_CN-word-count.dev.js' : '/languages/zh_CN-word-count.js' ) ), array( 'jquery' ), '20120605' ); } add_action( 'admin_footer', 'zh_cn_l10n_patch_character_count_register_script' ); /** * ICP license number * * For compliance with the Telecommunications Regulations. Can be turned off * in wp-config.php. * * @since 3.7.0 */ function zh_cn_l10n_settings_init() { if ( defined( 'WP_ZH_CN_ICP_NUM' ) && WP_ZH_CN_ICP_NUM ) { add_settings_field( 'zh_cn_l10n_icp_num', 'ICP备案号', 'zh_cn_l10n_icp_num_callback', 'general' ); register_setting( 'general', 'zh_cn_l10n_icp_num' ); } } add_action( 'admin_init', 'zh_cn_l10n_settings_init' ); function zh_cn_l10n_icp_num_callback() { echo '' . '

仅对WordPress自带主题有效。

'; } function zh_cn_l10n_icp_num( $content ) { if ( defined( 'WP_ZH_CN_ICP_NUM' ) && WP_ZH_CN_ICP_NUM && get_option( 'zh_cn_l10n_icp_num' ) ) { echo '' . esc_attr( get_option( 'zh_cn_l10n_icp_num' ) ) . "\n"; } } add_action( 'twentyten_credits', 'zh_cn_l10n_icp_num' ); add_action( 'twentyeleven_credits', 'zh_cn_l10n_icp_num' ); add_action( 'twentytwelve_credits', 'zh_cn_l10n_icp_num' ); add_action( 'twentythirteen_credits', 'zh_cn_l10n_icp_num' ); ?>