Skip to:
Content
Pages
Categories
Search
Top
Bottom

WordPress-specific xprofile (meta) fields not saving


  • maelscuttle
    Participant

    @maelscuttle

    I’m trying to allow users to edit certain WordPress metadata fields on the frontend, namely contact and social information such as website, twitter link, etc. This functionality is outlined e.g. here https://bpdevel.wordpress.com/tag/wordpress/, however it only partially seems to work.

    I’ve added 4 custom fields to the profile:
    – Bio [type: Biography]
    – Website [type: WordPress Text Field: Website]
    – Twitter [type: WordPress Text Field: Twitter]
    – Twitter [type: WordPress Text Field: Instagram]

    When I fill them out on the frontend, only Bio and Website are correctly stored to the user-meta table, Twitter and Instagram content seems to be lost. I can however edit them in the WordPress backend and they get correctly displayed on the front-end profile.

    I’ve managed to synchronize them by updating them manually via code using update_user_meta() on save, but I feel like this defeats the point or shouldn’t be the way to go if the functionality is there on the admin menu.

    Or am I doing something wrong here?

Viewing 8 replies - 1 through 8 (of 8 total)

  • Anonymous User 18296540
    Inactive

    @anonymized-18296540

    I have the same problem with Twitter saving. Backend works but frontend not! It’s a bug as I think!


    hayeu74
    Participant

    @hayeu74

    Then why not you use any tool for this purpose who can automatically tracks the meta fields as you can see on this profile here I am using the same facility.


    Anonymous User 18296540
    Inactive

    @anonymized-18296540

    @hayeu74 Are you using Rank Math SEO?


    aksi746
    Participant

    @aksi746

    I faced some field problems some years ago in my site but then I took guide form the moderator of the buddypress you can apply that guide on it may be it works.

    Hi @maelscuttle

    Thanks for your report. If these fields are generated filtering the wp_get_user_contact_methods() function they should be included into/updated from the front-end xprofile form.

    I’ll give it a look and will be back soon.

    Hi, I’m back 🙂

    I confirm this is working as expected. I’ve used this code to generate the Twitter WP Contact method: https://gist.github.com/imath/c634d9bfb575f128d76a25aaa76fc2e5

    Then, I’ve created a new xProfile field using the WordPress text field type, as shown in the below screenshot.

    xProfile create screenshot

    Once done, I was able to find the new input inside the user’s profile edit screen on front-end, see screenshot below.

    Profile edit screenshot

    When I’ve submitted my edits, the twitter link was saved successfully and on the user’s profile view screen, it is displayed as a clickable link:

    Profile view screenshot

    The same goes for the WP Dashboard profile, see below:

    WP Dashboard profile screenshot


    maelscuttle
    Participant

    @maelscuttle

    Since this is months old, I’ve already settled back then with the plugin “BuddyPress to WordPress Full Sync” which allows me to sync any arbitary xProfile fields to WordPress fields.


    @imath
    I can confirm by now this works as expected when following your steps. Without being able to verify anymore what my problem was back then, I have a feeling this must have been related to validation as sometimes BuddyPress provides zero feedback when something was wrong. In my current WordPress version (5.8.3), the Twitter field is expected to be a simple username (not full URL / @), other fields like Instagram are expected to be the full URL. So perhaps the issue was that some fields didn’t match validation criteria, so BuddyPress just silently swallowed the input?

    Cheers


    adamhelmers
    Participant

    @adamhelmers

    I was having the same issue; likely reason was my SEO plugin (Yoast SEO) only runs wp_get_user_contact_methods() in wp-admin. I re-registered the contact methods, and the BuddyPress-WordPress Text Fields now save the user contact data.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Skip to toolbar