Skip to content

Commit

Permalink
fix: don't make an empty map link
Browse files Browse the repository at this point in the history
  • Loading branch information
basscl committed Oct 19, 2022
1 parent 6643a83 commit cc3590d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ More options are now available:
* `only_featured=true` // filter for featured posts only
* `featured_at_top=true` // order featured posts at top
* `exclude_featured=true` // filter out featured posts
* `more_info_post_link=true` // force more info button to link to the single post instead of to an external website
* `more_info_post_link=true` // force the more info button to appear by default & link to the single post instead of to an external website

## Filters

Expand Down
3 changes: 2 additions & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,8 @@ function get_squarecandy_acf_events_address_display( $event, $style = '2line', $
endif;
}
endif;
$map_link = apply_filters( 'squarecandy_events_map_link', 'https://www.google.com/maps/search/' . rawurlencode( $map_location ), $map_location );
$map_link = $map_link ? 'https://www.google.com/maps/search/' . rawurlencode( $map_location ) : '';
$map_link = apply_filters( 'squarecandy_events_map_link', $map_link, $map_location );
if ( $map_link ) :
$output .= '<a class="button small button-gray button-map" href="' . $map_link . '">';
$output .= '<i class="fa fa-map"></i> ' . __( 'map', 'squarecandy-acf-events' );
Expand Down
1 change: 1 addition & 0 deletions inc/shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ function squarecandy_events_func( $atts = array() ) {
}

if ( $compact ) {
// this will always override the number set in $atts - seems counterintuituve
$args['posts_per_page'] = get_option( 'options_number_of_upcoming' );
}

Expand Down

0 comments on commit cc3590d

Please sign in to comment.