Wodrpress Plugin Magic Fields

Magic Fields: The Magic Wordpress Plugin

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:

single

Textbox.

Textbox


Usage:

echo get(‘field_name’);

Return:  String.

Multiline.

For this field, the same filters used for “the_content();” may be applied using “shortcode“. Please see the images below:

multiline

shortcode

Usage:

echo get(‘field_name’);

Return: String.

Checkbox.

checkbox

Usage:

$value = get('field_name');

if($value){  /*Something*/ }

Return: Bool.

Checkbox List

check_box_list

Usage :

$my_list = get(‘field_name’);

foreach($my_list as $element){

echo   $element;

}

Return: Array

DropDown List

check_box_list

Usage:

$my_option = get(‘checkbox’);

echo  $my_option;

Return: String

ListBox

Add New Post ‹ Magic Fields — WordPress

Usage:

$my_list = get(‘field_name’);

foreach($my_list as $element){

echo   $element;

}

Return: Array

Images

image-1

Usage:

$my_image_url = get(‘field_name’);

/**

* 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

date2

date

Usage:

$my_date = get(‘field_name’);

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

Audio

Usage:

$mp3_url = get(‘field_name’);

/**

* 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

color_picker1

colorpicker2

Usage:

$color = get(‘field_name’);

Return : String  (hexadecimal number of the Color )

Slider

slider

Usage:

$value = get(‘field_name’);

Return: String.

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • BarraPunto
  • LinkedIn
  • Meneame
  • Reddit
  • Slashdot
  • Tumblr
  • There is no usage example for the file upload field. How does one display this field?

  • 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

  • 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.

  • Please keep developing Magic Fields! How can I donate to you for your work?

  • hi Kulpreet Singh

    we add a button for donation (paypal) if your donation is of another type us you can send an email

  • 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.

  • Sorry I meant I need to add checkbox list usage to my page template. And it’s not working.

  • 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.

  • 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

  • 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?

  • 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)

  • ok, the function to obtain the fields of group can find it here http://groups.google.com/group/magic-fields/browse_thread/thread/d30c648b5264d28

  • 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.

  • great, thanks!

  • Great plugin! Cool! Thanks!

    Could you maybe add a ‘Video’ option for the types of field?

    Cheers!

  • Or maybe a custom category/tag list?

  • Hi Giraldi

    sound good, we will consider it

    Thanks

  • This looks like it is going to be fantastic – exactly what I am after. I’m really pleased that I stumbled across it!

  • 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?

  • Hi Pete for show images use get_image(‘name_field’)

You can follow any responses to this entry through the RSS 2.0 feed.

Trackbacks / Pingbacks