Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to make another public message button to include prefix text and sender @name?

  • @nahummadrid

    Participant

    I’m trying to duplicate the public message @reply function to include default text before or after the @name and the sender’s @name. For example a Send Happy Birthday Message button will appear on a profile on a user’s birthday and by clicking on the button, the normal function would take you to the post form to @name but unlike the normal function this would include text “ @you, Happy Birthday from @me” — just one of the uses I can think of right now, I’m actually thinking of using it to send challenges.

    `function bp_send_public_message_link_too() {
    echo bp_get_send_public_message_link_too();
    }
    function bp_get_send_public_message_link_too() {
    global $bp;

    if ( bp_is_my_profile() || !is_user_logged_in() )
    return false;
    return apply_filters( ‘bp_get_send_public_message_link_too’, wp_nonce_url( $bp->loggedin_user->domain . $bp->activity->slug . ‘/?r=’ . bp_core_get_username( $bp->displayed_user->user_id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login) ) );
    }
    `

    I’ve created this new function of course to power the button. but i’m having trouble figuring out how to finish the action in the post form.

    This is from the post form.
    `@@`

    Any ideas how I can finish this?

  • The topic ‘How to make another public message button to include prefix text and sender @name?’ is closed to new replies.
Skip to toolbar