More Fields

This Wordpress plugin is a flexible solution to adding additional fields to a post. Any number of boxes can be created on the Write/Edit page, which hold additional fields that are to be associated with a post. These additional fields are stored as a posts Custom Fields.

A box is one of the elements that appers on the Write/Edit page, either on the larger left column, or the narrower right column. This plugins adds any number of boxes, with any type of field, either to the right,
or the left on that page.

This plugin can be downloaded from here:
http://wordpress.org/extend/plugins/more-fields/

Table of contents

1. Options -> More Fields

The required boxes are set up in Options->More Fields.

Description of fields:

  • Title of box - This is the title at the top of a box - appearing on the blue background on the Write/Edit page. This title is also used when accessing the content of a box in a template.
  • Settings:
    • Position- sets the position of the box in either the left, or the right column. If positioned on the left, the box will be much larger than if positioned on the right. Having it positioned on the left is more appropriate when having textareas that are to contain lots of text.
    • Include this box on the Write/Edit page - toggles whether or not this box is shown on the Write/Edit page.
    • Include this box on the Write/Edit post - toggles whether or not this box is shown on the Write/Edit post.
    • Delete this box - Removes this box from from the Options page and the Write/Edit page. The box will no longer be shown using the template function get_box(); . The settings must be saved (Update Settings) for the box to be removed.
  • Key - This field is required. It is the name of the Custom Field that is created for this field. Using this key, a field can be echoed in a template using e.g. meta(key);.
  • Title - Sets the title for the field. This value is optional, which might be handy when creating a box with only one field, such that the title of the field really is the title of the box.
  • Type - This sets the input type of the field. The following types of options are available:
    • Text - the default type of a one line textfield is created by leaving the Options field empty.
    • Textarea - This creates a multi-line textarea.
    • Checkbox - This create a checkbox which has the value of ‘on’ when it’s ticked, and does not have any value when it’s not ticked.
    • Select list - Creates a select list from the comma separated values entered in the box that appears on the second line.

Using the controls to the right of the field, it can be moved up or down in the list. The order that the fields appear in on this page is the order that they are returned.

1.1 Creating select lists

The values of a select list are entered, separated by commas, in the field that appears under the Key, Title and Type fields, when the ‘Select list’ option is selected.

Examples:

  1. ‘one, two, three’ creates a select list with the options of ‘one’, ‘two’ and ‘three’.
  2. ‘one, *two, three’ creates a select list with the options of ‘one’, ‘two’ and ‘three’, where ‘two’ is selected by default.
  3. ‘0:5′ creates a select list with options 0, 1, 2, 3, 4 and 5.
  4. ‘2008:1978′ creates an descending select list with 30 options, starting at 2008 down to 1978.

2. Template functions

There are currently two template functions supplied in this plugin.

  1. meta($key) - echoes the Custom Field with key $key.
  2. $var = get_meta($key) - returns the Custom Field with key $key.
  3. The more_fields action, prints out the entire content of a box.

3. Examples

3.1 Example one: Employee/member information

If you have company or organization and wisely opted for using Wordpress as the CMS, then you could create a page per employee/member (if you have a reason for doing so — this is mere conjecture). Say you want to create pages for this (as opposed to a post), one page per person.On the Write->New Post page, a section similar to this could be added:

em_admin.jpg

This is created the following way in Options->MoreFields:

More Fields Example 1

Note that the Position Left tickbox is checked and that the Show in Post Write/Edit is unticked. This box will only appear when adding or editing a Page.If you want to display only the biography in a page template:

<?php meta('ci_bio'); ?>

And you can store the value of the custom field to a variable using get_meta, e.g.:

<?php
  if ($bio = wptexturize(get_meta('ci_bio')))
  echo 'Resume: ' . $bio;
?>

Or to display this information as a ‘ul’ list with a ‘h3′ header inside a div called ‘employee_info’:

<?php
   $options = array('div' => 'employee_info');
   do_action('more_fields', 'Employee info', $options);
?>

If you still only want to display the bio, use the ’show’ keyword in the options.

<?php
   $options = array('div' => 'employee_info', 'show' => 'ci_bio');
   do_action('more_fields', 'Employee info', $options);
?>

Or, to only show the name and the position id a ‘dl/dt/dd’ list, with a ‘h3′ header:

<?php
   $options = array('div' => 'employee_info', 'format' => 'dl', 'show' => array('ci_name', 'ci_position'));
   do_action('more_fields', 'Employee info', $options);
?>

3.2 Example two: Geocaching/Geographical information

If you are a member of the geocaching community, then a blog post about a specific hunt for a geocache would require additional fields for latitude and longitude. On the admin page, something like this can be created:

More Fields Example: Geocaching

On the Options->More fields page, this is created in the following way:

More Fields Example 2

This can then be printed in a template as a dl/dt/dd list, inside a div called ‘geocaching’, by calling the following:

<?php
   $options = array('format'=>'dl', 'div'=>'geocaching');
   do_action('more_fields', 'Geocaching', $options);
?>

If you want to create a link to google maps (other brilliant map services are available, like Multimap)

<a href="http://maps.google.com/?ll=<?php meta('gc_latitude'); ?>,<?php meta('gc_longitude'); ?>">Google Maps</a>

The key that I’m supplying to the meta function is the key that i specify in the More Fields Options.

3.3 Example three: Wine blog

