0

I have a site that I am migrating to WordPress, and I have a need to add properties that each of the users can edit (e.g., Address, City, State, Business Name, etc), along with some properties that Administrators can edit (IsActive, CanEmail) that wouldn't be displayed to the user. In addition, I need to be able to display the properties in a table (similar to how the plugin, "Members List", displays, but with the custom fields displaying as well.

Given these requirements, I had attempted to use a combination of "Cimy User Extra Fields" and "Members List", but the members list grid did not have an option to display the extra fields created by the other plugin.

How would you recommend I approach this?

EDIT:

So I guess the crux of my question is, what is the preferred method to add properties to the User?

3
  • 1
    This is quite a bundle of things, it could be a plugin in itself that addresses the multiple functionality you're asking for. Totally doable, but extensive enough you might want to offer a reward to encourage someone to take the time ;-) Otherwise you might want to break each specific question up on its own, as this question requires multiple answers...
    – somatic
    Oct 25, 2010 at 5:10
  • @somatic has a really good point. If you can break up your question into numerous "bite sized" questions, each with a sufficient explanation, you'll have a much better chance of getting it all answers. As is, it just feels like too much to try to tackle in one sitting. Oct 25, 2010 at 7:47
  • I updated the question to be more specific. The answer might be "it depends", but seeing how I will apply the properties may offer some insight. Oct 25, 2010 at 19:36

4 Answers 4

2

To answer the first part of your question, I have just put my class TTT_User_Profile_Addon on GitHub. The class offers a simple interface to add a field to a profile page. I have added an example for a checkbox subclass and some code to initialize it per functions.php. This works in a plugin too, of course.

There are some build in placeholders, but you can add your own. Separate filters for the markup and input values make extending the class easier.

You can set custom capabilities for showing and saving the fields per constructor call. The whole work is reduced to a simple init function:

add_action( 'init', 'ttt_init_profile_addons' );

/**
 * Registers the extra fields for the user profile editor.
 */
function ttt_init_profile_addons()
{
    $GLOBALS['ttt_show_profile'] = new TTT_User_Profile_Checkbox(
        array (
            'name' => 'ttt_show_profile'
        ,   'label' => 'Show a short profile box on my posts.'
        ,   'th' => ''
        ,   'td' => '<input type="checkbox" name="%name%" id="%id%" %checked% /> %label%'
        ,   'cap_show' => 'edit_posts'
        ,   'cap_save' => 'edit_users'
        )
    );
    // add more fields here …
}

Adding the values to the member table is something I still have on my todo list …

Oh, and I should probably mention another class to replace or extend the default contact fields: TTT_Contactfields. This may be a case of OOP overdone. :)

0

The basic idea is that you save the extra information as metadata, and then extend the regular user list and forms to show your own content. (Showing extra columns in the list is easy, I have an example for the post list.)

It seems the Members List can display data from the meta table, so if Cimy User Extra Fields also saves its information there you should be able to combine them. How does the Cimy plugin save its data?

0

This is not an answer but a suggestion. You can use buddypress: http://buddypress.org/

Profile Field Setup section is what you are looking for i think.

0

this is probably not a final answer, depending on what you want to do, but have you checked out regi-plus-redux? I have used it for a number of sites and it lets you add properties, and set them as viewable in the profile or not (ie. viewable to the user or only to admins.)

2
  • register-plus-redux has been removed from the codex due to a security hole. It's unclear, at the moment, if it will be fixed and re-submitted. However there are willing adopters if the author agrees to transfer responsibility - so there's still hope for it, even if he decides not to continue.
    – marfarma
    Sep 22, 2011 at 16:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.