I think creating a new file, `php/compat-wp.php` would be the most "correct" way.