Say you’re writing about wine - and we all love wine, right? Additional information about the bottle of wine that is being written about will add value to the post - information such as grape, winery, and perhaps a score. One could construct a box in the admin like this:

wine_admin.jpg

I’ve filled it in just highlight that we’re creating selects. The setup in the More Fields Admin looks like this:

More Fields Example 3

Note that the Year range runs from 2007 to 1970 such that 2007 is listed first. The Score is a select between 1 and 10.

To retrieve the specifics about a wine reviewed in a post:

 <?php do_action('more_fields', 'Wine');?>

Or, to create a link to a page with one of the fields a as a parameters:

<a href="http://en.wikipedia.org/wiki/<?php meta('wine_type'); ?>">Wikipedia</a>

This method can be useful creating links for an affiliate program (e.g. Amazon Affiliate Program), generating revenue for your site. These affiliate links often include a search term, which could make the link relevant for your post.

3.4 Example four: Post specific CSS

By inserting CSS in the head of your templates you can alter the design of your Wordpress site on a post by post basis.

To create a field on the Write/Edit page where this can be inserted, configure More Fields in the following way

More Fields Example 4

Then, within the <head> tag of of your templates, insert this code:

<?php meta('extra_css'); ?>

For examples of this in use see this special on disco, compared to the normal look of the site.

4. Advanced use

4.1 Adding boxes programatically

You can add boxes in your own plugins programatically, in your own plugins. This might be useful if you’re installing large numbers of idential WP installations.

If you want to create the Wine box, in the example above, from within another plugin:

$fields = array(
  array('key' => 'wine_name', 'title' => 'Name', 'type' => 'text'),
  array('key' => 'wine_year', 'title' => 'Year', 'type' => 'select', 'select_values' => '2008:1970'),
  array('key' => 'wine_grape', 'title' => 'Grape', 'type' => 'select', 'select_values' => 'Merlot, Syrah, Pinot Noir'),
  array('key' => 'wine_score', 'title' => 'Score', 'type' => 'select', 'select_values' => '0:10')
);

mf_add_meta_box('Wine', $fields, array('post', 'page'), 'right');

The first parameter of mf_add_meta_box is the title of the box, the second is the fields, the third is on what Write/Edit page the box appears (may be ‘post’, ‘page’, or array(’post’, ‘page’)) and the fourth parameter is where to place the box. mf_add_meta_box must be called when the plugins have been loaded.

4.2 Actions & Filters

Filters:

  • mf_box - Filters the $box variable, holding the information required to build a box.
  • mf_field - Filters the variable that holds the information about a particular field.

Actions:

  • mf_box_head - Action at the beginning of a box, after the box itself has been drawn.
  • mf_box_foot - Action at the end of a box.

Adding stuff at the top of boxes

More Fields provides an action: mf_box_head when the plugin enters the building of the content of a box, i.e. after the head with the title is built. You can use this to insert html, like special fields, e.g. based on the content of the post. The simple example below adds an image at the top of the box, specified in a url set in a More Fields box called ‘Mugshot’.

function add_mugshot_picture($box) {
  global $post;
  if ($box['name'] == 'Mugshot') {
    if ($url = get_post_meta($post->ID, 'mugshot', true))
      echo "<img src='$url'>";
  }
}
add_action('mf_box_head', 'add_mugshot_picture');

4.3 Box visibility based on user-level

The ‘mf_create_box_bool’ and ‘mf_create_field_bool’ can be used to restrict the visibility an entire box, or a field, or fields, within a box.

The following plugin will disallow anyone who does not have admin access to WordPress to see a box called ‘Secrets’ and hide a field with the key ‘artist’.

<?php
/*
Plugin Name: MMF: User Level Example
Plugin URI: http://labs.dagensskiva.com/
Description: Modify More Fields: Showing boxes based on User Level
Version: 0.1
Author: Henrik Melin
*/

// Hide the 'Secrets' box
function restrict_access_to_box($box) {
  $user = wp_get_current_user();
  if ($box['name'] == 'Secrets') {
    if ($user->user_level < 10) return false;
  }
  return $box;
}

add_filter('mf_box', 'restrict_access_to_box', 11);

// Hide the field with 'artist' as the key
function restrict_access_to_field($field) {
  $user = wp_get_current_user();
  if ($field['key'] == 'artist') {
    if ($user->user_level < 10) return false;
  }
  return $field;
}

add_filter('mf_field', 'restrict_access_to_field', 11);
?>

Note that the term restriction might be a little misleading - the fields that make up a box can always be accessed in the ‘Custom Fields’ panel. All this does is removing the More Fields box from the Write/Edit page for a particular group of users. Still, might be something you’d want to do.

5. Language support

The .po file for the plugin can be found in its directory. Name compiled .mo files as e.g. p2m-more-fiels-sv_SE.mo where ’sv_SE’ is the language domain (here Swedish), and place in the same directory as the rest of the plugin files.

As of yet, the plugin is only translated from English into shoddy Swedish.

6. License

The More Fields Wordpress plugin is relased under GPL, and the following license can be found in the header of more-fields.php.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.You should have received a copy of the GNU General Public License along with this program. If not, see

The comments for the older version of More Fields have been found on this page.

