registered as $script ) { if ( stripos( $script->src, 'http://', 0 ) !== FALSE ) { $script->src = str_replace( 'http://', 'https://', $script->src ); } } } } } /** * force plugins to load styles with SSL if page is SSL */ function enqueueStylesFix() { if ( ! is_admin() ) { if ( ! empty( $_SERVER[ 'HTTPS' ] ) ) { global $wp_styles; foreach ( (array) $wp_styles->registered as $script ) { if ( stripos( $script->src, 'http://', 0 ) !== FALSE ) { $script->src = str_replace( 'http://', 'https://', $script->src ); } } } } }