Skip to content

Additional WordPress validation rules #165

Open
@BenRutlandWeb

Description

@BenRutlandWeb

Is your feature request related to a problem? Please describe.
There are many WordPress specific reasons to validate user input, it would be nice to have some more validation rules in the framework core.

Describe the solution you'd like
Among other rules the following would be a nice addition:

  • EmailExists - determine if the email already exists: email_exists($email) !== false
  • UniqueEmail - determine if the email is unique: email_exists($email) === false
  • UsernameExists - determine if the username exists: username_exists($username) !== false
  • UniqueUsername - determine if the username is unique: username_exists($username) === false
  • IsUuid - is a valid UUID: Str::isUuid($uuid)
  • PostTypeExists - determine if the post type exists: post_type_exists($post_type)
  • TaxonomyExists - determine if the taxonomy exists: taxonomy_exists($taxonomy)
  • TermExists - determine if the term exists: (bool) term_exists($term)

Describe alternatives you've considered
I can create custom rules but this is repetitive for multiple projects.

Additional context
There are probably more useful rules, and perhaps the Exists and Unique rules can be made reusable instead of strictly for the email/username

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions