Types of Custom Fields.
In Magic Fields, there are 12 types of “fields”. Below is a detailed explanation of each “field” and how to use them in WordPress.
Please note that the code used to display each “MagicField” must be inside one of the WordPress loops. E.g. In the default theme, “the_content();” is displayed within the “single.php” file – please see the image below:
Textbox.
Usage:
Return: String.
Multiline.
For this field, the same filters used for “the_content();” may be applied using “shortcode“. Please see the images below:
Usage:
Return: String.
Checkbox.
Usage:
if($value){ /*Something*/ }
Return: Bool.
Checkbox List
Usage :
foreach($my_list as $element){
echo $element;
}
Return: Array
DropDown List
Usage:
echo $my_option;
Return: String
ListBox
Usage:
foreach($my_list as $element){
echo $element;
}
Return: Array
Images
Usage:
/**
* With this method is returned the absolute url
* of the image
**/
get_image(‘field_name’);
/**is returned the image tag of html**/
Return: String
Date
Usage:
Return: String. (Return the date in the same format to was selected when was created the custom field, actually exists 8 differents formats of dates)
Audio
Usage:
/**
* With this method return
* the absolute url of the image
**/
echo get_audio(‘field_name’);
/**
*With this method return a flash player
* for the user can ear the song
**/
Color Picker
Usage:
Return : String (hexadecimal number of the Color )
Slider
Usage:
Return: String.









Gnuget (David V) is a Web developer since 2002 and nowadays working at



vt
16 Sep, 2009
There is no usage example for the file upload field. How does one display this field?
Gnuget
18 Sep, 2009
ups, i forget add this type of field…
the File field is almost the same of audio field, i will edit this tutorial for add it.
Thanks for the observation
vt
25 Sep, 2009
0k thanks. Would it also be possible to restrict the file type per field?
Example: I have a file field and I want only .zip files to be allowed for this particular field.
Kulpreet Singh
27 Sep, 2009
Please keep developing Magic Fields! How can I donate to you for your work?
hunk
28 Sep, 2009
hi Kulpreet Singh
we add a button for donation (paypal) if your donation is of another type us you can send an email
Manon
29 Sep, 2009
Your usage is mixed up, checkboxes, lists and dropdowns. It’s not working for me. It’s within the loop in single.php.
I added for my address text field. Not showing up in the post.
I’m using WP 2.8.4
Thanks for any help.
Manon
29 Sep, 2009
Sorry I meant I need to add checkbox list usage to my page template. And it’s not working.
jan
30 Sep, 2009
I’m switching from flutter to magicfields, thanks so much for your improvements! I’m still looking for one feature: how can I change the order of the GROUPS in my new write panel. They are ordered alphabetically and always above the normal fields. I want them in a special order ie. after the none group fields.
hunk
30 Sep, 2009
hi Jan.
at the moment that functionality does not exist but we considered that it is good idea and we will work to implement it
nr
1 Oct, 2009
how do you call all the entries of a field that can be duplicated, and is it possible to call a whole group at once?
hunk
2 Oct, 2009
hi nr
in order to show values of a repeated field you can make something like this http://gist.github.com/199569
I am going to create a function where it returns all the values to you of fields repeated
about the function that returns all the fields of a group,i am working in it, will publish tomorrow it (2-oct-09)
hunk
2 Oct, 2009
ok, the function to obtain the fields of group can find it here http://groups.google.com/group/magic-fields/browse_thread/thread/d30c648b5264d28
Doc4
3 Oct, 2009
I must have slipped a little. I wasn’t aware you had released a version of MagicFields. Congratulations and I look forward to trying it out. You’re already off to a great start with the instructions. Thanks for this.
nr
3 Oct, 2009
great, thanks!
Giraldi Maggio
3 Oct, 2009
Great plugin! Cool! Thanks!
Could you maybe add a ‘Video’ option for the types of field?
Cheers!
Giraldi Maggio
5 Oct, 2009
Or maybe a custom category/tag list?
hunk
5 Oct, 2009
Hi Giraldi
sound good, we will consider it
Thanks
Nathan
6 Oct, 2009
This looks like it is going to be fantastic – exactly what I am after. I’m really pleased that I stumbled across it!
Pete
11 Oct, 2009
Are the uploaded images associated with a post )using this plugin method) attached to that post just like Wp does normally? For example would the [gallery] shortcode work by displaying the images?
hunk
16 Oct, 2009
Hi Pete for show images use get_image(‘name_field’)