Invoke a function before the action hook October 8, 2022 by Tarik Billa For this specific problem you can use Rilwis metabox plugin, where you can define custom metabox along with the validation.