epl_property_land_area_unit_label Change the land area size labels
Description #
Changes the unit shown after a listing's land size, for example "Land is 3.01 hectare" to "Land is 3.01 ha".
It runs on the listing's land size, in the Elementor Property Icons widget (since 3.6) and in the listing column in the WordPress admin.
Usage #
add_filter( 'epl_property_land_area_unit_label', 'my_land_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², and in the admin column acres arrive as acre.)
Examples #
function my_land_area_unit_label( $label ) {
if ( 'hectare' === $label ) {
$label = 'ha';
} elseif ( 'sqft' === $label ) {
$label = 'sq ft';
}
return $label;
}
add_filter( 'epl_property_land_area_unit_label', 'my_land_area_unit_label' );
Related #
- epl_property_building_area_unit_label: the same for the building size.
- How to adjust the land and building units defaults with filters: the unit options in the listing editor (
epl_opts_area_unit_filter).
Source #
lib/includes/class-epl-property-meta.php, in EPL_Property_Meta::get_property_land_value(); lib/post-types/post-types.php, in epl_manage_listing_column_listing_callback(); and since 3.6 lib/page-builders/elementor/widgets/elements/class-epl-elementor-property-icons.php. Since 3.1.12.