epl_property_building_area_unit_label Change the building area labels

Description #

Changes the unit shown after a listing's building (floor) size, for example "Floor Area is 120 m²" to "Floor Area is 120 sqm".

It runs on the listing's building size and, since 3.6, in the Elementor Property Icons widget.


Usage #

add_filter( 'epl_property_building_area_unit_label', 'my_building_area_unit_label' );

Parameters #

$label (string)
The unit. Square metres arrive already as m² (m²) and acres as acre or acres. Any other unit arrives as its saved value: hectare, sqft or square. (In the Elementor widget square metres arrive as the character m².)


Examples #

function my_building_area_unit_label( $label ) {
	if ( 'square' === $label ) {
		$label = 'squares';
	} elseif ( 'sqft' === $label ) {
		$label = 'sq ft';
	}
	return $label;
}
add_filter( 'epl_property_building_area_unit_label', 'my_building_area_unit_label' );


Source #

lib/includes/class-epl-property-meta.php, in EPL_Property_Meta::get_property_building_area_value(), and since 3.6 lib/page-builders/elementor/widgets/elements/class-epl-elementor-property-icons.php. Since 3.1.12.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.