Skip to:
Content
Pages
Categories
Search
Top
Bottom

Send Buddypress Message Anonymously


  • judahorion
    Participant

    @judahorion

    I am attempting to allow users to decide whether or not they’d like to be anonymous when sending a private message to a user via a checkbox that says “Send Anonymous” and I feel like I have all the necessary elements needed but have no idea how to put it together.

    The intention of me wanting to implement this is because my users will be treating these anonymous messages as submissions of sorts, and will not be directly replying to them. I simply want the option for the message to pop up in their inbox, and if it’s anonymous, they will copy and paste the contents of the message into a new post and answer it there. My users will be using the message feature as an “ask box”.

    So, if the checkbox is checked, I want to set the sender id as 55 which is the USER id of a user I’ve made named “anonymous”.

    <input type="checkbox" id="send-anonymously" name="send-anonymously" value="1" />
    			<div class="rolescape_field_indication"></div>
    			<?php _e( "Send Anonymously.", 'rolescape' ); ?>

    I believe I can do this by adding <?php wp_nonce_field( 'messages_send_message' ); ?>
    after the form, but not sure how to modify the messages_send_message function to call for the conditional elements such as if the checkbox is checked then it would be 'sender_id' => 55 and if it’s unchecked then it would be 'sender_id' => $bp->loggedin_user->id;

    I hope this makes sense. I am fairly new to PHP but learning every day. Thank you so much for your hard work.

  • You must be logged in to reply to this topic.
Skip to toolbar