Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

[Resolved] PDF – Stamper – Begginer Help – Stamping Username

by

Tips and Tricks HQ Support Portal › Forums › WP PDF Stamper › PDF – Stamper – Begginer Help – Stamping Username

Tagged: pdf stamper, username

  • This topic has 9 replies, 3 voices, and was last updated 3 years, 10 months ago by admin.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • July 8, 2021 at 4:13 pm #83305
    gumatera
    Participant

    I need to stamp USERNAME (current username), but this variable is not available in plugin variables.

    I read the article on https://www.tipsandtricks-hq.com/wp-pdf-stamper/pdf-stamper-dynamically-modifying-the-text-to-stamp-data, but I dont have technical skills to change the code and I would appreciate some help with this.

    Basically what I need is to change the code shown in article to:

    $text_to_stamp .= “Licensed to %current_username% – %current_user_email% by Company.”;

    Can you help me?

    July 8, 2021 at 4:33 pm #83306
    wzp
    Moderator

    How is the user name and email address to be provided? From a membership plugin, from WordPress, or from a user form?

    July 8, 2021 at 4:39 pm #83308
    gumatera
    Participant

    From WP.

    July 8, 2021 at 4:59 pm #83310
    wzp
    Moderator

    Did you look at this WordPress specific option?

    PDF Stamper – Creating a Download Now Button for WP Users

    July 8, 2021 at 9:16 pm #83312
    gumatera
    Participant

    Thanks for your support!

    Yes, I am using the custom button. But I couldn’t find any variable available to stamp the Current-Username.

    {Customer name} does not return current-username, right?

    What I want is: From the Download Button, a logged-in user will download a PDF file with his username and email displayed in file’s footer in a sentence like “Licensed to gumatera – guma@gmail.com by Company.”

    I dont know how to get the current username and use it in the wp filter (article link above) as $text_to_stamp .= “Licensed to %current_username% – %current_user_email% by Company.”;

    I mean, I dont know the query to get the current user name and HOW to insert the username and email in this sentence to be displayed…

    July 9, 2021 at 11:25 am #83315
    gumatera
    Participant

    I sent a new reply, but I dont see it here…

    July 9, 2021 at 2:34 pm #83317
    wzp
    Moderator

    What you are asking for (WP user name) is currently not supported. Much of the PDF Stamper plugin uses obfuscated PHP code; so it may be impossible for you to add a new variable, on your own. You might want to try requesting a custom work order quote; and one of the developers will get back with you.

    July 9, 2021 at 4:54 pm #83320
    admin
    Keymaster

    Have a look at this post that shows how you can use an action hook to stamp additional text. If you are a developer, you can use this example to create your own customization that reads the currently logged-in user’s username and adds to the stamping:

    Stamping Custom WooCommerce Order Meta Data

    FYI, if your post has too many URLs, the forum software may mark it as spam.

    July 12, 2021 at 7:36 am #83328
    gumatera
    Participant

    Find the solution below. Tested and verified!

    ///////////////////////////////////////

    add_filter(‘filter_stamper_text_after_replacing_tags’, ‘customize_text_to_stamp’, 10, 2);

    function customize_text_to_stamp ($text_to_stamp, $additional_params)
    {

    $current_user = wp_get_current_user();

    // Which you want to dispaly you can set below type

    // $current_user->first_name //First Name of login User
    // $current_user->last_name //Last Name of login User
    // $current_user->display_name // Name of login User
    // $current_user->user_email // Email

    $text_to_stamp .= “Some text here” . $current_user->user_login . “some text here”;

    return $text_to_stamp;
    }

    July 12, 2021 at 8:16 pm #83335
    admin
    Keymaster

    Thank you for sharing your solution. Looks good to me.

  • Author
    Posts
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