Skip to content
Advertisement

WordPress Filter – Get Username

I am using a plugin that gives me the option to customize a specific sentence through wordpress filter.

This is the orginal code:

JavaScript

I need to insert current-username in the $text_to_stamp, so it returns like:

JavaScript

This sentence is only displayed if there is a logged in user, so this verification is not necessary.

I dont know how to get the current username and how to insert it into the sentence.

Can you help me?

Advertisement

Answer

Try the below code that will help you.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement