This feature is only available in Piklist v0.9.9.x.
With Piklist, you can easily create your own fields to use in your projects.
- First determine if you want to register your field with a Piklist plugin, or in your theme.
- Create the proper folder structure in your plugin or theme.
- Create a file in the /fields/ folder. Any files in this folder can become fields automatically registered with Piklist. The name of your file is important since it will become the name of your field. For demonstration purposes we’ll create our own checkbox field and call it “my-checkbox”, so the file name is “my-checkbox.php”.
- Depending on the type of field you want to create, you may want to copy/paste from an existing Piklist field. For this demo, we are going to open the default Piklist checkbox file, piklist/parts/fields/checkbox.php, copy everything and paste it into my-checkbox.php.
- Make any changes to this field you like, and you’re done!
When using your new checkbox, use the type “my-checkbox. It should look like this:
1 2 3 4 5 6 7 8 9 10
piklist('field', array( 'type' => 'my-checkbox' ,'field' => 'custom-checkbox' ,'label' => 'Select' ,'choices' => array( 'first' => 'First Choice' ,'second' => 'Second Choice' ,'third' => 'Third Choice' ) ));