Last active
October 31, 2025 14:31
-
-
Save propertyhive/d6724e444ebc24979ef873f3c4c779a8 to your computer and use it in GitHub Desktop.
Output 'studio' when bedrooms is 0
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
| add_filter( 'propertyhive_get_detail', 'change_bedrooms', 10, 3 ); | |
| function change_bedrooms($value, $key, $property) | |
| { | |
| if ( $key != 'bedrooms' ) { return $value; } | |
| if ( $property->_bedrooms == '0' ) | |
| { | |
| return 'Studio'; | |
| } | |
| return $value; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment