Created
September 23, 2024 18:28
-
-
Save jonschr/f91f3703a9df7fe8c98bf607e502d0a5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rentfetch_available_units_label( $number ) { | |
$number = intval( $number ); | |
if ( 0 === $number || empty( $number ) ) { | |
$available = 'No units available'; | |
} elseif ( 1 === $number ) { | |
$available = '1 unit available'; | |
} else { | |
$available = $number . ' units available'; | |
} | |
return $available; | |
} | |
add_filter( 'rentfetch_get_available_units_label', 'rentfetch_available_units_label' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment