This code allows you to add a new button in WordPress Visual Editor to directly assign links to open in new tab.
This code will add a "new tab" button in WordPress TinyMCE Visual Editor toolbar.
Write Some Text in Visual Editor. Select and click on edit/insert icon. Give some URL.
Now.. You dont have to click on 'gear' icon each time to select 'open link in new tab'. For few URLs you can follow default approach but if there are a lot of Links in your page which you want to open in New Tab then its kind of pain.
The button called as 'new tab' on editor, you just have to click on that and it will automatically assign target="_blank" and rel="nofollow" to given link.
Support : Feel free to contact in case of any changes or modifications. I will be happy to help you.
Ref : (a) : https://stackoverflow.com/questions/39115564/wordpress-hook-filter-to-process-link-inside-a-post (b) : https://wordpress.stackexchange.com/questions/141344/add-button-in-tinymce-editor-to-insert-text