Skip to content

Commit

Permalink
Merge branch 'release/1.6.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
gregpriday committed Jun 24, 2016
2 parents b51fdf9 + bb9bee8 commit 6e79dd5
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 29 deletions.
2 changes: 1 addition & 1 deletion base/inc/post-selector.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function siteorigin_widget_post_selector_process_query($query){
if($query['post_type'] == '_all') $query['post_type'] = siteorigin_widget_post_selector_all_post_types();
$query['post_type'] = strpos( $query['post_type'], ',' ) !== false ? explode( ',', $query['post_type'] ) : $query['post_type'];
}
if( $query['post_type'] == 'attachment' && $query['post_status'] == 'publish' ) {
if( !empty( $query['post_type'] ) && $query['post_type'] == 'attachment' && $query['post_status'] == 'publish' ) {
$query['post_status'] = 'inherit';
}

Expand Down
4 changes: 0 additions & 4 deletions base/js/posts-selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -631,10 +631,7 @@ var soWidgetPostSelector = ( function ($, _) {
query : 'post_type=_all&posts_per_page=-1&post__in=' + getPosts.join(',')
},
function(data){

console.log(data);
if(typeof data.posts !== 'undefined') {

_.each(data.posts, function(post, i){
v.postCache[post.id] = {
id : post.id,
Expand All @@ -643,7 +640,6 @@ var soWidgetPostSelector = ( function ($, _) {
editUrl: post.editUrl
};
});

}

v.refreshLoading();
Expand Down
8 changes: 8 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ The SiteOrigin Widgets Bundle is the perfect platform to build widgets for your

== Changelog ==

= 1.6.1 - 24 June 2016 =
* Social Links: Fixed auto-filling of network colors.
* Social Links: Added 500px network.
* Social Links: Added title tag to link tags.
* Maps: Prevent JS error in when maps widget script is enqueued but widget isn't displayed.
* Maps: Made API field more prominent as it's now required by the Google Maps API.
* Added more general error checking.

= 1.6 - 21 June 2016 =
* Added builder field.
* Added new multi checkboxes field.
Expand Down
29 changes: 16 additions & 13 deletions widgets/google-map/google-map.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,22 @@ function initialize_form(){
'label' => __( 'Map center', 'so-widgets-bundle' ),
'description' => __( 'The name of a place, town, city, or even a country. Can be an exact address too.', 'so-widgets-bundle' )
),
'api_key_section' => array(
'type' => 'section',
'label' => __( 'API key', 'so-widgets-bundle' ),
'hide' => false,
'fields' => array(
'api_key' => array(
'type' => 'text',
'label' => __( 'API key', 'so-widgets-bundle' ),
'description' => sprintf(
__( 'Enter your %sAPI key%s. Your map may not function correctly without one.', 'so-widgets-bundle' ),
'<a href="https://developers.google.com/maps/documentation/javascript/get-api-key" target="_blank">',
'</a>'
)
)
)
),
'settings' => array(
'type' => 'section',
'label' => __( 'Settings', 'so-widgets-bundle' ),
Expand Down Expand Up @@ -373,19 +389,6 @@ function initialize_form(){
)
)
),
'api_key_section' => array(
'type' => 'section',
'label' => __( 'API key', 'so-widgets-bundle' ),
'hide' => true,
'fields' => array(
'api_key' => array(
'type' => 'text',
'label' => __( 'API key', 'so-widgets-bundle' ),
'description' => __( 'Enter your API key if you have one. This enables you to monitor your Google Maps API usage in the Google APIs Console.', 'so-widgets-bundle' ),
'optional' => true
)
)
)
);
}

Expand Down
10 changes: 5 additions & 5 deletions widgets/google-map/js/js-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,12 @@ jQuery(function ($) {
if (window.google && window.google.maps) {
new SiteOriginGoogleMap($).loadMaps();
} else {
var apiKey = $('.sow-google-map-canvas').data('options').apiKey;
var mapOptions = $('.sow-google-map-canvas').data('options');

var apiUrl = 'https://maps.googleapis.com/maps/api/js?v=3.exp&callback=soGoogleMapInitialize';
if(apiKey) {
apiUrl += '&key=' + apiKey;
}
var apiUrl = 'https://maps.googleapis.com/maps/api/js?v=3.exp&callback=soGoogleMapInitialize';
if(mapOptions && mapOptions.apiKey) {
apiUrl += '&key=' + mapOptions.apiKey;
}
var script = $('<script type="text/javascript" src="' + apiUrl + '">');
$('body').append(script);
}
Expand Down
2 changes: 1 addition & 1 deletion widgets/headline/headline.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ function get_less_variables( $instance ) {
}
}

if ( ! empty( $instance['sub_headline'] ) && ! empty ( $instance['sub_headline']['text'] ) ) {
if ( ! empty( $instance['sub_headline'] ) ) {
$sub_headline_styles = $instance['sub_headline'];
if ( ! empty( $sub_headline_styles['align'] ) ) {
$less_vars['sub_headline_align'] = $sub_headline_styles['align'];
Expand Down
4 changes: 2 additions & 2 deletions widgets/headline/styles/default.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
@headline_tag: h1;
@headline_font: default;
@headline_font_weight: 400;
@headline_align: left;
@headline_align: center;
@headline_color: default;

@sub_headline_tag: h3;
@sub_headline_font: default;
@sub_headline_font_weight: 400;
@sub_headline_align: left;
@sub_headline_align: center;
@sub_headline_color: default;

@divider_weight: thin;
Expand Down
9 changes: 9 additions & 0 deletions widgets/social-media-buttons/data/networks.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@
'icon_color' => '#FFFFFF',
'button_color' => '#17B48A'
),

// The rest of the networks, alphabetically

'500px' => array(
'label' => __( '500px', 'so-widgets-bundle' ),
'base_url' => 'https://500px.com/',
'icon_color' => '#FFFFFF',
'button_color' => '#292929'
),
'behance' => array(
'label' => __( 'Behance', 'so-widgets-bundle' ),
'base_url' => 'https://www.behance.net/',
Expand Down
8 changes: 7 additions & 1 deletion widgets/social-media-buttons/social-media-buttons.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ function __construct() {

function initialize_form(){

$this->networks = include plugin_dir_path( __FILE__ ) . 'data/networks.php';
if( empty( $this->networks ) ) {
$this->networks = include plugin_dir_path( __FILE__ ) . 'data/networks.php';
}

$network_names = array();
foreach ( $this->networks as $key => $value ) {
Expand Down Expand Up @@ -163,6 +165,10 @@ function modify_instance( $instance ) {
}

function get_javascript_variables() {
if( empty( $this->networks ) ) {
$this->networks = include plugin_dir_path( __FILE__ ) . 'data/networks.php';
}

return array( 'networks' => $this->networks );
}

Expand Down
5 changes: 3 additions & 2 deletions widgets/social-media-buttons/tpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
$classes[] = "sow-social-media-button-" . sanitize_html_class( $network['name'] );
$classes[] = "sow-social-media-button";
$button_attributes = array(
'class' => esc_attr(implode(' ', $classes))
'class' => esc_attr( implode(' ', $classes) ),
'title' => sprintf( __( '%s on %s', 'so-widgets-bundle' ), get_bloginfo( 'name' ), ucwords( str_replace( '-', ' ', $network['name'] ) ) ),
);
if(!empty($instance['design']['new_window'])) $button_attributes['target'] = '_blank';
if ( ! empty( $network['url'] ) ) $button_attributes['href'] = sow_esc_url( $network['url'] );
?>

<a <?php foreach($button_attributes as $name => $val) echo $name . '="' . $val . '" ' ?>>
<a <?php foreach($button_attributes as $name => $val) echo $name . '="' . esc_attr( $val ) . '" ' ?>>
<span>
<?php if( !empty( $network['is_custom'] ) ) echo '<!-- premium-' . $network['name'] . ' -->'; ?>
<?php echo siteorigin_widget_get_icon( $network['icon_name'] ); ?>
Expand Down

0 comments on commit 6e79dd5

Please sign in to comment.