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



hunk
2 May, 2010
Hi francesco check the wiki http://wiki.magicfields.org/doku.php?id=es:type_of_custom_fields#radiobutton_list
Andrew
7 May, 2010
is there anyway to echo the value from a listbox option, i don’t want to echo the string, what’s the point of the value anyway? I set the values for each list option as (file name).swf and would like the user to be able to choose one from the list but i don’t want it to say the filename as an option.
hunk
7 May, 2010
Hi Andrew check the wiki http://wiki.magicfields.org/doku.php?id=es:type_of_custom_fields#listbox
nzahn
25 Aug, 2010
Great upgrade (1.4.5), finally we have Media upload, but how can we call it? Is it the same then the other get_image call? or does it have something special?