Update ajax-functions.php

Fix multisite permalink problems and added localization.