Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
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 '10 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. –  MikeSchinkel Oct 25 '10 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. –  Steve Wright Oct 25 '10 at 19:36

4 Answers 4

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. :)

share|improve this answer

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?

share|improve this answer

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.

share|improve this answer

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

share|improve this answer
    
    
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 '11 at 16:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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