Title: edit inline keyboard button
Last modified: April 17, 2020

---

# edit inline keyboard button

 *  Resolved [lorenzo](https://wordpress.org/support/users/ramboelmeio/)
 * (@ramboelmeio)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/edit-inline-keyboard-button/)
 * Hello, i need help for a simple question i think.
    I’d like to change the text
   and url of the button keyboard.
 * I know i would put some code into the funchtion.php and use the **wptelegram_p2tg_inline_keyboard**
   filter but i tried some times but i am not able to.
 * i just need to replace the code:
 *     ```
       $default_button = array(
       	'text' => 'ðŸ”— ' . $inline_button_text,
       	'url'  => self::$post_data->get_field( 'full_url' ),
       	);
       ```
   
 * with this to solve my problem
 *     ```
       $default_button = array(
       'text' => 'ðŸ”— ' . 'INFO',
         'url'  => 'https://t.me/mytelegramuser',
         );
       ```
   
 * but i don’t know how to get it without editing the plugin code directly
 * the compete function in your code is this
 *     ```
       public function get_inline_keyboard( $method_params ) {
   
       $inline_url_button  = $this->options->get( 'inline_url_button' );
       $inline_button_text = $this->options->get( 'inline_button_text' );
   
       if ( 'on' !== $inline_url_button ) {
           return false;
       }
   
       $default_button = array(
            'text' => 'ðŸ”— ' . $inline_button_text,
            'url'  => self::$post_data->get_field( 'full_url' ),
       );
   
       $default_button = (array) apply_filters( 
       'wptelegram_p2tg_default_inline_button', $default_button, self::$post,                 $method_params );
   
       $inline_keyboard[][] = $default_button;
   
       return (array) apply_filters( 'wptelegram_p2tg_inline_keyboard', 
       $inline_keyboard, self::$post, $method_params );
       }
       ```
   
 * How do i apply a filter to edit $default_button array in my functions.php?
 * Thanks so much for your work and your support
    -  This topic was modified 6 years, 1 month ago by [lorenzo](https://wordpress.org/support/users/ramboelmeio/).
    -  This topic was modified 6 years, 1 month ago by [lorenzo](https://wordpress.org/support/users/ramboelmeio/).
    -  This topic was modified 6 years, 1 month ago by [lorenzo](https://wordpress.org/support/users/ramboelmeio/).

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

 *  [Manzoor Wani](https://wordpress.org/support/users/manzoorwanijk/)
 * (@manzoorwanijk)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/edit-inline-keyboard-button/#post-12692833)
 * Here is the custom code you can use
 *     ```
       /* WPTelegram Modify default inline button */
       add_filter( 'wptelegram_p2tg_default_inline_button', function ( $button, $post ) {
   
       	// set the URL of your choice
       	$button['url'] = 'https://t.me/mytelegramuser';
   
       	$button['text'] = 'ðŸ”— ' . 'INFO';
   
       	return $button;
   
       }, 10, 2 );
       /* WPTelegram Modify default inline button */
       ```
   
 * **Note:** You should never modify plugin files, rather you should add the custom
   code to your active/child theme.
 *  Thread Starter [lorenzo](https://wordpress.org/support/users/ramboelmeio/)
 * (@ramboelmeio)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/edit-inline-keyboard-button/#post-12692873)
 * thank you very much!It works!

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

The topic ‘edit inline keyboard button’ is closed to new replies.

 * ![](https://ps.w.org/wptelegram/assets/icon-256x256.png?rev=2500018)
 * [WP Telegram (Auto Post and Notifications)](https://wordpress.org/plugins/wptelegram/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wptelegram/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wptelegram/)
 * [Active Topics](https://wordpress.org/support/plugin/wptelegram/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wptelegram/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wptelegram/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [lorenzo](https://wordpress.org/support/users/ramboelmeio/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/edit-inline-keyboard-button/#post-12692873)
 * Status: resolved