• Hello,
    Please let me know how to configure fep-class.php so that it will automatically fill in the “username” in the “To” field on the “Create New Message” form, so that the person sending the message does not need to type in the “username” (name of recipient)? I seen this posted by someone else but what was posted didn’t work for me. I have the latest version of WordPress with the latest version of the ClassiPress plugin. Please help me with this and be clear about exactly what I need to do as I am a beginner. Your help will be very much appreciated.
    My new site is https://www.okeechobeebartering.com .
    Thank you.
    [email protected]
    Rhonda

    https://www.ads-software.com/plugins/front-end-pm/

Viewing 3 replies - 1 through 3 (of 3 total)
  • I am also interested in this answer.

    Thanks!

    I was able to do this by linking to the send message page and using a querystring variable, then grabbing that variable with php/jquery, and placing it in the to box…

    so on fep-class.php, around line 507 i put:

    <?php
               $user = htmlspecialchars($_GET['user']);
            ?>
              <script>
              $(window).load(function(){
                $('#search-q').val('<?php echo $user ?>');
              });
              </script>

    To make sure this works correctly you have to be linking to the send message page with a querystring variable. Your send message page may not be the same as mine but something along the lines of.

    <?php
          $user_ID = 1;
          //There are many ways to get the user object, this is just an example
          $user = get_user_by('id', $user_ID);
          $user_to_message = $user->username;
    ?>
    <a href="<?php echo home_url(); ?>/messages/?fepaction=newmessage&user=<?php echo $user_to_message; ?>" Send Message </a>
    Plugin Author Shamim Hasan

    (@shamim51)

    <a href="<?php echo home_url(); ?>/messages/?fepaction=newmessage&to=user_login; ?>

    pass user login somehow. to field will fill automatically from this user login value

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Automatically insert username’ is closed to new replies.