[wp-hackers] contextual_help - understand i this correctly?

Ryan Boren ryan at boren.nu
Tue Nov 18 19:59:11 GMT 2008


On Tue, Nov 18, 2008 at 11:31 AM, Frank Bueltge <frank at bueltge.de> wrote:
> I play with the new help in 2.7
> Is my code correctly, i have write my appreciation on the syntax
>
> THX for your time and help!
>
> // filter for help over all pages in admin?
> add_filter( 'contextual_help_link', array($this, 'contextual_help_link') );
>
>                function contextual_help() {
>                        $contextual_help .= __('test', 'my_plugin');
>
>                        echo $contextual_help;
>                }
>
> // help-content for the different pages?
> add_filter( 'contextual_help', array($this, 'contextual_help') );
>
>                function contextual_help() {
>                        $contextual_help .= '<div class="metabox-prefs">'; // is this important?
>                        $contextual_help .= __('test', 'my_plugin');
>                        $contextual_help .= "</div>\n";
>
>                        echo $contextual_help;
>                }

http://trac.wordpress.org/changeset/9761

Changeset 9761 introduces add_contextual_help().  Use it like so:

$hook = add_object_page('Test Object', 'Test Object', 8, 'mt_object',
'mt_object_page');
    add_contextual_help($hook, 'Testing Help');

That adds your custom help text to the contextual part of the menu
slide down.  If you want to replace the entire content of the slider,
use the contextual_help filter.


More information about the wp-hackers mailing list