chrico/wp-fields

Package which provides some re-usable fields for WordPress.

2.3.2 2023-09-25 14:48 UTC

This package is auto-updated.

Last update: 2024-04-12 14:58:16 UTC


README

ChriCo WP-Fields is a library (not a plugin) that allows to generate form fields in WordPress.

Minimum requirements and dependencies

ChriCo Fields requires:

  • PHP 8+
  • WordPress latest - 0.1
  • Composer to be installed

When installed for development, via Composer, ChriCo Fields also requires:

  • "phpunit/phpunit"
  • "brain/monkey"

Docs

Documentation can be found in docs/.

Frequently Asked Questions

Why are you not just using existing packages like the Symfony Forms or Zend Form?

That's a good question! As already mentioned above, WordPress has different pages and scenarios where to use form fields. Both packages are excellent and I worked a lot with them in past.

But: They need a ton of dependencies.

As example, if you're going to use Symfony Forms, you've to use other Symfony Packages like Event Dispatcher, Intl, Options Resolver, Property Access. And that's not all, if you're serious, you'll probably end up using as well Symfony Validation, Symfony CSRF, Twig. And that's the whole point..when we load half of Symfony and we're not far away from including Doctrine as well...why do we still use WordPress?

What about WordPress Field-Plugins like Advanced Custom Fields?

I guess you're wrong here. ;-)

What about the upcoming WordPress Fields API?

Nothing. There's a lot of weird and quirky code in it. No interfaces, no real abstraction, no strict return types, PHP 5.2, missing Unit Tests, ... the list is endless, so i'll stop here.

In fact, the API will eventually appear in WordPress in near - or far - future. But until then, everything is fine. If the API is really released, I'll adapt this code to fit on top of the Fields API.

License

Copyright (c) since 1987 ChriCo.

ChriCo Fields code is licensed under GNU General Public License v3.0.

   _____ _          _  _____      
  / ____| |        (_)/ ____|     
 | |    | |__  _ __ _| |     ___  
 | |    | '_ \| '__| | |    / _ \ 
 | |____| | | | |  | | |___| (_) |
  \_____|_| |_|_|  |_|\_____\___/