Nmwdhj
Add to ListImportant Notes:
- This plugin requires at least PHP 5.3.x .
- 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:
Nmwdhjcreate_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:
Nmwdhjcreate_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.