Redirect to custom admin menu after plugin activation

In this case, “nht_” is a prefix to avoid naming collisions with similar functions. This is a “best practice” to observe when doing your own development.

So if you’re developing something that would be distributed publicly, you should be the habit of applying your own prefix to your function names; and since this particular code snippet is something from another person/plugin, it’s definitely a good idea to replace it with your own. So change “nht_” to something that you would use as a prefix:

register_activation_hook(__FILE__, 'my_custom_prefix_plugin_activate');
add_action('admin_init', 'my_custom_prefix_plugin_redirect');

function my_custom_prefix_plugin_activate() {
    add_option('my_custom_prefix_plugin_do_activation_redirect', true);
}

function my_custom_prefix_plugin_redirect() {
    if (get_option('my_custom_prefix_plugin_do_activation_redirect', false)) {
        delete_option('my_custom_prefix_plugin_do_activation_redirect');
        if(!isset($_GET['activate-multi'])) {
            wp_redirect("edit.php?post_type=headline&page=news-headline");
        }
    }
}

I applied “my_custom_prefix_” in your code where appropriate as an example. Note this not only included function names, but also the wp_option that the setting is saved under. But you would want to change it to something that suits you and/or your plugin.