Comments on: WordPress action hook contextual_help http://www.studiograsshopper.ch/code-snippets/wordpress-action-hook-contextual-help/ Sun, 22 Mar 2015 14:44:25 +0000 hourly 1 http://wordpress.org/?v=4.1.1 By: Personnaliser l’aide contextuelle de WP » imath.. http://www.studiograsshopper.ch/code-snippets/wordpress-action-hook-contextual-help/#comment-201123 Thu, 03 Jan 2013 20:22:36 +0000 http://www.studiograsshopper.ch/?p=1797#comment-201123 […] Sur le chemin du retour cette idée m’obsède A peine rentré à la maison, j’allume mon bon vieux macbook et un coup de google plus tard je tombe sur ce tutoriel de “studiograsshopper“ […]

]]>
By: 10+ Hacks to add functionality to your Wordpress Theme | gonzoblog.nl http://www.studiograsshopper.ch/code-snippets/wordpress-action-hook-contextual-help/#comment-126299 Wed, 22 Aug 2012 13:01:12 +0000 http://www.studiograsshopper.ch/?p=1797#comment-126299 […] Source […]

]]>
By: How to create custom dashboard help messages http://www.studiograsshopper.ch/code-snippets/wordpress-action-hook-contextual-help/#comment-108763 Fri, 13 Jul 2012 14:01:08 +0000 http://www.studiograsshopper.ch/?p=1797#comment-108763 […] to Studio Grasshopper for the code! If you enjoyed this article, please consider sharing it! tweetmeme_style = […]

]]>
By: Ade http://www.studiograsshopper.ch/code-snippets/wordpress-action-hook-contextual-help/#comment-77738 Mon, 07 May 2012 22:52:06 +0000 http://www.studiograsshopper.ch/?p=1797#comment-77738 Hi Marco,

Glad you found the article useful.

This article is a little out of date now. Take a look at this:
WordPress $current_screen variable for admin screens

]]>
By: Muzietto http://www.studiograsshopper.ch/code-snippets/wordpress-action-hook-contextual-help/#comment-77520 Mon, 07 May 2012 04:08:12 +0000 http://www.studiograsshopper.ch/?p=1797#comment-77520 Hello, and thank you for the useful page.
I didn’t find any follow-up post about page hooks,so I am asking if you could give me some detail.
If I look in the HEAD of my page I don’t see any reference to page hooks. But there is a line inside a small JS snippet that reads:
var pagenow = 'toplevel_page_MoxiemailManagementWidget'
MMWidget is the plugin I am developing.
Is this the $page_hook?
I’m using WP 3.3 and I am in the admin section.
Thanks in advance, Marco

]]>
By: flor http://www.studiograsshopper.ch/code-snippets/wordpress-action-hook-contextual-help/#comment-10373 Thu, 11 Mar 2010 13:12:43 +0000 http://www.studiograsshopper.ch/?p=1797#comment-10373 I figured out that in the add_action function you need to specify the number of arguments the action function takes, which is 2 in this case.

I changed it to: add_action( ‘contextual_help’, ‘my_function’ ,10,2);

I also change the $text variable in the actual function to $contextual_help. Not sure if that is related though.

Flor

]]>
By: Ade http://www.studiograsshopper.ch/code-snippets/wordpress-action-hook-contextual-help/#comment-8698 Sat, 16 Jan 2010 13:47:14 +0000 http://www.studiograsshopper.ch/?p=1797#comment-8698 Hi Philip,

I’ll write up an article on it in the next day or two.

Here’s some info to get you going in the meantime…

Normally you will add your Theme Options page like this (simplified for posting here):

add_action('admin_menu', 'add_my_theme_options_page');
function add_my_theme_options_page() {
	$page_hook = add_submenu_page(args, etc etc);
}

The variable $page_hook is what you want. Of course, you will need to be careful with variable scope to make sure you can access this elsewhere.

A quick way to find your page hook is to look at the Page Source of your Theme Options page – you will see it in the HEAD section.

]]>
By: Philip Downer http://www.studiograsshopper.ch/code-snippets/wordpress-action-hook-contextual-help/#comment-8693 Sat, 16 Jan 2010 07:59:11 +0000 http://www.studiograsshopper.ch/?p=1797#comment-8693 I love this concept. Would be really useful when developing themes for clients’ sites.

Can you offer any links to where I can learn more about how and where page hooks are defined?

]]>
By: Ade http://www.studiograsshopper.ch/code-snippets/wordpress-action-hook-contextual-help/#comment-8661 Thu, 14 Jan 2010 22:07:00 +0000 http://www.studiograsshopper.ch/?p=1797#comment-8661 Hi,

Without seeing all your code it’s difficult to say what the problem may be. You don’t need to make either $screen or $text global because they are the arguments passed to your function by the add_action filter. Without the filter, nothing will work. The code in the article will work in WPMU 2.8.6.

]]>
By: uwiuw http://www.studiograsshopper.ch/code-snippets/wordpress-action-hook-contextual-help/#comment-8656 Thu, 14 Jan 2010 16:26:14 +0000 http://www.studiograsshopper.ch/?p=1797#comment-8656 i love the idea. But i encounter a problem when i try to use your snipet

i got this error code :Warning: Missing argument 2 for my_admin_help() in C:xampphtdocsmyblogwp.comwp-contentpluginsbakaautoblogcoreadminlayout.php on line 31

i believe there’s problem on $screen variabel. i had make it global variabel but it still send error.

by the way, right now i use wpmu Version 2.8.6 as development environtment. i use it using xampp on my localhost. i use your snippet as part of a plugin. i believe where and what version or what kind of wordpress i use is not the main problem. I hope you can help me.

]]>