How to Add Custom Button to Text(HTML) Editor and NOT Visual Editor

I followed this tutorial which is adding a custom button into Visual Editor as it is supposed to. But this is not adding the button into the Text(HTML) Editor. Can you please let me know how I can add my own button into Text(HTML) Editor only (or at least both! and not Visual one)

function enqueue_plugin_scripts($plugin_array)
{
    //enqueue TinyMCE plugin script with its ID.
    $plugin_array[green_button_plugin] =  plugin_dir_url(__FILE__) . index.js;
    return $plugin_array;
}

add_filter(mce_external_plugins, enqueue_plugin_scripts);

function register_buttons_editor($buttons)
{
    //register buttons with their id.
    array_push($buttons, green);
    return $buttons;
}

add_filter(mce_buttons, register_buttons_editor);

Topic html-editor visual-editor theme-development Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.