Пример #1
0
/**
 * binds WP ajax handlers to the adapter for updating settings
 */
function updateSettings()
{
    $adapter = new Adapter();
    //squelch any undefined vars messages -- an exception will be thrown so the
    //php warning is not needed
    try {
        @$adapter->setAdminName($_POST['etm_name']);
        @$adapter->setAdminEmail($_POST['etm_email']);
    } catch (\Exception $e) {
        die($e->getMessage());
    }
    //send back the success message
    echo "true";
    die;
}