Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to populate the subject field with post name.


  • koded1999
    Participant

    @koded1999

    Hi guys,

    I have asked this question before, but any help will be greatly appreciated.

    On my site, i placed a private message button in post. using this code:

    
    function bpfr_message_shortcode() {	
    $author = get_the_author_meta('user_login');
    $message = '<a href="/login">Login to Message advertiser!</a>';
    
    if( is_user_logged_in() ) {
    	return '<a href=" '.wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . '/compose/?r=' . get_the_author_meta('user_login') ) .' title="Private Message to Author" ">MESSAGE ADVERTISER</a>';
     } else {
        return $message;
     }
    } 
    add_shortcode( 'ksam', 'bpfr_message_shortcode' );
    

    courtesy of @danbp

    The code is able to populate the Send To(Username or Friend’s Name) field.

    But the problem i am having now is that i want to also populate the subject field with the post title.

    Please any help will be appreciated.

    thanks in advance.

  • The forum ‘BuddyPress Private Messages for Friends Only’ is closed to new topics and replies.
Skip to toolbar