Skip to:
Content
Pages
Categories
Search
Top
Bottom

Remove e-mail field from “form anonymous”


  • narzan5137
    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 4 replies - 1 through 4 (of 4 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

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