Skip to:
Content
Pages
Categories
Search
Top
Bottom

Prevent users from changing email


  • bheanloh
    Participant

    @bheanloh

    I tried to put disabled=”disabled” for the email part.
    I also tried to remove the whole email thingy.
    Both ways doesn’t work. It will show “ERROR: Please enter an e-mail address.” when I pressed update profile.
    Any ideas how to achieve that? Thanks.

Viewing 1 replies (of 1 total)

  • billseymour
    Participant

    @billseymour

    This may be too late for the OP, but this worked for me:

    In my customized form-user-edit.php:

    1. Disable the normal Input (as the OP did):
    <input type=”text” name=”email” id=”email” value=”<?php bbp_displayed_user_field( ‘user_email’, ‘edit’ ); ?>” disabled=”disabled” class=”regular-text” tabindex=”<?php bbp_tab_index(); ?>” />

    2. Add a Hidden Input, which Inputs the existing Email value.
    <input type=”hidden” name=”email” id=”email” value=”<?php bbp_displayed_user_field( ‘user_email’, ‘edit’ ); ?>” />

    If you look at the bbpress file: bbpress/includes/common/template.php, at lines 1621 and 1622, you can see that this is how the User_ID was entered (ie, via a Hidden input).

    For me, so far so good. I hope this was of some help. –Bill

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