Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Miguel López

    (@atallos)

    You can use this hook “xprofile_field_data_updated”. This hook is called just after updating the field value. Something like this:

    function custom_xprofile_profile_field_data_updated($field_id, $value) {
        $field = new BP_XProfile_Field($field_id);
        if ($field->type == 'textbox' || $field->type == 'textarea') {
            xprofile_set_field_data($field_id, bp_displayed_user_id(), strip_tags($value));
        }
    }
    add_action('xprofile_profile_field_data_updated', 'custom_xprofile_profile_field_data_updated', 10, 2);

    This function is deleting tags from all texboxes or textareas fields.

    Thread Starter helloadorable

    (@helloadorable)

    Great. Thx! I will try this.

    Thread Starter helloadorable

    (@helloadorable)

    Looks like it works. Thanks so much.

    Plugin Author Miguel López

    (@atallos)

    You’re welcome!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Disallow HTML in textbox and textarea fields’ is closed to new replies.