epl_svg_icons Replace existing SVG icons with your own

Within Easy Property Listings we pre load SVG icons on page load so that only one bit of code is loaded for all icons. These are then called into the template using CSS to minimise file loading. EG 100 listings on a page 1 set of icons for all. This way of loading icons allows for CSS changes to style the SVG Icons the defaults to any style you require.

The default icons are passed through a filter; The general (beds/bath/car/pool/aircon) use the epl_svg_icons filter and the social media icons pass through the epl_svg_social_icons filter.

<?php
/**
 * Replace icons with my own ones
 *
 */
function my_new_listing_svg_icons( $existing_icons ) {

	$new_icons = '
	
	<svg version="1.1" xmlns="http://www.w3.org/2000/svg"  class="hide" style="display:none">
		// Replace all of me with your new icons.
	</svg>
	';
	
	return $new_icons;

}
add_filter( 'epl_svg_icons', 'my_new_listing_svg_icons', 10, 1 );

These filters will allow you to replace the entire set of icons or add your own set in addition to the existing icons.

The epl_svg_icons filter is called in the epl_load_svg_listing_icons_head() function.

The epl_svg_social_icons filter is called from the epl_svg_social_icons() function.

In order for SVG to replace existing icons they must be contained in a <symbol> tag as use the existing id names.