Getting started
Manual data entry
Menu
Getting started
Manual data entry
Hooks & filters Floor plan rentfetch_get_bathroom_number_label

rentfetch_get_bathroom_number_label

Last updated: December 12, 2025

The rentfetch_get_bathroom_number_label filter allows you to customize the display format of bathroom counts throughout the Rent Fetch plugin. This filter is applied in the rentfetch_get_floorplan_bathrooms() function and affects how bathroom information appears in floorplan displays.

Usage

add_filter( 'rentfetch_get_bathroom_number_label', 'my_custom_bathroom_label', 10, 1 );

function my_custom_bathroom_label( $baths ) {
    // Modify the $baths display as needed
    return $baths;
}

Parameters

  • $baths (int|float)
    The number of bathrooms for the current floorplan.

Return

(string|null) The formatted bathroom label, or null if no bathrooms should be displayed.

Examples

Change “Bath” to “Bathroom”

<?php
add_filter( 'rentfetch_get_bathroom_number_label', 'change_bath_to_bathroom', 10, 1 );

function change_bath_to_bathroom( $baths ) {
    if ( 0 === $baths ) {
        return null;
    } elseif ( 1 === $baths || 1.0 === $baths ) {
        return '1 <span class="label bathroom-label">Bathroom</span>';
    } else {
        return $baths . ' <span class="label bathroom-label">Bathrooms</span>';
    }
}

Use Abbreviations

<?php
add_filter( 'rentfetch_get_bathroom_number_label', 'use_bath_abbreviations', 10, 1 );

function use_bath_abbreviations( $baths ) {
    if ( 0 === $baths ) {
        return null;
    } elseif ( 1 === $baths || 1.0 === $baths ) {
        return '1 <span class="label bathroom-label">BA</span>';
    } else {
        return $baths . ' <span class="label bathroom-label">BAs</span>';
    }
}

Custom Styling

<?php
add_filter( 'rentfetch_get_bathroom_number_label', 'custom_bath_styling', 10, 1 );

function custom_bath_styling( $baths ) {
    if ( 0 === $baths ) {
        return null;
    } elseif ( 1 === $baths || 1.0 === $baths ) {
        return '<span class="bath-count">1</span> <span class="bath-label">Full Bath</span>';
    } else {
        return '<span class="bath-count">' . $baths . '</span> <span class="bath-label">Full Baths</span>';
    }
}

Default Output

  • 0 bathrooms: null (nothing displayed)
  • 1 bathroom: 1 <span class="label bathroom-label">Bath</span>
  • 2+ bathrooms: {number} <span class="label bathroom-label">Baths</span>

Where It’s Used

This filter affects bathroom displays in:

  • Single floorplan pages (single-floorplans.php)
  • Floorplan archive grid view (floorplan-each-grid-default.php)
  • Floorplan archive list view (floorplan-each-list-default.php)
  • Bathroom search filters

Notes

  • The filter receives the raw bathroom count as a number (int or float)
  • Return null to hide the bathroom information entirely
  • The <span class="label bathroom-label"> wrapper is included for consistent styling
  • Changes made here will be reflected wherever rentfetch_get_floorplan_bathrooms() is called
  • The filter runs within the floorplan post context, so you can access other floorplan metadata

Related Functions

  • rentfetch_get_floorplan_bathrooms() – The function that applies this filter
  • rentfetch_floorplan_bathrooms() – Echoes the bathroom information
  • rentfetch_get_floorplan_bedrooms() – Similar function for bedroom counts
  • rentfetch_get_square_feet_number_label() – Similar function for square footage

Take Your Apartment Website to the Next Level

Whether for an entire portfolio or a single property, get completely setup and sync new property info & floor plan data in 10 minutes or less.

Trusted By

Cowboy Partners

Brickstone

Four Star

StreetLights

Richmark

Gates Hudson

Try Rent Fetch Today

We offer a 30-day, money-back guarantee.