Skip to content

Commit ad9df53

Browse files
committed
Merge branch 'release/1.8.1'
2 parents 9e96293 + f84a684 commit ad9df53

File tree

7 files changed

+64
-41
lines changed

7 files changed

+64
-41
lines changed

build

build-config.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ module.exports = {
1919
},
2020
version: {
2121
src: [
22-
'functions.php'
22+
'functions.php',
23+
'readme.txt'
2324
]
2425
},
2526
sass: {
@@ -55,15 +56,15 @@ module.exports = {
5556
'!{tmp,tmp/**}' // Ignore tmp/ and contents
5657
]
5758
},
58-
css: {
59-
src: [
60-
'style.css',
61-
'woocommerce.css',
62-
],
63-
},
59+
css: {
60+
src: [
61+
'style.css',
62+
'woocommerce.css',
63+
],
64+
},
6465
copy: {
6566
src: [
66-
'**/!(*.js|*.scss|*.md|style.css|woocommerce.css)', // Everything except .js and .scss files
67+
'**/!(*.js|*.scss|*.md|style.css|woocommerce.css)', // Everything except .js and .scss files
6768
'!{build,build/**}', // Ignore build/ and contents
6869
'!{sass,sass/**}', // Ignore sass/ and contents
6970
'inc/settings/chosen/*.js', // Ensure necessary .js files ignored in the first glob are copied

functions.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,18 @@ function origami_title($title, $sep, $seplocation){
188188
function origami_enqueue_scripts() {
189189
wp_enqueue_style( 'origami', get_stylesheet_uri(), array(), SITEORIGIN_THEME_VERSION );
190190

191+
wp_enqueue_script( 'origami', get_template_directory_uri() . '/js/origami' . SITEORIGIN_THEME_JS_PREFIX . '.js', array( 'jquery' ), SITEORIGIN_THEME_VERSION );
192+
191193
if ( ! class_exists( 'Jetpack' ) && siteorigin_setting( 'responsive_fitvids' ) ) {
192194
wp_enqueue_script( 'fitvids', get_template_directory_uri() . '/js/jquery.fitvids' . SITEORIGIN_THEME_JS_PREFIX . '.js', array( 'jquery' ), '1.0' );
195+
wp_localize_script(
196+
'origami',
197+
'origami', array(
198+
'fitvids' => true,
199+
)
200+
);
193201
}
194202

195-
wp_enqueue_script( 'origami', get_template_directory_uri() . '/js/origami' . SITEORIGIN_THEME_JS_PREFIX . '.js', array( 'jquery' ), SITEORIGIN_THEME_VERSION );
196-
197203
wp_enqueue_script( 'flexslider', get_template_directory_uri() . '/js/jquery.flexslider' . SITEORIGIN_THEME_JS_PREFIX . '.js', array( 'jquery' ), '2.1' );
198204
wp_enqueue_style( 'flexslider', get_template_directory_uri() . '/css/flexslider.css', array(), '2.0' );
199205

inc/customizer/customizer.php

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected function render() {
5353
}
5454
endif;
5555

56-
if(!class_exists('SiteOrigin_Customizer_CSS_Builder ')) :
56+
if ( !class_exists( 'SiteOrigin_Customizer_CSS_Builder' ) ) :
5757
/**
5858
* This is used for building custom CSS.
5959
*/
@@ -87,13 +87,15 @@ function css() {
8787
// Start by importing Google web fonts
8888
$return = '<style type="text/css" id="customizer-css">';
8989

90-
$import = array();
91-
foreach ( $this->google_fonts as $font ) {
92-
$import[ ] = urlencode( $font[ 0 ] ) . ':' . $font[ 1 ];
93-
}
94-
$import = array_unique( $import );
95-
if ( !empty( $import ) ) {
96-
$return .= '@import url(http' . ( is_ssl() ? 's' : '' ) . '://fonts.googleapis.com/css?family=' . implode( '|', $import ) . '); ';
90+
if ( apply_filters( 'origami_import_google_fonts', true ) ) {
91+
$import = array();
92+
foreach ( $this->google_fonts as $font ) {
93+
$import[ ] = urlencode( $font[ 0 ] ) . ':' . $font[ 1 ];
94+
}
95+
$import = array_unique( $import );
96+
if ( !empty( $import ) ) {
97+
$return .= '@import url(//fonts.googleapis.com/css?family=' . implode( '|', $import ) . '&display=block); ';
98+
}
9799
}
98100

99101
foreach ( $this->css as $selector => $rules ) {
@@ -175,13 +177,16 @@ function add_web_font( $selector, $mod ) {
175177
}
176178

177179
$this->add_css( $selector, 'font-family', $family );
178-
if ( $variant != 400 ) $this->add_css( $selector, 'font-weight', $variant );
179-
180-
$this->fonts[ ] = $font;
181-
182-
if ( !empty( $variant ) ) {
183-
if ( $variant == 'regular' ) $variant = '400';
184-
$this->css[ $selector ][ ] = 'font-weight: ' . $variant;
180+
if ( ! empty( $variant ) ) {
181+
if ( $variant != 400 && $variant != 'regular' ) {
182+
if ( ! is_numeric( $variant ) ) {
183+
$variant = filter_var( $variant, FILTER_SANITIZE_NUMBER_INT );
184+
$this->add_css( $selector, 'font-style', 'italic' );
185+
}
186+
$this->add_css( $selector, 'font-weight', $variant );
187+
} else {
188+
$this->add_css( $selector, 'font-weight', 400 );
189+
}
185190
}
186191
}
187192

@@ -325,7 +330,7 @@ class SiteOrigin_Customizer_Helper {
325330
private $sections;
326331
private $defaults;
327332

328-
function __construct($settings = array(), $sections = array(), $theme, $root_url = false, $make_single = true){
333+
function __construct($settings = array(), $sections = array(), $theme = 'generic', $root_url = false, $make_single = true){
329334
// Give child themes a chance to filter this.
330335
$this->theme = $theme;
331336
$this->defaults = array();
@@ -334,11 +339,6 @@ function __construct($settings = array(), $sections = array(), $theme, $root_url
334339
$this->add_sections($sections);
335340
$this->add_settings($settings);
336341

337-
if( empty($root_url) ) {
338-
$root_url = get_template_directory_uri().'/premium/extras/customizer/';
339-
}
340-
$this->root_url = $root_url;
341-
342342
// Add a script that will help us with our previews
343343
add_action( 'customize_preview_init', array( $this, 'enqueue' ) );
344344
add_action( 'customize_controls_enqueue_scripts', array( $this, 'admin_enqueue' ) );
@@ -452,6 +452,11 @@ function customize_register($wp_customize){
452452
// Can't use live changes with a callback
453453
if( !empty($setting['callback']) ) $setting['no_live'] = true;
454454

455+
// Set $setting['description' ] if this setting doesn't have a description
456+
if ( ! isset( $setting['description' ] ) ) {
457+
$setting['description'] = '';
458+
}
459+
455460
// Now lets add a control for this setting
456461
switch($setting['type']) {
457462
case 'font' :
@@ -460,6 +465,7 @@ function customize_register($wp_customize){
460465
'section' => $setting['section'],
461466
'settings' => $id,
462467
'priority' => $priority++,
468+
'description' => esc_html( $setting['description'] ),
463469
) ) );
464470
break;
465471

@@ -469,6 +475,7 @@ function customize_register($wp_customize){
469475
'section' => $setting['section'],
470476
'settings' => $id,
471477
'priority' => $priority++,
478+
'description' => esc_html( $setting['description'] ),
472479
) ) );
473480
if ( empty( $setting['no_live'] ) ) $wp_customize->get_setting( $id )->transport = 'postMessage';
474481
break;
@@ -479,6 +486,7 @@ function customize_register($wp_customize){
479486
'section' => $setting['section'],
480487
'type' => 'text',
481488
'priority' => $priority++,
489+
'description' => esc_html( $setting['description'] ),
482490
) );
483491
if( empty( $setting['no_live'] ) ) $wp_customize->get_setting( $id )->transport = 'postMessage';
484492
break;
@@ -489,6 +497,7 @@ function customize_register($wp_customize){
489497
'section' => $setting['section'],
490498
'settings' => $id,
491499
'priority' => $priority++,
500+
'description' => esc_html( $setting['description'] ),
492501
) ) );
493502
break;
494503

@@ -498,6 +507,7 @@ function customize_register($wp_customize){
498507
'section' => $setting['section'],
499508
'settings' => $id,
500509
'priority' => $priority++,
510+
'description' => esc_html( $setting['description'] ),
501511
) ) );
502512
break;
503513

@@ -508,6 +518,7 @@ function customize_register($wp_customize){
508518
'type' => $setting['type'],
509519
'priority' => $priority++,
510520
'choices' => isset($setting['choices']) ? $setting['choices'] : null,
521+
'description' => esc_html( $setting['description'] ),
511522
) );
512523
break;
513524
}
@@ -559,11 +570,11 @@ function create_css_builder(){
559570
}
560571
}
561572
}
562-
563-
if(isset($setting['callback'])) {
564-
$val = get_theme_mod($id);
565-
if(isset( $setting['default'] ) && $val != $setting['default']) {
566-
call_user_func( $setting['callback'], $builder, $val, array_merge( $setting, array('id' => $id) ) );
573+
574+
if ( isset( $setting['callback'] ) ) {
575+
$val = get_theme_mod( $id );
576+
if ( isset( $setting['default'] ) && $val != $setting['default'] ) {
577+
call_user_func( $setting['callback'], $builder, $val, array_merge( $setting, array( 'id' => $id ) ) );
567578
}
568579
}
569580
}
@@ -598,7 +609,7 @@ function admin_enqueue( ){
598609
)
599610
));
600611

