-
-
Save tijmenssmit80/eb6adab62fd96ac474b7 to your computer and use it in GitHub Desktop.
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
add_filter( 'wpsl_info_window_template', 'custom_info_window_template' ); | |
function custom_info_window_template() { | |
global $wpsl; | |
$info_window_template = '<div data-store-id="<%= id %>" class="wpsl-info-window">' . "\r\n"; | |
$info_window_template .= "\t\t" . '<p>' . "\r\n"; | |
$info_window_template .= "\t\t\t" . wpsl_store_header_template() . "\r\n"; // Check which header format we use | |
$info_window_template .= "\t\t\t" . '<span><%= address %></span>' . "\r\n"; | |
$info_window_template .= "\t\t\t" . '<% if ( address2 ) { %>' . "\r\n"; | |
$info_window_template .= "\t\t\t" . '<span><%= address2 %></span>' . "\r\n"; | |
$info_window_template .= "\t\t\t" . '<% } %>' . "\r\n"; | |
$info_window_template .= "\t\t\t" . '<span>' . wpsl_address_format_placeholders() . '</span>' . "\r\n"; // Use the correct address format | |
$info_window_template .= "\t\t" . '</p>' . "\r\n"; | |
$info_window_template .= "\t\t" . '<% if ( phone ) { %>' . "\r\n"; | |
$info_window_template .= "\t\t" . '<span><strong>' . esc_html( $wpsl->i18n->get_translation( 'phone_label', __( 'Phone', 'wpsl' ) ) ) . '</strong>: <%= formatPhoneNumber( phone ) %></span>' . "\r\n"; | |
$info_window_template .= "\t\t" . '<% } %>' . "\r\n"; | |
$info_window_template .= "\t\t" . '<% if ( fax ) { %>' . "\r\n"; | |
$info_window_template .= "\t\t" . '<span><strong>' . esc_html( $wpsl->i18n->get_translation( 'fax_label', __( 'Fax', 'wpsl' ) ) ) . '</strong>: <%= fax %></span>' . "\r\n"; | |
$info_window_template .= "\t\t" . '<% } %>' . "\r\n"; | |
$info_window_template .= "\t\t" . '<% if ( email ) { %>' . "\r\n"; | |
$info_window_template .= "\t\t" . '<span><strong>' . esc_html( $wpsl->i18n->get_translation( 'email_label', __( 'Email', 'wpsl' ) ) ) . '</strong>: <%= email %></span>' . "\r\n"; | |
$info_window_template .= "\t\t" . '<% } %>' . "\r\n"; | |
$info_window_template .= "\t\t" . '<% if ( hours ) { %>' . "\r\n"; | |
$info_window_template .= "\t\t" . '<div class="wpsl-store-hours"><strong>' . esc_html( $wpsl->i18n->get_translation( 'hours_label', __( 'Hours', 'wpsl' ) ) ) . '</strong>' . "\r\n"; | |
$info_window_template .= "\t\t" . '<%= hours %>' . "\r\n"; | |
$info_window_template .= "\t\t" . '</div>' . "\r\n"; | |
$info_window_template .= "\t\t" . '<% } %>' . "\r\n"; | |
$info_window_template .= "\t\t" . '<%= createInfoWindowActions( id ) %>' . "\r\n"; | |
$info_window_template .= "\t" . '</div>'; | |
return $info_window_template; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment