It does not work for me. Did I put it in the wrong folder? I pasted your code inside /wp-content/plugins/bp-custom.php