PostController_BeforeFormSave_Handler Hook doesn't work
I was trying to add some additional validation from a plugin before creating a new discussion form submission. Could anyone please help?
Tagged:
0
I was trying to add some additional validation from a plugin before creating a new discussion form submission. Could anyone please help?
Comments
It's the DiscussionModel that you have to look into: https://github.com/R-J/AddWPInfo/blob/master/class.addwpinfo.plugin.php#L98-120
Thanks.. That seems to work... But i was trying to add new error msg with $Sender->Form->AddError
but, Call to a member function AddError() on a non-object.
You can use
$Sender->Validation->AddValidationResult('FieldName', 'Error message');
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
That works great. Thanks guys....