• Resolved Bojan Denić

    (@evilmc)


    Hi,

    It’s possible add specific custom field in profile for every my users? I have unique ID tracking code for every users buy with gravity forms and I need add manually code for each ID profile to set tracking code.

    And after I need shortcode for page, only for this custom field.

    Thanx

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Shortcodes will not work on default profile screens, they are meant only for post types that have content, like ‘page’ or ‘post’. Not quite sure what page you were referring to, “page” is so ambiguous!

    Anyway, you can add custom fields to the default profile page by hooking one of the various related actions and filters. Look through wp-admin/user-edit.php to see what’s available where on the page. Your callback code could pull the user’s tracking code from user meta (or wherever) to display in the field, then update the data if it has been altered when the form is submitted.

    The actions ‘personal_options_update’ or ‘edit_user_profile_update’ fire when the form is submitted, depending on if one is editing their own or another user’s profile.

    Then of course a shortcode handler code can pull the same user meta provided the shortcode is used where it is intended 🙂

Viewing 1 replies (of 1 total)
  • The topic ‘Specific custom field in profile user’ is closed to new replies.