WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Nmwdhj

Nmwdhj is an API for creating forms elements via code.

Important Notes:

  1. This plugin requires at least PHP 5.3.x .
  2. This plugin is for developers, not general users.

Nmwdhj is an API for creating, editing and rendering forms programmatically. This plugin doesn't have a GUI, It's only a helper library for the PHP & WP developers.

You can use this plugin to create individual form elements in the meta boxes, front-end, or anything else you might want a form for.

Basic Examples

You can use this plugin in many ways depending on your needs, this examples only for learning purposes:

  • Simple WordPress Search Form:
Nmwdhj\create_element( array(
    'type'  => 'form',
    'atts'  => array(
        'method'    => 'GET',
        'role'      => 'search',
        'action'    => home_url( '/' ),
    ),
    'elements'  => array(
        'search' => array(
            'name'  => 's',
            'type'  => 'input_search',
            'value' => get_search_query(),
            'atts'  => array(
                'placeholder'   => _x( 'Search this site...', 'placeholder' ),
                'class'         => 'search-text',
                'required'      => true,
            ),
        ),
        'submit' => array(
            'type'  => 'input_submit',
            'value' => __( 'Search' ),
        ),
    ),
) )->output();
  • Simple Login Form:
Nmwdhj\create_element( array(
    'type'  => 'form',
    'atts'  => array(
        'method' => 'POST',
    ),
) )
->add( array(
    'name'  => 'user_name',
    'type'  => 'input_text',
    'label' => __( 'User Name' ),
) )
->add( array(
    'name'  => 'user_pass',
    'type'  => 'input_password',
    'label' => __( 'Password' ),
) )
->add( array(
    'name'  => 'user_submit',
    'type'  => 'input_submit',
    'value' => __( 'Submit' ),
) )
->output();

Contributing

Developers can contribute to the source code on the Nmwdhj GitHub Repository.

Requires: 3.1 or higher
Compatible up to: 3.8.3
Last Updated: 2014-8-13
Downloads: 314

Ratings

5 stars
5 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1 100,1,1
100,1,1
100,1,1 100,1,1
100,1,1
100,1,1
100,1,1
100,1,1