Title: Placeholders
Last modified: August 31, 2016

---

# Placeholders

 *  Resolved [fabrizio.u](https://wordpress.org/support/users/fabriziou/)
 * (@fabriziou)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/placeholders-3/)
 * Hi,
    is there a placeholder for $text similar to %FIRST_NAME%? I’d like to perform
   a php search on a string entered by user (** /search string**).
 * I already tried with a custom function and it works fine:
 *     ```
       if ( substr( $text, 0, 8 ) === "/suggest" ) {
       		$textkw = explode(" ", $text);
           }
       ```
   
 * but I’d like to test the same using insertphp in custom post.
 * Thank you
 * F
 * [https://wordpress.org/plugins/telegram-bot/](https://wordpress.org/plugins/telegram-bot/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Marco Milesi](https://wordpress.org/support/users/milmor/)
 * (@milmor)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/placeholders-3/#post-7234428)
 * Hi,
    atm there’s no placeholder to get it, but with insertphp you could use direct
   code. If you look in **parse.php** you can find all variables of the json Telegram
   request that you could use
 * However, for performance and security, i suggest to keep the php-way without 
   insertphp.
    [wordpress.org/support/topic/how-to-setup-dynamic-answer-to-mybot-message](https://wordpress.org/support/topic/how-to-setup-dynamic-answer-to-mybot-message)
 *  Thread Starter [fabrizio.u](https://wordpress.org/support/users/fabriziou/)
 * (@fabriziou)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/placeholders-3/#post-7234430)
 * Thank you, I guess I’ll keep the php way.
 * Just a quick final question since I’m not a developer: I’m having problems in
   retrieving first name variables using php. I tried $telegram_first_name but it
   returns empty.
 *     ```
       function telegramcustom_parse( $telegram_user_id, $text ) {
           $plugin_post_id = telegram_getid( $telegram_user_id );
   
           if ( !$plugin_post_id ) {
               return;
           }
   
           if ( substr( $text, 0, 8 ) === "/suggest" ) {
       		$textkw = explode(" ", $text);
               telegram_sendmessage( $telegram_user_id, 'Hi ' . $telegram_first_name . ', you entered  *' . $textkw[1] . '*');
           }
   
           return;
       }
       ```
   
 * What am I doing wrong?
 * Thx

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Placeholders’ is closed to new replies.

 * ![](https://ps.w.org/telegram-bot/assets/icon-256x256.png?rev=2981438)
 * [Telegram Bot & Channel](https://wordpress.org/plugins/telegram-bot/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/telegram-bot/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/telegram-bot/)
 * [Active Topics](https://wordpress.org/support/plugin/telegram-bot/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/telegram-bot/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/telegram-bot/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [fabrizio.u](https://wordpress.org/support/users/fabriziou/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/placeholders-3/#post-7234430)
 * Status: resolved