Skip to content

Commit

Permalink
implemented automatic https asset paths, fixes #140
Browse files Browse the repository at this point in the history
  • Loading branch information
kontur committed Mar 30, 2018
1 parent 1dbb870 commit 59095ce
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 22,841 deletions.
3 changes: 3 additions & 0 deletions FontsamplerHelpers.php
Expand Up @@ -322,6 +322,9 @@ function get_best_file_from_fonts( $fonts ) {
}
}
if ( false !== $best ) {
if (is_ssl() && substr($best, 0, 7) === "http://") {
$best = str_replace("http://", "https://", $best);
}
$fontsFiltered[ $font['id'] ] = $best;
}
}
Expand Down
3 changes: 2 additions & 1 deletion FontsamplerPlugin.php
Expand Up @@ -208,6 +208,8 @@ function fontsampler_shortcode( $atts ) {
$css = $this->helpers->get_custom_css( $set ); // returns false or link to generated custom css
$fonts = $this->helpers->get_best_file_from_fonts( $this->db->get_fontset_for_set( intval( $attributes['id'] ) ) );

var_dump($fonts);

if ( false !== $css ) {
wp_enqueue_style( 'fontsampler-interface-' . $id, $css, array(), false );
}
Expand Down Expand Up @@ -349,7 +351,6 @@ function fontsampler_shortcode( $atts ) {

<?php


// include, aka echo, template with replaced values from $replace above
include( 'includes/interface.php' );

Expand Down

0 comments on commit 59095ce

Please sign in to comment.