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
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘edit inline keyboard button’ is closed to new replies.