PHPackages                             frozzare/wp-forms - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. frozzare/wp-forms

ActiveWordpress-plugin

frozzare/wp-forms
=================

Create forms in using code in WordPress

113.0k2[3 issues](https://github.com/frozzare/wp-forms/issues)PHP

Since Aug 23Pushed 8y ago1 watchersCompare

[ Source](https://github.com/frozzare/wp-forms)[ Packagist](https://packagist.org/packages/frozzare/wp-forms)[ RSS](/packages/frozzare-wp-forms/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Forms [![Build Status](https://camo.githubusercontent.com/614d5c721bed29e3e8c180e3fa3bcadc4d2d825e8394a5c1c200e0c591aa1b5e/68747470733a2f2f7472617669732d63692e6f72672f66726f7a7a6172652f77702d666f726d732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/frozzare/wp-forms)
========================================================================================================================================================================================================================================================================================

[](#forms-)

> Requires PHP 5.6 and WordPress 4.3

Create forms in using code in WordPress.

Installation
------------

[](#installation)

```
composer require frozzare/wp-forms

```

Example
-------

[](#example)

```
// Add custom field.
forms()
    ->add_field( 'custom', function ( $attributes ) {
        return sprintf( '', $attributes['name'] );
    } );

// Add form.
forms()
    ->add( 'contact', [
        'name'  => [
            'label' => 'Name',
            'rules' => 'required|max:250'
        ],
        'email'  => [
            'label' => 'Email',
            'type'  => 'email',
            'rules' => 'required|email'
        ],
        'custom' => [
            'label' => 'Custom',
            'type'  => 'custom'
        ],
        'text'   => [
            'label' => 'Text',
            'type'  => 'textarea'
        ],
        'color'  => [
            'label' => 'Select color',
            'type'  => 'select',
            'items' => [
                [
                    'text'  => 'Blue',
                    'value' => 'blue',
                ],
                [
                    'text'  => 'Green',
                    'value' => 'green'
                ]
            ]
        ]
    ] )
    ->button( 'Send' )
    ->save( function ( array $data ) {
        // Do something with the data...

        // Return true if you will save or email the data yourself
        // otherwise false to save in forms data post type.
        return false;
    } );

// Get errors.
$errors = forms()->errors( 'contact ');

// Render form.
forms()
    ->render( 'contact' );
```

Save form with ajax
-------------------

[](#save-form-with-ajax)

Example

```
$('.form-submit').on('click', function (e) {
    e.preventDefault();

    $.post('/forms-ajax/?action=save&form=contact', $('form').serialize(), function (res) {
        // res.success is true or false
        // res.errors contains all errors if any.
    });
});
```

Validation rules
----------------

[](#validation-rules)

```
alpha, alpha_num, array, between, bool, digit, email, float, int,
ip, min, max, numeric, required, size, string, url

```

Contributing
------------

[](#contributing)

Everyone is welcome to contribute with patches, bug-fixes and new features.

License
-------

[](#license)

MIT © [Fredrik Forsmo](https://github.com/frozzare)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/aacdbaebed26ea1ccdb7e37e2bfd2a572350e1d781d1c0b8830d444adb86104e?d=identicon)[frozzare](/maintainers/frozzare)

---

Top Contributors

[![frozzare](https://avatars.githubusercontent.com/u/14610?v=4)](https://github.com/frozzare "frozzare (83 commits)")

### Embed Badge

![Health badge](/badges/frozzare-wp-forms/health.svg)

```
[![Health](https://phpackages.com/badges/frozzare-wp-forms/health.svg)](https://phpackages.com/packages/frozzare-wp-forms)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
