As per requirement, i need to create plugin with custom fields in the wordpress 3.0. I have a look at creating the plugins in wordpress. I can able to create the plugins with custom fields by hardcoded HTML fields code. Like providing input type name id etc.
But I need to create the fields like textbox, image upload, buttons using wordpress custom fields functions. Just calling the functions with type the field need to generate the fields. As like I already did in the drupal 7.
Below is the sample code for creating the text field in the drupal 7
$form['posts']['Title'] = array(
'#prefix' => '<div class="container-inline">',
'#required' => '1',
'#size' => '20',
'#type' => 'textfield',
'#title' => t('Title'),
'#suffix' => '</div>',
);
Is it possible in the wordpress?. Please guide me in the wordpress to create the custom plugins. Thanks in Advance…
Here a sample of code I’ve used to add custom field in my custom post type.
or you can use the plugin Advanced Custom Field to add custom field and attached them to your custom post type.
I hope this can help you !
You might also take a look at this plug-in: Advanced Custom Post Types.
“This is a framework for creating not only custom post types, roles and taxonomies in WordPress but it will also give you the ability to rapidly create custom fields (post types only).”
https://github.com/kevindees/advanced_custom_post_types