Pesky bio (description) box in standard WP profile
- This topic has 6 replies, 2 voices, and was last updated 8 years ago by Christian Wach.
-
AuthorPosts
-
November 22, 2016 at 6:49 pm #6136Troy WelchParticipant
Hi, I have a couple of related issues that I see are quite common. I don’t want my users to get confused between the front-end Buddypress Profile edit interface and the Dashboard Profile edit interface.
The only problem I have is the bio (description) box which is used in the Author meta box various places.
Christian, I had a look through the code for your sync plugin. It is quite thorough and gives me an idea of approach, but I don’t think I need anything this complex. We are creating all the user accounts and would only need to hook on the xprofile update.
However, there are two broad approaches to this and I would love an opinion on which would be cleaner and easier.
Approach 1 would be to sync an xprofile field to the wp bio(description) field on update of the xprofile field. Then the author meta and other bio uses would work as usual.
Approach 2 would be to disable (or at least hide with CSS) the wp bio field and edit the author-box template to use the xprofile field rather than the bio field.
Approach 1 has some dynamic syncing and non-single-sourcing downsides that are amply detailed in various issue tickets on the web.
Approach 2 solutions seem to involve intercepting output. A variation on Approach 2 would be to leave the bio in place but redirect from wp profile edit to the front-end bp profile edit and use the xprofile field in the authorbox.php.
I’m happy to puzzle through either approach, but there seems to be downsides to either. Of course if someone had some code hanging around I’d also be grateful.
Cheers
November 23, 2016 at 6:00 am #6137Christian WachParticipant@troy I assume you’re referring to my BP XProfile WordPress User Sync plugin here. If so (and I understand your goal correctly) then you’d need to code the description sync yourself. I didn’t include this in the plugin because of the mismatch between the Rich Text BuddyPress field and the standard textarea in WordPress.
Can you elaborate on “Approach 1 has some dynamic syncing and non-single-sourcing downsides that are amply detailed in various issue tickets on the web”? I’m not clear what you mean by this. I ask because this approach would probably be my preferred one, regardless of whether access to the WordPress profile edit screen were redirected to the BuddyPress xProfile edit screen or not.
Cheers, Christian
November 23, 2016 at 11:27 am #6138Troy WelchParticipantFirst, Christian, thanks for your amazingly speedy and helpful attention. Know that if we find ourselves in the same city drinks are on me.
I guess I was influenced in some of my ‘editorial’ comments in my original post by this issue thread and some of its links. https://buddypress.trac.wordpress.org/ticket/3335 There may have been a few others. On a second look, a good portion of the thread is a little dated.
In any event, I agree that approach 1 seems cleaner and that’s the one I’ll pursue. I’m just triaging my to-do list in advance of a client meeting tomorrow. I likely need to spend the day “fluffy the pillows” and cleaning up some CSS things. I’ll probably tuck into this issue following that.
It would be fair to say that you have been invaluable in helping us solve key problems.
Thanks again.
t
November 23, 2016 at 1:59 pm #6141Christian WachParticipantHi @troy, I think the most recent attempt to address this is #7162 xProfile field support for WordPress Profile Fields but there hasn’t been any movement on it recently. BP XProfile WordPress User Sync has always worked fine for situations where I want to enforce real names across the site and need them to stay in sync with WordPress.
Syncing the WordPress biography field is actually much less complicated than syncing names because BuddyPress doesn’t try to do this in the first place. I’ve posted the code for a simple plugin that should help get you going. Change the value of the
$biography_id
to the xProfile field you want to sync and it should be (sort of) functional. What’s missing is to enable TinyMCE on the WordPress biography field, but there’s probably a plugin out there somewhere that does this already.Cheers, Christian
November 23, 2016 at 3:00 pm #6142Christian WachParticipantWhat’s missing is to enable TinyMCE on the WordPress biography field, but there’s probably a plugin out there somewhere that does this already.
There is the Visual Editor Biography plugin which might do the job. It hasn’t been updated in a while, but there are no reports of it no longer working. I expect a little tweaking would make it serviceable again.
November 23, 2016 at 4:00 pm #6143Troy WelchParticipantFantastic, thank you very much. Just gave this a whirl on my test site, works wonderfully.
I’m not as concerned with the TinyMCE, my plan is to redirect users to the Buddypress front-end profile edit page.
Oh, there’s another question, is TinyMCE editing an option for the Buddypress front-end profile edit page? I remember encountering something somewhere hinting that it might be problematic so I stopped worrying about it. It may be something users want though.
Cheers, Troy
November 24, 2016 at 7:35 am #6144Christian WachParticipantOh, there’s another question, is TinyMCE editing an option for the Buddypress front-end profile edit page?
All “Multi-line Text Area” xProfile fields have used TinyMCE by default since BuddyPress 2.4. You can switch TinyMCE off for particular fields using the
bp_xprofile_is_richtext_enabled_for_field
filter.Cheers, Christian
-
AuthorPosts
- You must be logged in to reply to this topic.