trying to call
unregister_setting('general','users_can_register');
so as to removed the option for allowing or dissallowing user registration (it is required in the theme, so it is set programatically) but it is returning Call to undefined function unregister_setting()...
That function is only available from the wp-admin section of the site. The file that contains it is only loaded as part of the wp-admin. You need to wrap it in a hook function: