Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am trying to modify the support links under the help section (Contextual help).I want to replace these Documentation on Using Themes and Support Forums with my own .So I removed the links in wp-admin folder from many pages under admin section .But for plugin pages,I can't able to find the files to remove.

Is there any way to replace or remove the links site wide ?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

But for plugin pages,I can't able to find the files to remove.

For dealing with plugin/registered pages that you won't necessarily know the hooks for, something like this will work...

add_action( 'admin_head', 'set_plugin_help_text');
function set_plugin_help_text() {
    global $_registered_pages;
    if( !empty( $_registered_pages ) )
        foreach( array_keys( $_registered_pages ) as $hook )
            add_contextual_help( $hook, "Your generic plugin page help text" );
}

NOTE:
I purposely didn't use the contextual help action(as used in RodeoRamsey's answer) because it doesn't work for the above approach(so it wasn't without reason, i notice the other answer got more votes and i presume that *may* be why).

Of course do note that the custom-background, custom-header and the theme editor pages under the themes menu also count as registered pages, so they'll naturally be effected by the above code (you can always factor some exclusion code into the above to deal with that though).

EDIT BELOW:
Additionally if you want to modify the help text for pages that aren't registered, ie. those that exist physically in WordPress and are used by WordPress, you can use the following approach.

add_filter( 'contextual_help_list', 'wp_help_info_replace', 10000000, 2 );
function wp_help_info_replace( $help, $screen ) {
    if( in_array( $screen->id, array( 'post', 'edit-post' ) ) )
        $help[$screen->id] = 'Simple example help text';
    return $help;
}

In the above example i'm targetting edit.php and post-new.php, be sure to pay attention to the array values that refer to the screen ID, this value does not match what you'd typically expect to see as the pagehook, i would suggest echo'ing out the screen ID for screens where you're unsure about what the ID may be.

share|improve this answer
    
@t3los It worked for me. That's exactly what I need to replace "Contextual help" for Plugins. Could you please let me know how to replace the same "Contextual Links" for default WordPress Admin pages like...wp-admin/,posts-new.php,themes.php and all other Dashboard pages. That would be more convenient for my users to get forum and email help from me . Thanks! –  user391 Jun 29 '11 at 14:39
    
Have updated my answer with some sample code on how to replace help text on non-registered pages, ie. native WordPress pages(such as the post editor screen, and so on..). –  t31os Jul 8 '11 at 13:29
    
t31os , Thanks for the code. I could able to use my own help text with your help. I have added almost all the arrays for pages...options-media,options-privacy etc. Some pages like link-add.php are not giving exact screen id. No worries,I will try and update you –  user391 Jul 18 '11 at 11:09

Put this in your theme's function.php file:

//function to edit help screen contents
    function my_plugin_help($contextual_help, $screen_id, $screen) {

        global $my_plugin_hook;
        if ($screen_id == $my_plugin_hook) {

            $contextual_help = 'This is where I would provide help to the user on how everything in my admin panel works. Formatted HTML works fine in here too.';
        }
        return $contextual_help;
    }

add_action('contextual_help', 'my_plugin_help', 10, 3);

Modify to suit your needs. Don't delete or change things from the core (wp-admin folder) - it will only get overwritten every time you upgrade.

Visit http://codex.wordpress.org/Adding_Contextual_Help_to_Administration_Menus for more help.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.