Skip to content

Instantly share code, notes, and snippets.

@fbzhong
Created July 5, 2011 05:39
Show Gist options
  • Save fbzhong/1064299 to your computer and use it in GitHub Desktop.
Save fbzhong/1064299 to your computer and use it in GitHub Desktop.
HTTPS fix for wordpress language zh_CN.php
function zh_cn_language_pack_backend_style_modify() {
$styleUrl = WP_CONTENT_URL . '/' . ZH_CN_PACK_LANGUAGE_DIR_TO_CONTENT . 'zh_CN-dashboard.css';
$styleFile = WP_CONTENT_DIR . '/' . ZH_CN_PACK_LANGUAGE_DIR_TO_CONTENT . 'zh_CN-dashboard.css';
if ( file_exists( $styleFile ) ) {
+ if ( 0 === strpos($styleUrl, 'http') && is_ssl() )
+ $styleUrl = str_replace( 'http://', 'https://', $styleUrl );
wp_register_style( 'zh-cn-pack-style-dashboard', $styleUrl, array(), '1.0');
wp_enqueue_style( 'zh-cn-pack-style-dashboard' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment