0

So i am ready to throw in my custom post type a bunch of custom fields.

All these fields need specific handling for their input and validation.

Exmaples:

  • Numeric fields
  • E-mails
  • WYSIWYG editor
  • Datepicker e.t.c

I know i can install Types or ACF and get going but i want to know how to code the above.

I have been searching for a "wordpress-way" of doing this but i cant find any.

Looking at the wp enqueue script documentation i saw the default libraries that are included out of the box in WP and i saw Jquery UI.

So i wonder, How i would format and validate my custom fields manually?

  1. Add inline styles from a UI library like Jquery
  2. And include jquery validation to handle my validation

Is this the preferred way and best practice or am i missing something here?

  • You can do it with jquery before the information is submitted to the database, or you can do it with php, on save, when the user clicks on publish/update. – gdaniel Nov 3 '15 at 22:49
  • And about formatting the display for these fields.Mannually with jquery ui? – e4rthdog Nov 4 '15 at 4:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.