Currently, the plugin exposes the new field on the template:
private $currentContextId;
/**
* @copydoc Plugin::register()
*/
function register($category, $path, $mainContextId = null) {
$success = parent::register($category, $path, $mainContextId);
if (!Config::getVar('general', 'installed') || defined('RUNNING_UPGRADE')) return true;
if ($success && $this->getEnabled($mainContextId)) {
// Register callback for Smarty filters; add CSS
HookRegistry::register('TemplateManager::display', array($this, 'handleTemplateDisplay'));
// Add "Connect ORCID" button to PublicProfileForm
HookRegistry::register('User::PublicProfile::AdditionalItems', array($this, 'handleUserPublicProfileDisplay'));
// Display additional ORCID access information and checkbox to send e-mail to authors in the AuthorForm
HookRegistry::register('authorform::display', array($this, 'handleFormDisplay'));
// Send email to author, if the added checkbox was ticked
HookRegistry::register('authorform::execute', array($this, 'handleAuthorFormExecute'));
// Insert the OrcidHandler to handle ORCID redirects
HookRegistry::register('LoadHandler', array($this, 'setupCallbackHandler'));
// Handle ORCID on user registration
And processes that new field on user registration:
// Add "Connect ORCID" button to PublicProfileForm
HookRegistry::register('User::PublicProfile::AdditionalItems', array($this, 'handleUserPublicProfileDisplay'));
// Display additional ORCID access information and checkbox to send e-mail to authors in the AuthorForm
HookRegistry::register('authorform::display', array($this, 'handleFormDisplay'));
// Send email to author, if the added checkbox was ticked
HookRegistry::register('authorform::execute', array($this, 'handleAuthorFormExecute'));
// Insert the OrcidHandler to handle ORCID redirects
HookRegistry::register('LoadHandler', array($this, 'setupCallbackHandler'));
// Handle ORCID on user registration
HookRegistry::register('registrationform::execute', array($this, 'collectUserOrcidId'));
// Send emails to authors without ORCID id upon submission
HookRegistry::register('submissionsubmitstep3form::execute', array($this, 'handleSubmissionSubmitStep3FormExecute'));
// Add more ORCiD fields to author DAO
HookRegistry::register('authordao::getAdditionalFieldNames', array($this, 'handleAdditionalFieldNames'));
// Add more ORCiD fields to UserDAO
HookRegistry::register('userdao::getAdditionalFieldNames', array($this, 'handleAdditionalFieldNames'));
// Send submission meta data upload to ORCID profiles on publication of an issue
HookRegistry::register('IssueGridHandler::publishIssue', array($this, 'handlePublishIssue'));
HookRegistry::register('issueentrypublicationmetadataform::execute', array($this, 'handleScheduleForPublication'));
It sounds like you would also want to hook into the form validation. You would use similar logic, but with the validation hook. There is an example of such a validation hook here:
$request = Application::getRequest();
$contextId = $request->getContext() ? $request->getContext()->getId() : CONTEXT_ID_NONE;
if ($success && $this->getEnabled($mainContextId)) {
$request = Application::getRequest();
$contextId = $request->getContext() ? $request->getContext()->getId() : CONTEXT_ID_NONE;
// Attach to the page footer
HookRegistry::register('Templates::Common::Footer::PageFooter', array($this, 'insertTag'));
// Attach to the registration form validation
HookRegistry::register('registrationform::validate', array($this, 'validateHoneypot'));
// Attach to the registration form display
HookRegistry::register('registrationform::display', array($this, 'initializeTimer'));
// Add custom field if desired
HookRegistry::register('TemplateManager::display', array($this, 'handleTemplateDisplay'));
HookRegistry::register('registrationform::readuservars', array($this, 'handleUserVar'));
$element = $this->getSetting($contextId, 'customElement');
if(!$element) {
// generate new form field
$this->updateSetting($contextId, 'customElement', $this->generateElementName());
}