Creating Custom WooCommerce Input Field
read more

Creating Custom WooCommerce Input Field


I’ve been working on a project that introduces a few new options into a standard WooCommerce installation, and one of the features calls for adding a custom WooCommerce input field.

In WordPress, creating settings pages has its process. That is, you create the necessary options group (if needed), settings fields, values, and so on. You introduce any markup that’s needed, validation, sanitization, and so on.

And all of that is needed when it comes to working with WooCommerce, but one of the things that I like is how the API for the plugin supports creating input fields with server-side logic.

Creating a WooCommerce Input Field

Though this isn’t a complete example, it’s one that should give you enough information has to how to get started with it. I’ll talk more about documentation, sanitization, and so on later in the post.