Created
August 23, 2017 03:43
-
-
Save turtlepod/e89010bb689ec9be10c3e38757bdd7d3 to your computer and use it in GitHub Desktop.
Change Listify Map Marker Popup to Company Logo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Change the data of a listing to add logo. | |
add_filter( 'listify_get_listing_to_array', function( $data, $listing ) { | |
$data['myLogoURL'] = esc_url( $listing->get_company_logo() ); | |
return $data; | |
}, 10, 2 ); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Map marker pin popup. | |
* | |
* @since unknown | |
* @version 2.2.0 | |
* | |
* @package Listify | |
* @category Template | |
* @author Astoundify | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; // Exit if accessed directly. | |
} | |
?> | |
<script id="tmpl-infoBubbleTemplate" type="text/template"> | |
<# if ( data.myLogoURL ) { #> | |
<span style="background-image: url({{data.myLogoURL}})" class="list-cover has-image"></span> | |
<# } #> | |
<# if ( data.title ) { #> | |
<h3> | |
<a href="{{data.permalink}}" target="{{data.mapMarker.target}}"> | |
{{{data.title}}} | |
</a> | |
</h3> | |
<# } #> | |
<# if ( data.cardDisplay.rating && data.reviews ) { #> | |
<div class="listing-stars"> | |
<# if ( data.reviews ) { #> | |
<# for ( var i = 1; i <= data.reviews.stars.full; i++ ) { #> | |
<span class="listing-star listing-star--full"></span> | |
<# } for ( var i = 1; i <= data.reviews.stars.half; i++ ) { #> | |
<span class="listing-star listing-star--half"></span> | |
<# } for ( var i = 1; i <= data.reviews.stars.empty; i++ ) { #> | |
<span class="listing-star listing-star--empty"></span> | |
<# } #> | |
<# } #> | |
</div> | |
<# } #> | |
<# if ( data.status.businessHours ) { #> | |
<# if ( data.status.businessIsOpen ) { #> | |
<div class="listing-business-hour-status" data-status="open"> | |
<?php esc_html_e( 'Now Open', 'listify' ); ?> | |
</div> | |
<# } else { #> | |
<div class="listing-business-hour-status" data-status="closed"> | |
<?php esc_html_e( 'Closed', 'listify' ); ?> | |
</div> | |
<# } #> | |
<# } #> | |
<# if ( data.location.raw ) { #> | |
<span class="address">{{{data.location.raw}}}</span> | |
<# } #> | |
<# if ( data.permalink ) { #> | |
<a href="{{data.permalink}}" class="job_listing-clickbox"></a> | |
<# } #> | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment