add_filter( 'wpsl_info_window_template', 'custom_info_window_template' ); function custom_info_window_template() { $sections = wpsl_get_service( 'template_sections' ); $settings = wpsl_get_service( 'wpsl_settings' ); $icons = $settings->get( 'appearance', 'icons', [] ); $icons_enabled = ! empty( $icons['enabled'] ); $contact_details = (array) $settings->get( 'ux', 'contact_details', [] ); $hours = (array) $settings->get( 'ux', 'hours', [] ); $description = (array) $settings->get( 'ux', 'description', [] ); $info_window_template = '
<%= my_textinput %>
' . "\r\n"; $info_window_template .= "\t" . '<% } %>' . "\r\n"; // The phone, fax and email, if "In the marker popup" is selected for the contact details. if ( in_array( 'marker_popup', $contact_details, true ) ) { $info_window_template .= $sections->contact_details(); } // The short open / closed status, if "In the marker popup" is // selected for the opening hours and the status is enabled. if ( in_array( 'marker_popup', $hours, true ) && $settings->get( 'ux', 'show_hour_status' ) ) { $info_window_template .= "\t" . '<% if ( typeof hours_status !== "undefined" && hours_status && ( typeof location_status === "undefined" || !location_status ) ) { %>' . "\r\n"; if ( $icons_enabled ) { $info_window_template .= "\t" . '' . "\r\n"; } else { $info_window_template .= "\t" . '<%= hours_status %>' . "\r\n"; } $info_window_template .= "\t" . '<% } %>' . "\r\n"; } // The post content, if "In the marker popup" is selected for the post content. if ( in_array( 'marker_popup', $description, true ) ) { $info_window_template .= "\t" . '<% if ( typeof description !== "undefined" && description ) { %>' . "\r\n"; $info_window_template .= "\t" . '<%= description %>
' . "\r\n"; $info_window_template .= "\t" . '<% } %>' . "\r\n"; } // The "temporarily closed" or "permanently closed" notice. $status_class = ( $icons_enabled ) ? 'wpsl-location-status wpsl-icon-attention' : 'wpsl-location-status'; $info_window_template .= "\t" . '<% if ( typeof location_status !== "undefined" && location_status ) { %>' . "\r\n"; $info_window_template .= "\t" . '<%= location_status %>
' . "\r\n"; $info_window_template .= "\t" . '<% } %>' . "\r\n"; // The directions, street view and zoom links, // plus the "More details" link when it's enabled. $info_window_template .= "\t" . '<%= createInfoWindowActions( id, url, typeof permalink !== "undefined" ? permalink : "" ) %>' . "\r\n"; $info_window_template .= '