Site icon Hip-Hop Website Design and Development

Change admin_title of a plugin using code snippet/functions

Been trying to figure out a good method to change the browser tab/window title for a backend admin page for a plugin. I’ve tried a slew of plugins, including Admin Meu Editor Pro, and for whatever reason, it’s just not sticking. Can anybody help?

Here is a code I tried out:

add_filter(  'gettext',  'wpi_translate_words_array'  );
add_filter(  'ngettext',  'wpi_translate_words_array'  );
function wpi_translate_words_array( $translated ) {
     $words = array(
                        // 'word to translate' = > 'translation'
                        'Plugin Name' => 'Change for Browser Tab Title',
  );
     $translated = str_ireplace(  array_keys($words),  $words,  $translated );
     return $translated;
} 

I’ve also tried this code:

/* edit the admin page title for a particular custom post type */
function edit_page_title() {
    global $post, $title, $action, $current_screen;
    if( isset( $current_screen->post_type ) && $current_screen->post_type == 'CUSTOM-POST-TYPE' && $action == 'edit' ) {
        /* this is the new page title */
        $title = 'Change to whatever you want: ' . $post->post_title;           
    } else {
        $title = $title .' - ' .get_bloginfo('name');
    }
    return $title;  
}

add_action( ‘admin_title’, ‘edit_page_title’ )
Also tried out Loco Translate as well as, WP Admin Pages and WP Frontend. Ususally one of the combined methods work so I’m just really puzzled lol

Here are some old topics that I’ve tried out that aren’t bringing any answers, unfortunately. Maybe I just keep revising this when I’m too sleepy:

Greatly appreciate any insight and guidance.