$fields = array( $ fields = array( 'First Name' => array(
'名字'=> array(
'name' => 'first_name',
'名称'=>'名字_',
'type' => 'text',
'类型'=>'文本',
'id' => 'first_name',
'id'=>'first_name',
'class' => '',
'class'=>'',
'minlength' => 1,
'minlength'=> 1,
'maxlength' => 50,
'maxlength'=> 50,
'placeholder' => 'First Name',
'占位符'=>'名字',
'required' => true
'必需'=> true
),
),
'Last Name' => array(
'姓氏'=>数组(
'name' => 'last_name',
'名称'=>'姓氏',
'type' => 'text',
'类型'=>'文本',
'id' => 'last_name',
'id'=>'姓氏',
'class' => '',
'class'=>'',
'minlength' => 1,
'minlength'=> 1,
'maxlength' => 50,
'maxlength'=> 50,
'placeholder' => 'Last Name',
'占位符'=>'姓氏',
'required' => true
'必需'=> true
),
),
'Username' => array(
'用户名'=>数组(
'name' => 'user_login',
'名称'=>'用户登录',
'type' => 'text',
'类型'=>'文本',
'id' => 'user_login',
'id'=>'user_login',
'class' => '',
'class'=>'',
'minlength' => 1,
'minlength'=> 1,
'maxlength' => 50,
'maxlength'=> 50,
'placeholder' => 'User Login',
'占位符'=>'用户登录名',
'rows' => '',
'行'=>'',
'cols' => '',
'cols'=>'',
'required' => true
'必需'=> true
),
),
'Password' => array(
'密码'=>数组(
'name' => 'user_pass',
'名称'=>'用户密码',
'type' => 'password',
'类型'=>'密码',
'id' => 'user_pass',
'id'=>'user_pass',
'class' => '',
'class'=>'',
'minlength' => 1,
'minlength'=> 1,
'maxlength' => 50,
'maxlength'=> 50,
'placeholder' => 'Password',
'占位符'=>'密码',
'rows' => '',
'行'=>'',
'cols' => '',
'cols'=>'',
'required' => true
'必需'=> true
),
),
'Email Address' => array(
'电子邮件地址'=> array(
'name' => 'user_email',
'名称'=>'用户_电子邮件',
'type' => 'email',
'类型'=>'电子邮件',
'id' => 'user_email',
'id'=>'user_email',
'class' => '',
'class'=>'',
'minlength' => 1,
'minlength'=> 1,
'maxlength' => 50,
'maxlength'=> 50,
'placeholder' => 'jon@mail.com',
'占位符'=>'jon@mail.com',
'required' => false
'必需'=>否
),
),
'Options' => array(
'选项'=>数组(
'name' => 'favorite_fruit',
'名称'=>'收藏夹水果',
'type' => 'select',
'类型'=>'选择',
'id' => 'favorite_fruit',
'id'=>'favorite_fruit',
'class' => '',
'class'=>'',
'options' => array( 'apple', 'cherry', 'pear' ),
'options'=> array('apple','cherry','pear'),
'required' => false
'必需'=>否
),
),
'Gender' => array(
'性别'=>数组(
'name' => 'gender',
'名称'=>'性别',
'type' => 'radio',
'type'=>'radio',
'id' => 'gender',
'id'=>'性别',
'class' => '',
'class'=>'',
'value' => array( 'male', 'female' ),
'value'=> array('male','female'),
'required' => false
'必需'=>否
),
),
'Bio' => array(
'生物'=>数组(
'name' => 'description',
'名称'=>'描述',
'type' => 'textarea',
'type'=>'textarea',
'id' => 'description',
'id'=>'描述',
'class' => '',
'class'=>'',
'minlength' => 1,
'minlength'=> 1,
'maxlength' => 500,
'maxlength'=> 500,
'placeholder' => 'Add your bio',
'占位符'=>'添加您的生物',
'rows' => 5,
'行'=> 5,
'cols' => 50,
'cols'=> 50,
'required' => false
'必需'=>否
)
)
);
);
$form = new CWRF_Form( 'Test Form', $fields, 'Sign Up!' );
$ form = new CWRF_Form('Test Form',$ fields,'Sign Up!');
code> pre>
C.
C。
Note, the array values that match the WordPress syntax for insertion to the default WordPress profile page in the admin panel.
请注意,与WordPress语法匹配的数组值可插入到管理面板中的默认WordPress配置文件页面。
When you don’t use this syntax, values will be added below the premade profile meta section.
如果您不使用此语法,则会将值添加到预制的配置文件元部分下方。
Refer to screenshots to see how this form is rendered in the default WordPress user profile page.
请参阅屏幕截图,以查看如何在默认的WordPress用户个人资料页面中呈现此表单。 p>
D.
D。
Form is set to method = 'POST'
表单设置为 method ='POST' code> p> li>
ol>