Skip to:
Content
Pages
Categories
Search
Top
Bottom

Remove e-mail field from “form anonymous”


  • dgssaedfrhes
    Participant

    @narzan5137

    Hi,
    I want to remove “e-mail” field from the replay form of anonymous users.
    wp-content/plugins/bbpress/templates/default/bbpress/form-anonymous.php

    I removed the website field and it works, I’m trying now to remove the e-mail field too but because it’s require filed it doesn’t work!
    If i press “submit” nothing happen at all.

    Okay from what I know i should remove this code

    <p>
    <label for="bbp_anonymous_email"><?php esc_html_e( 'Mail (will not be published) (required):', 'bbpress' ); ?></label><br />
    <input type="text" id="bbp_anonymous_email"   value="<?php bbp_author_email(); ?>" size="40" name="bbp_anonymous_email" />
    </p>

    after that what should I do?! 🙂

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

  • Robin W
    Moderator

    @robin-w

    untried, but try adding this to your functions file

    add_filter ('bbp_before_filter_anonymous_post_data_parse_args' , 'rew_remove_mail' ) ;
    
    function rew_remove_mail ($args) {
    	$args ['bbp_anonymous_email'] = true ;
    return $args ;
    }

    neon67
    Participant

    @neon67

    Hola!
    Someone knows the full code for bbpress – remove the site field in anonymous form?

    I’ve tried something like this (for the whole WP) but it doesn’t work

     function remove_url_from_comments($fields) {
        unset($fields['url']);
        return $fields;
    }
    add_filter('comment_form_default_fields', 'remove_url_from_comments');

    Thank!


    Robin W
    Moderator

    @robin-w

    These fields are in a bbpress template so you need to amend that

    find
    wp-content/plugins/bbpress/templates/default/bbpress/form-anonymous.php

    transfer this to your pc and edit

    remove

    <p>
    <label for=”bbp_anonymous_website”><?php esc_html_e( ‘Website:’, ‘bbpress’ ); ?></label><br />
    <input type=”text” id=”bbp_anonymous_website” value=”<?php bbp_author_url(); ?>” size=”40″ maxlength=”200″ name=”bbp_anonymous_website” />
    </p>

    and save

    create a directory on your theme called ‘bbpress’
    ie wp-content/themes/%your-theme-name%/bbpress

    where %your-theme-name% is the name of your theme

    Then transfer the file you saved above and put in in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/form-anonymous.php

    bbPress will now use this template instead of the original


    neon67
    Participant

    @neon67

    Thanks for the detailed answer! It works )))

    ..I aspire a universal solution now (for a wp and bb) – apparently need to act separately


    teresaanderson
    Participant

    @teresaanderson

    I know that this is an old thread but I’m hoping to still get a reply. I’m having the same issue trying to disable the name, email and website fields in a bbpress forum. Can someone tell me where/how to “find” the following code? wp-content/plugins/bbpress/templates/default/bbpress/form-anonymous.php

    I don’t know where to go to find and replace as the instructions state. Thanks for your help!


    Robin W
    Moderator

    @robin-w

    This requires you to be able to FTP – do you know how to do this?


    teresaanderson
    Participant

    @teresaanderson

    Thanks for the response!!! I do not know how to FTP. But if it’s something I can learn watching a few YouTube videos I’m happy to do so. Removing the name and email fields are must haves for my site. I’ll put in whatever work is necessary to learn how to remove them.


    Robin W
    Moderator

    @robin-w

    I’ve added that capability to my style lack plugin, so add this to your site

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>Topic/Reply Form

    and you will see options for this in items 19,20 & 21


    teresaanderson
    Participant

    @teresaanderson

    Apologies for the delayed response. I can’t thank you enough for your help! The updates worked and I no longer see those three fields on my site. Oddly, when I try to post a new topic, it now doesn’t register. When I hit submit, there’s no record of the topic or post ever being created. I’ll continue trying to solve for that issue.
    If you’d like to share your cashapp, venmo, etc (not sure if there’s a way to provide that privately). I’d love to buy you a cup of coffee/lunch for your help. I never would have figured it out on my own. Thanks again!


    Robin W
    Moderator

    @robin-w

    hmm… I think I have not fixed it enough !!

    part of removing those fields was also getting passed the subsequent checks that bbpress does before allowing the topic to be posted. Looks like it is failing one of those if you are not getting posts saved and displayed.

    can you try disabling one at a time and see if it never works on posting or doesn’t when x field is missing


    teresaanderson
    Participant

    @teresaanderson

    I’ve disabled one at a time until all were deactivated and still the post doesn’t register. Any ideas? Thanks again for your help!!!


    Robin W
    Moderator

    @robin-w

    ok, thanks, i am on holiday at the moment, but if I get some time, I’ll take another look.

    I presume you get no errors when you try and post – it is worth scrolling down to the form itself to check that nothing is displayed


    teresaanderson
    Participant

    @teresaanderson

    Correct. I don’t get any errors and I see no evidence of the submitted post anywhere on the site – lower on the page, on the forums landing page, etc. It doesn’t show up on the topic count either.

    Enjoy your vacation!


    Robin W
    Moderator

    @robin-w

    so quick question – do you have any of the code above active – it should not be, as my plugin should work in its place


    teresaanderson
    Participant

    @teresaanderson

    I just checked. It doesn’t look like I have the code from the previous posts anywhere on the site. I checked all of the custom CSS screens.


    teresaanderson
    Participant

    @teresaanderson

    Hi – Just wanted to follow up to see if you have any suggested fixes. DO I need to start over and rebuild the site from scratch? Thanks!

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