Skip to content

Instantly share code, notes, and snippets.

@propertyhive
Last active October 31, 2025 14:31
Show Gist options
  • Save propertyhive/d6724e444ebc24979ef873f3c4c779a8 to your computer and use it in GitHub Desktop.
Save propertyhive/d6724e444ebc24979ef873f3c4c779a8 to your computer and use it in GitHub Desktop.
Output 'studio' when bedrooms is 0
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