112 Comments to “More Fields”

  1. links for 2008-04-01 at dpwolf/blog Says:

    […] labs.dagensskiva.com » More Fields This Wordpress plugin is a flexible solution to adding additional fields to a post. Any number of boxes can be created on the Write/Edit page, which hold additional fields that are to be associated with a post. These additional fields are stored as a post (tags: WordPress CMS custom fields plugin metadata) […]

  2. Peter Watts Says:

    It has arrived! Thanks for this. Can’t wait to try it out.

  3. Peter Watts Says:

    By the way Henrik, your support has been incredible (special thanks for the box visibility plugin!). I will most certainly be donating once my project gets out of the red :)

  4. Askhari Says:

    first of all, this plugin is great. It is exactly what I was looking for, thank you very very much for sharing!
    Yet I’ve experienced some problems with wordpress 2.5 on a xampp-Installation - I can’t add boxes or fields, the links just return “#” in the adress - could the problem linked with another plugin?

    thx, K.

  5. Whisper Says:

    Henrik thank you for your hard work. Developing a plugin is one thing, but keeping up on support and upgrades is invaluable. Thank you so much.

    Just wanted to weigh in on Askhari’s problem I am having the same troubles. I can’t attribute it to other plugins cause I have nothing else installed other than Maintenance Mode, but even after disabling that it’s still not letting me add boxes or fields.

    I’ll take a look and see what I can find and let you know if I find anything that can help.

  6. Henrik Melin Says:

    Whisper & Askhari: I think I’ve found the problem, having some cross version compatibility issues, sorry about that. Seems like the JavaScript isn’t loading properly. I’ve updated the version held at Wordpress.org, try it out and see if it resolves this problem.

    Is anyhone having problems using translations other than English? Caused me some trouble earlier.

    Also, thanks Kristof.

  7. Whisper Says:

    Deleted / disabled plugin, uploaded / activated new one. Still having the same problem. Firebug says ‘mf_add_field is not defined’

  8. Henrik Melin Says:

    Whisper: Yeah, that’s the javascript file not loading properly.

    Oops. I seem not to have updated SVN properly. When the ‘Last Updated’ field reads first of April, then it should be updated. Otherwise you can go to ‘Other versions’ and download the development version (or 0.6.1). There is a lag of about half an hour between the SVN repository and the Wordpress page for More-Fields.

  9. Henrik Melin Says:

    Actually, there was no delay, just me doing it wrong… ;)

  10. Whisper Says:

    Yeah thats the one I grabbed it’s still doing it. Although adding that one did make the CSS load properly.

    I’m looking too, but your probably way better at this lol. Take your time don’t let my comments make you feel rushed :D

  11. Henrik Melin Says:

    OK - what WP version are you using? The new version seems to be working here on a 2.5 and 2.3.2 installation.

    Soon enough, we’ll get it working…

  12. Whisper Says:

    lol… 2.5 tested this also in IE, FF, and Safari. I’m using a sub-domain so just for kicks I tested in the main domain and it still is acting the same way. The sub-domain is where I test things before I put them in action so if you want to send me an email I can send you log in info so you can check it out if it helps.

  13. Whisper Says:

    Scratch that. It works in Safari. Does that help?

  14. Henrik Melin Says:

    Well, that’s good. I suggest you use Safari from now on… :)

    Could the js script of the older version of More Fields be cached in IE/FF? I’ve only tried running it on a mac (FF/Safari).

    In the source on the Settings page page, do you see this filename ‘more-fields/more-fields-js.php’ being imported in the header (in a script tag)?

  15. Whisper Says:

    Yeah thats what I’m gonna do for now. Safari is always my alternate anyway. I use FF and I have the cache pretty much disabled cause it always seems to get in the way.

    The file being imported is ‘more-fields/more-fields-js.php?ver=7558′ same as whats showing in Safari. Maybe a little piece of javascript that FF doesn’t like?

  16. Henrik Melin Says:

    Does Firebug give you any errors after loading the page, before you start to add fields or boxes? If you load the address of the more-fields-js file, do you get any errors?

  17. Whisper Says:

    Nope no errors when the page loads, nothing till you click either of those links. and then it gives me this error

    mf_add_field is not defined
    http://mydomain.org/wp-admin/options-general.php?page=more-fields.php
    Line 1

    onclick(click clientX=0, clientY=0)

    I’m not a wiz with Javascript, but I did look at what I have and the source code is coming out exactly the same in the file and even in the -js.php file as compared with what Safari is getting. So other than a conflicted bit of code that FF just doesn’t like (which would go beyond my knowledge of js) I can’t see anything physically missing/different between the two.

  18. Whisper Says:

    OK I checked one more thing (forgive me I’m not fully fluent in Safari) I opened the error console in Safari and there is a warning in there

    Resource interpreted as script but transferred with MIME type text/html.
    http://mydomain.org/wp-content/plugins/more-fields/more-fields-js.php?ver=7558

    I noticed this in Firefox at one point too but cannot seem to duplicate it.

  19. Henrik Melin Says:

    Whisper: Great, thanks for the details.

    So, another day, another version. More Fields 0.6.2 is now on the WordPress server. I don’t know if this will help you, but the MIME error is now fixed, along with some script loading issues.

  20. WordPress 2.5 : Broken Plugins at STCFX - Web Everything Says:

    […] More Fields 0.5: Plugin admin panel works, but doesn’t add anything to the Write/Edit pages […]

  21. Whisper Says:

    Well Henrik I think you did it. For my bug at least it’s fixed. Thank you so much I’m sorry I was such a pest :P Your support will not go unrecognized.

    Just thought I would let you know I’m using your plugin to help make it possible for a rescue group to post their available adoptions. I will have it ready and working in the next 24hrs. So if your looking for more examples of the use of this plugin just let me know http://www.felinefriendz.org

    Thank you again so much,
    Sabrina Jo

  22. Peter Watts Says:

    Hi Henrik. My custom field boxes don’t seem to be appearing on the left. They exist and all the data is there, but they don’t pop up on the write/edit page. Is this just me!? I am also yet to reinstall most of my plugins so it is unlikely that it’s due to a clash. Any ideas?

    Regards,

    Peter

  23. Whisper Says:

    *blush* I just ran into this too. Around line 540 in more-fields.php it looks like ‘function mf_build_left_boxes()’ has been commented out. I removed the comments and re-uploaded it and it’s all working fine now. The box shows and works, and I can still add fields on the options page.

    Not sure if Henrik had a reason for commenting it out though.

  24. Henrik Melin Says:

    Peter: Sorry, my bad. 0.6.3 fixes this. I hope. Let me know if it doesn’t.

    Whisper: I commented that out because WP now has an internal function for creating the left boxes. I’m still having to ‘make’ the right boxes. The reason why it didn’t work in 0.6.2 was that the internal function wasn’t called properly, which was a silly error on my part.

  25. Whisper Says:

    ;) those are allowed. Just don’t make a habit of it *lol*

    Just one other thing I noticed. More of an annoyance than a bug. (I’m right back to being a pain again :P )

    Entering data into the fields on the write page works fine, but when I go in to edit a post with the custom fields already filled I have to reselect the data in any field that uses a select box. If I do not re-select, upon saving my edited post/page it changes the data for those custom fields (be it blank or default value (*)). So the existing data is not being carried into the select fields when I edit a post. Make sense?

  26. Henrik Melin Says:

    More Fields 0.6.4

  27. Kel Says:

    I’m having a similar data/field issue. Entering something like dimensions using the inch mark (e.g. 18″ x 19″ ) is OK on initial entry, however editing the post entry again shows the data in the More Fields input box getting truncated to just 18 (instead of 18″ x 19″) The data still shows up once in the default WP Custom Fields area. Further editing causes the data to be completely lost. Using WP2.5.

  28. Henrik Melin Says:

    Kel: 0.6.5 tries to solve your issue, should be up on wordpress.org shortly. Dealing with quotes and other entities that aren’t xhtml compliant is always tricky.

    Whisper: With the latest version, how are things working?

  29. Kel Says:

    Thanks Henrik - FYI… http://wordpress.org/support/topic/165340

  30. Kel Says:

    HAH! 0.6.5 Works indeed!!! Thank you.

  31. Henrik Melin Says:

    Kel: Great! That is what I like to hear… :)

  32. Whisper Says:

    It’s working great Henrik *thumbs* Thank you again for your wonderfull support. As soon as I can I will send a donation to help keep your snacks cupboard full :)

  33. Nikna Says:

    Hi,

    Thanks for a great plugin. Is there a way to not print any entry, if there is no entry on a field?

  34. Mosey Says:

    Wow, I’ve been looking for something like this since Custom Write Panel stopped being developed. Thank you! :D

    p/s: CWP created a ‘new’ write panel which had custom fields (in addition to the usual form fields) so one could potentially create several for different things e.g. CD Collection, Events etc. Is this sort of thing potentially planned or considered for More Fields at all? I can only imagine it would make it much and possible far too complicated though. Thanks.

  35. Askhari/Kristof Says:

    Sorry, I was in a rush when I commented and posted with the “Askhari”-nickname ;)

  36. WP Plugin Archive » More Fields Says:

    […] dem Plugin More Fields von Henrik Melin ist können einem Beitrag im Editbereich zusätzliche Felder […]

  37. Stephen R Says:

    It would be just lovely if it supported a check box that puts a simple true/false value in the field.

    Overall, a nice effort. Good replacement for a particular dead plugin which shall not be named.

  38. Peter Watts Says:

    Just a (very) small thing that I thought I’d bring up. When the edit boxes are expanded and collapsed such that the right column is bigger than the left, the bottom box touches the footer, rather than leaving a nice gap. Told you it was small, and I couldn’t care less if it was fixed, but I thought I’d mention it for the sake of keeping the plugin up to its exceptionally high standards.

  39. Henrik Melin Says:

    Ok I’ve upgraded More Fields to include a checkbox option, for those who want it. I agree that it’d be brilliant to implement custom Write/Edit pages. I’ll have to see if I get the time…

    Peter Watts: Thanks for spotting that. It’s on the to-do list…

  40. Macrike Says:

    Really impressive plugin. I must say it has just turned into my fav plugin for WordPress, along with HeadSpace2.

    This really does improve the potentiol of WordPress as a CMS, and save a lot of time when posting new content.

    I must say, thank you for creating such a wonderful plugin and keep up the good work. It’s awesome!

  41. David Wolf Says:

    Hi Henrik,

    Thanks for the excellent plugin!

    I have been using it to add fields for video and image urls to posts, creating a variety of wordpress based video content management systems: videodefunct.net & The Guild.

    Previously I had been using custom field gui. One feature which the other plugin had which would be cool to see in More Fields is the ability to pre-populate the box and field definitions. Is there a straightforward way to do this via an additional plugin (like the action and filter examples above)? Ideally I’d like to be able to set up new blogs with a pre-defined set of boxes+fields without having the users manually enter the keys. Thanks again.

  42. Henrik Melin Says:

    David Wolf: Actually, the capability to programatically add boxes has been a part of More Fields for a while, but has been commented out. I’ve uncommented it in the plugin (including somw minor changes, so download it again) and added to the documentation above (see the ‘Advanced use’ section). If you have any feedback on how that works, let me know.

  43. David Wolf Says:

    Wow, that was quick!

    Seems to work perfectly.

    Cheers :-)

  44. David Wolf Says:

    A couple of little things… in the documentation above you refer to the checkbox as a ‘tickbox’. Also, it’d be cool if the ‘on’ state for checkboxes could be set with the value ‘true’. That would make it easier to integrate with themes programatically.

    Thanks.

  45. Jimmy Says:

    Hello,
    I have a stupid question, what I have to do to let the box opened by default, that’s mean that i haven’t to click on the title to open it on the write page.
    Thank you in advance for your help

  46. noname Says:

    Great PLugin, now I miss only one function - possibility to make “special” pages or posts as with my old WP Custiom Fields. So that I can define e.g. special Geocaching Post and i will have in the menu Pages / Posts / Geocaching Posts, and on Geocaching post i would have the desired fields (and maybe hide the not needed ones), preselected the Geo category etc.

  47. Macrike Says:

    noname… I think you’re talking about Custom Write Panels, right? I also think it’s a great thing to implement into this plugin.

  48. Henrik Melin Says:

    I agree that it would be a logical extension of this plugin to add such functionality (i.e. custom Write/Edit pages). I’m sketching on it at the moment, we’ll see what comes of it.

    David Wolf: Ok, I’m gonna make the defaut for a checkbox true instead of on, when I get the chance.

    Jimmy: Not quite sure actually. WP seems to remember the state of the boxes on the left, but not the ones I’ve added on the left. Gonna have to look into that.

  49. Adrian Says:

    Hi. Since upgrading to 0.6.7 automatically my TDOMF plugin is no longer working properly. I use TDOMF for user form submission and its always worked fine but after the upgrade most of the form fields were not stored in the database, but i could see they were being sent correctly. I rolled back to 0.6.2 and it was fine again. Not sure if this is a bug here or in TDOMF but maybe you could check. Thanks for you time

  50. Adrian Says:

    just to add to the previous post…. I use WP 2.5 on a LAMP server.

  51. Peter Watts Says:

    One feature that I think would be great is if you could add plain text / html that appeared inside a particular box. This would allow you to insert descriptions and warning messages etc. under a particular field on the write / edit page. My purpose is that I have a field called “Picture URL” and I want a preview of this picture to be loaded underneath. I can get it to load perfectly, elsewhere on the page, but it would be nice if it appeared inside the picture URL box. Having this feature would allow me to neatly position the html where I wanted.

    This feature should not be too hard to implement. I noticed that the ‘title’ field on the admin page will accept and then display html. If you made a new field type called (for example) ’snippet’, that when chosen displayed a single input box. The info could be saved in the database as if it was a post title and repositioned just like any other field.

    Do you understand what I mean? I certainly think the ability to add messages / html into the boxes would be a worthwhile addition.

    Cheers

    Peter

  52. Henrik Melin Says:

    Jimmy: I’ve figured out how to make WP remember whether a box is collapsed, so that More Fields boxes will behave like the other boxes, both to the right and the left. The next release will include this fix.

    Adrian: Ok, thanks for reporting that bug, I’m gonna have a look.

    Peter: Belive it or not, you can do that now, although you have to edit code to do it. You can use the ‘mf_box_head’ action to put stuff at the top of the box and ‘mf_box_foot’ to put stuff at the bottom. I do, however, quite like the idea of being able to add some ‘context’ in the boxes, as you suggest. Will ponder.

  53. Peter Watts Says:

    Hmmm. I can’t get it to work. Do I do it through a plugin? How do I word it? I tried this but it didn’t work:

    function p2m_meta_insert($title) {
    if ($title == ‘Picture’) {
    echo ‘hello’;
    }
    }
    add_action(’more_fields_admin’, ‘p2m_meta_insert’);

    i also tried with the ‘mf_box_head’ action, but to no avail. do you have a sample for me to copy?

    Cheers

    Peter

  54. Peter Watts Says:

    Hmmm. I can’t get it to work. Do I do it through a plugin? How do I word it? I tried this but it didn’t work:

    function p2m_meta_insert($title) {
    if ($title == ‘Picture’) {
    echo ‘hello’;
    }
    }
    add_action(’more_fields_admin’, ‘p2m_meta_insert’);

    i also tried with the ‘mf_box_head’ action, but to no avail. do you have a sample for me to copy? where do I put it?

    Cheers

    Peter

  55. Henrik Melin Says:

    Peter: I noticed that the documentation was out of date, adding to the confusion. Oops. I’ve updated with a more relvant example, hope that helps. Note that the head and foot actions are only available for WP 2.5, I’m slowly letting go of supporting pre 2.5, only because the changes in the admin are so great. Consequently ‘more_fields_admin’ in only available if you are using pre 2.5, an the only actions available are the ones documented here (now that I’ve updated the documentation…). :)

  56. Peter Watts Says:

    Cheers. Worked like a charm.

    By the way, is there any way to re-order the boxes on the admin page? I know you can move fields up and down, but there doesn’t seem to be a way to reorder the boxes. Currently I’m reduced to copying the information out of a box and re-entering it in its new place. It would be great if there was a ‘move up, move down’ option. Is it perhaps too messy to implement?

  57. The Best Blogging Software (WordPress) + The Top 60 WordPress Plugins | Midas Oracle .ORG Says:

    […] More fields 0.6.7 » Henrik Melin, Kal Ström (url) Adds any number of extra fields (text, textareas and selects), in any number of additional boxes in the admin. Get the data by do_action(’more_fields’, ‘Name of box’); […]

  58. WordPress More Fields Plugin is Made of Pure Win :: WPLover Says:

    […] If you’re a WordPress developer, this is one amazing tool to have. Read more about the plugin here. […]

  59. KitKat Says:

    Can I put ” meta(key);” into HTML EDITOR of an image in Wordpress?
    For example:

  60. KitKat Says:

    …. example:

    …a… class=”meta(class);” title=”meta(title);” href=”meta(url);”> …a….

    …=

  61. marzbarz Says:

    I’ve noticed an issue when adding a checkbox field. I originally added the field as a dropdown, but then removed the field. It did successfully remove the field from my add/edit post page. I attempted to readd the field as a checkbox but then it showed back up on my add/edit post page as an empty drop down. I thought perhaps the plugin wasn’t tidying up after itself correctly, so I added the field again, this time with a different key and title. It still showed up as a empty drop down. Any ideas/suggestions?

    Thanks!

  62. Igor Says:

    Could someone help me place my checkboxes in 3 columns? I have a Box that I created with 2 textboxes, 1 text area, 24 checkboxes, and 1 select box. Because I have 24 checkboxes on that box I wanted to try to make them list in 3 columns. Any help appreciated!

  63. Andrew Says:

    This is a great plugin and has been working like a charm, I love it.

    Just a small thing, but a bit nagging.. when I click in a field to enter information and I want to tab to the next field, the cursor instead jumps up to the top of the page. Is there a way so that the custom fields are in the correct tab order?

    Thanks!

  64. ari syarifudin Says:

    I love this plugin. I want to share my free e-book and I need some fields for request a name. THis plugin help me out. Bravo. Great Jobs. Thanks

  65. WP: Tot despre câmpurile definite de utilizator | CNET.ro Says:

    […] Pentru WP 2.5 am testat însă, la proiectul Sala de lectură, un alt plugin, tot foarte bun: More Fields. Acesta introduce - opţional - în partea dreaptă (ah, în sfârşit nu e tot jos) oricâte noi […]

  66. krembo99 Says:

    This plugin is great … Just what I needed
    I have one major problem though …
    For some reson the data that I enter in the field is not saved after I click the save post or publish, next time i will go to edit, all the fields are empty !!

    I use wp2.3.3..

  67. Henrik Melin Says:

    krembo99: The latest More Fields is only compatible with WP2.5. Try More Fields version 0.5. Or upgrade to 2.5 :)

  68. krembo99 Says:

    ok, thanks…
    It is strange .. the plugin worked great.. install and all.
    I even managed to sort and fill the fields with RTL language … :-)
    I will not upgrade now due to other compatibility issues.. but i will sure install your older version.

  69. Henrik Melin Says:

    Actually. I might be confusing this with another plugin of mine. MF0.6 should work with WP2.3.3, although I no longer actively develop for older version. I’m gonna have to go back and check.

  70. Bruno Says:

    Thanks for the plugin, Henrik — it’s great! One question: is there any way to restrict or validate input for a date field? I’ve got a user who just can’t seem to type dates in a consistent form. Thanks again!

  71. Ravaka Says:

    Hello,
    Great plugin, thank you for your great work.
    I would Like to ask: How can i include an WYSIWYG in the textarea? Is that possible?
    I work with WP2.5

  72. Andrija Says:

    Hello,
    I have some problems with “checkbox” and “select list” options.

    When I use them, only what I see on website is value added by user.
    I don’t see for what this value is.

    Example:
    Name of of box: Like to…
    Key: lt_TV
    Name: watching TV
    Type (select list): Yes, No

    If user choose “Yes” on website is shown just “Yes”.

    It should look like:
    ============
    Like to…
    wathing TV: Yes
    ============

    I’m using same code for “text” type and that is working just great.

    Can You help me with these?
    Thanks.

  73. alex null Says:

    Just found this plugin and looks great, exactly what i need! thanks! i ll give u more feedback when i test it!

    cheers

  74. Aaron Says:

    Awesome plugin. This is exactly what I was looking for. It’s really helpful in making WordPress an all around CMS.

    The one suggestion I do have is support for WYSIWYG fields. Since TinyMCE is already used for the post fields I imagine it wouldn’t be too much to include it in your plugin. This would make me a very happy man.

  75. Rob de Vos Says:

    Hi,

    This is a very useful plugin, but I have a problem: the Type field doesn’t show up on ‘More Fields - Administration’.
    See the screen capture: http://meandermagazine.net/morefields.jpg
    I’m using WP 2.5.1 and More Fields 0.6.7
    What can be wrong?

    Rob :-)

  76. ine Says:

    this was the thing missing in WP for me.
    One mayor problem though, although I am running 2.5, the textarea isn’t working. (When saved, it gets empty) Text on the other hand is. Any ideas what the problem might be?
    For my solution a text area is easier to work with, otherwise I’d leave it like it is..
    Second question: If I upgrade to 2.5.1 would it still work?
    Thanx.
    You should put a donate-button for this plugin!

  77. Andrea Nanni Says:

    Very nice plugin,
    i’m a wordpress newbie, uhmm… better i’m a web programmer newbie, i’m learning php js xhtml css and others from wordpress code and yours.
    I learn a lot trying to extend your plugin for my needs.

    I need fields supporting ajax autocomplete text, ajax select options and datepicker (currently looking for a kind maskedit library). I think i did a good job! It’s working like a charm.
    But the most interesting feature i added is the ability to select wich field(s) (with it’s own behaviour) must appear in “advanced search” form (available as template tag and also as widget) autoapplying the correct filter on the search query.

    I searched the web a lot for something like this, i did it in few hours with your base.

    Thankyou!

    I’m using jquery.autocomplete and jquery.dateinput for

  78. Jerry Johnson Says:

    Henrik,

    I modified your plugin to be MU compatible (MU using subfolders).

    The only change required was an adjustment to the form action field on the admin page.

    The official version loses the subfolder of the secondary blogs on page submit, and therefore submitted to the main blog from every blog’s admin.

    This one change fixed it.

    more-fields.php
    line 85
    <form method=”post” action=”?page=”>

    becomes
    <form method=”post” action=”">

    (which I stole from the my custom widget widget)

    I am not quite sure why the tilde needs to be handled separately, but it seems to work.

    FWIW,
    Jerry Johnson

  79. Jerry Johnson Says:

    Lost most of that in the translation. maybe this will go through.

    <form method="post" action="<?php echo $_SERVER[’PHP_SELF’]; ?>?page=<?php echo basename(__FILE__); ?>">

    becomes

    <form method="post" action="<?php echo str_replace( ‘%7E’, ‘~’, $_SERVER[’REQUEST_URI’]); ?>">

  80. Doc4 Says:

    Can I make the fields specific ( only appear ) on a pre-created page. For example, if I have a Concert Page I would like Concert Related Fields to only show on this one page and not carry across to pages that don’t need those fields. Because this is a one time page I don’t want to use Fresh Post since the page will appear in the Write Dropdown Menu allowing for other users to make more of these pages, which is not what should be happening.

    Any help would be great, thanks

  81. kj Says:

    Awesome, thanks for this fantastic plugin. Been looking for one that works with 2.5+

  82. Andrew Says:

    Wonderful plugin, tremendous work, thankyou very much!

    Is there a way to not only have a default value in a select list, but also allow the user to input a value?

    Many thanks again.

  83. Charled Says:

    Hello,

    The very great plug-in I was just looking for ! Thanks a lot !

    Just a question : is there a way to add a box to only one page and not all of theme ?

  84. Charled Says:

    Sorry !

    I didn’t read all the comments. You are skteching for a custom write panel function. I hope it will come soon ! ;-)

    So, some other things :
    - perhaps you could plan to make it work with FreshPost and Role Manager ?
    - could you add some pre-formatted fields like date, … ?

    Thanks again.

  85. MrScott Says:

    It seems that in firefox the type box shows up fine in the admin features, however in IE 7 , it don’t show up as Rob de Vos has said. My guess would be some css problem.

  86. Hiranthi Says:

    Thanks for a great plugin. Exactly what I was looking for :-)

    The first box works as it’s supposed to, but I can’t seem to add another box (nothing happens, opened the page in IE7 and there I get a JS error - Line 75, Char 3, Error: This method is not supported by this object (My IE is in Dutch, so I’m not sure the translation of the error description is accurate)).

    Other than that it’s working like a charm (WP 2.5.1) :-)

  87. More Fields Wordpress Plugin | David Bisset: Web Designer, Coder, Wordpress Guru Says:

    […] More Fields Wordpress Plugin - Works with Wordpress 2.5+ Tags: PHP, Wordpress […]

  88. Adding Extra More Fields to WordPress Write/Edit Post/Page Right Column » My Digital Life Says:

    […] More Fields plugin for WordPress can be downloaded form WordPress Plugin Directory, and its usage guide can be found at author’s site. […]

  89. Stephen R Says:

    Hi. Great plugin! I’ll check into integrating support for it with a plugin of mine that uses meta boxes.

    I’m having an issue with version 0.6.7. When I try to delete a box, nothing happens (It links to #. This is similar to the “JavaScript not loading” problem people were talking about earlier in comments.

    Firefox Error Console gives me:

    Error: $((”key_” + wnbr + “_” + nbr)) is null
    Source File: http://example.com/wp-content/plugins/more-fields/more-fields-js.php?ver=7796
    Line: 81

  90. Shah Khan Says:

    wow, that’s so nice plugin.. keep this jop up.. thanks agian

  91. Shah Khan Says:

    Nice plugin,

    i have a problem:

    Example:

    I have an textarea field, if i leave that field empty, then show this in under the post:
    ‘Sorry no data found’

    if the field is not empty then show the field texts…

    please help, i am stuck in that problem..

    anyway, i will say welldone for that good work :)

  92. Yoav Says:

    Amazing Plugin!

    I’m trying to use it with Wordpress mu and have a default box on all blogs using the “Add boxes programatically” method

    What’s the correct syntax for update_blog_option command?
    I’ve tried to define a box with

    $fields = array(
    array(’key’ => **datahere**),
    array(’key’ => **datahere**),
    );
    mf_add_meta_box(’BOXTITLE’, $fields, array(’post’, ‘page’), ‘right’);

    update_blog_option($blog_id,’more_fields_boxes’, $more_fields_boxes[’BOXTITLE’]);

    It does add the “more_fields_boxes” variable to the database, but it’s empty…

    Thanks!

  93. arminbw Says:

    Thank´s for this plugin! I use it to reorder my fast growing amount of custom fields in a non-alphabetical way.

    My question: Currently it is not possible for a non-admin (e.g. an editor) to add new fields using more-fields. He can create ordinary custom fields in the write/edit page, but he cannot access the settings page of the plugin.

    Is there an easy way, to give a non-admin full access to more-fields?

  94. Andy Says:

    Hey I am also after the wysiwyg feature. I have tried hacking the plugin to get it to work instead of the textarea but no luck.

    Does anyone know how to do this?

  95. Tino Says:

    Hello,

    What about Wordpress 2.6 - is it compatible?

  96. Norm Says:

    This looks like a good plugin but under Wordpress 2.5.1 and 2.6 Options - More fields page is messed up. Type popup doesn’t even show.

    I turned off all other plugins and no help. Does this require 777 chmod somewhere?

    Help!

  97. Tomáš Kapler Says:

    re: Adding boxes programatically

    I wonder if I can do a plugin, which will ad several types of “add post” pages. Can you please provide some simple example?

  98. Krezz Says:

    Hi there!

    Have the same problem:

    “This is a very useful plugin, but I have a problem: the Type field doesn’t show up on ‘More Fields - Administration’.
    See the screen capture: http://meandermagazine.net/morefields.jpg
    I’m using WP 2.5.1 and More Fields 0.6.7
    What can be wrong?”

    Someone got a sollution?

    BR Krezz

  99. Henrik Melin Says:

    I’m working on a completely re-vamped version of More Field - it’s taking some time and I have yet to run it on 2.6. Sorry about the delay - I’m super busy at the moment.

  100. Krezz Says:

    Hallå!

    NP, I think this plugin is just what I need so I just have to wait the time it takes for you to find a sollution.

    BTW Keep up the good woork :-)

    MVH Krezz

  101. Krezz Says:

    Hi there again!

    Just realized that I had seen your domain somewhere and I found out that I have seen it related to my favourite football team, Degerfors IF, and the name of the author was Patrik Hamberg. Don’t know if you know him, I don’t, but I think I have played golf with his fahter. :-)

    A bit OT, but WTH :-)

    Best Regards Krezz

  102. Greg Johnson Says:

    I’d suuuuure like to see this fixed for 2.6 Henrik ;)

    I haven’t used it yet, but it seems to be exactly what I need. I’ve written a few plugins in my day so perhaps I might have a stab at it and report back here if I come up with the fix(es) needed.

  103. James Says:

    You should definitely test with 2.6. It fixed some big bugs related to custom fields.

    http://trac.wordpress.org/ticket/6457

  104. Fred Says:

    Hello, it would be extremely GREAT (from my point of view at least ;) ) to have More Fields capable of adding extra fields to a preset form on the post creation/editing page. I need my users to add extra field lines as needed directly on the post creation/editing page and build up a potentially endless list of items. Is this even possible within the wordpress framework? Thanks for the great plugin!

  105. Mario Says:

    Hello, I am trying to modify your More Fields so that it enables dynamic field adding without reloading the page in the post/page admin page. Do you have any advice on this? Anything against it? Any help or suggestions? Thanks in advance, and again thank you for the great More Fields plugin, which has already solved 90% of my coding problems :)

  106. Использование плагина More fields, на примере | Я продолжаю идти... Says:

    […] 1. Скачал и установил плагин More fields. […]

  107. Aprenda a criar/gerenciar custom fields | Maikel Neris - guru Wordpress (título auto proclamado) Says:

    […] FIELDS, A REVOLUÇÃO O plugin More fields permite criar um novo painel dentro da sua área de postagem para a inserção de cf. O painel pode […]

  108. Turn Wordpress into a Flash Game Site | U5I Blog Says:

    […] Download and then activate plugin: More fields (use to add custom fields […]

  109. Passageirodealgumtrem Says:

    Thanks for the plugin!
    How to insert meta-more-field INSIDE the psto? It’s possible?
    Sorry wrong words, I’m brazilian.

  110. Kel Says:

    Really hoped this had been updated to WP2.6+… Fresh/Page/Post/Flutter’s work and intro to Canvas seems like it was going to be a step in the right direction, but it’s so overkill for our needs now. More Fields simpler approach kept it all light and clean. Any ETA?

  111. Henrik Melin Says:

    I’ve just submitted More Fields 0.6.8, which I’m hoping will resolve some issues with WP 2.6. If not, let me know!

  112. Kel Says:

    Excellent! It’s SO much better to have a specific pane with pre defined fields. Will be giving 0.6.8 a workout in the coming days.Thank you!

Leave a Reply