macder / wfv-validation

Input validation API for WordPress
https://macder.github.io/wfv/
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Rework form config array so that each field attr is an array with 'label', 'rules', 'messages' #112

Closed macder closed 7 years ago

macder commented 7 years ago

new structure should look like:

array(
  'email' => [
    'label' => 'Email',
    'rules' => 'required|email',
    'messages' => [
      'required' => 'Custom required validation error msg',
      'email'    => 'No email? No soup for you!',
    ],
   'phone' => [
      //...
   ]
  ]
);