601-
wp_enqueue_style('siteorigin-customizer-admin', $this->root_url . 'css/admin.css', array( ), SITEORIGIN_THEME_VERSION );
612+
wp_enqueue_style('siteorigin-customizer-admin', get_template_directory_uri() . '/inc/customizer/css/admin.css', array( ), SITEORIGIN_THEME_VERSION );
602613
}
603614

604615
/**
@@ -611,4 +622,4 @@ function reset_defaults(){
611622
}
612623
}
613624

614-
endif;
625+
endif;

js/origami.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
jQuery( function( $ ) {
99

10-
if ( typeof $.fn.fitVids !== 'undefined' ) {
10+
if ( typeof $.fn.fitVids !== 'undefined' && typeof origami !== 'undefined' && typeof origami.fitvids ) {
1111
// We use FitVids to scale videos to mobile devices.
1212
$( '.featured-video, .content, .content p' ).fitVids();
1313
}

readme.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ This theme makes use of the [SiteOrigin Settings Framework](https://github.com/s
9393

9494
== Changelog ==
9595

96+
= 1.8.1 - 19 June 2021 =
97+
* Only setup FitVids if enabled in Theme Settings. Ensures better compatibility with other plugins loading FitVids for fluid width video embeds.
98+
* Set Google font display to block.
99+
* Updated SiteOrigin Settings framework.
100+
96101
= 1.8 - 21 January 2021 =
97102
* Added `Responsive Navigation Collapse` setting.
98103
* Updated the Google Fonts array.

0 commit comments

Comments
 (0)