• All users needs to write “website” in their profile field.
    If a user has https://XXX.org in that field i would like to replace it with something else.
    So basicly i would like to know where i can play around with this “website” field, actual file. For example put a simple javascript in that.

Viewing 1 replies (of 1 total)
  • Joey

    (@leglesslizard)

    Hey,

    Do you want to change this field while the user is present e.g. as they type? Or do you want to modify the value they enter when they submit the form to save it?

    If the first, I’d look at creating a simple plugin that enqueues a script when the page is the user profile page. In this js file you could alter the field on the fly or provide error messages/notices to the user to guide the input.

    If the second, I’d look at hooking in on the filter before a users data is saved and alter the URL there. I’m unsure why you’d want to do this, however. But the filter to look at would be wp_pre_insert_user_data

Viewing 1 replies (of 1 total)

The topic ‘Use javascript on a profile field backend.’ is closed to new replies.