Skip to:
Content
Pages
Categories
Search
Top
Bottom

remove anonymous website field


  • hotken
    Participant

    @hotken

    I would like to remove website field for non logged in users by filter.
    This is what I’ve done.
    But it’s not working.
    What am I wrong?

    Thank you in advance.

    function remove_website () {
    return false;
    }
    add_filter( ‘bbp_pre_anonymous_post_author_website’, ‘remove_website’ );

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

  • Robin W
    Moderator

    @robin-w

    Try (haven’t tested)

    function remove_website ($r) {
     $r['bbp_anonymous_website'] = false;
    return $r ;
     }
     add_filter( ‘bbp_pre_anonymous_post_author_website’, ‘remove_website’ );
    
    

    or

    function remove_website ($r) {
     $r['bbp_anonymous_website'] = false;
    return $r['bbp_anonymous_website'] ;
     }
     add_filter( ‘bbp_pre_anonymous_post_author_website’, ‘remove_website’ );
    
    

    hotken
    Participant

    @hotken

    I appreciate your early help Robin.

    However both didn’t work.
    Website field still appears.

    I have corrected ‘ to ‘ but fully copied.


    colson73
    Participant

    @colson73

    I am also in need of this. Any help would be greatly appreciated.


    jakerobbins
    Participant

    @jakerobbins

    Locate the form-anonymous.php file within templates/default/bbpress and remove the following paragraph.

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

    The website field should now disappear 🙂


    Robkk
    Moderator

    @robkk

    you can also hide it with CSS since it isnt required

    i also included the topic form website field

    .bbp-reply-form #bbp_anonymous_website,
    .bbp-topic-form #bbp_anonymous_website,
    label[for="bbp_anonymous_website"] {
    	display: none !important;
    }

    hotken
    Participant

    @hotken

    jakerobbins and Robkk, thanks for the reply.

    I understand it can be hidden with template customize or css customize.
    however for maintenance reason (bbpress update etc.) I would like to know the way by filter.
    some customize has already done by add_filter except bbp_anonymous_website.

    thank you.

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