Introduce Your Plugin With WordPress Pointers
Join the DZone community and get the full member experience.Join For Free
In version 3.3 WordPress released a new feature called pointers. These are little pop-up notification boxes which you can use to point to new information on your WordPress admin area.
This is a great idea if you are a plugin or theme developer, you can make it so that when a user installs your new plugin you can use the pointers to show exactly how they are suppose to use it.
For example if the plugin adds a new menu item to the WordPress admin area, you can use pointers to show the user that there is a new menu item and what it allows you to do with your wordpress site.
You can assign a pointer to be displayed on any HTML ID or class, it is just a jQuery widget which has a title bar, text area and close button.
How To Use Pointers?
// Use the pointers wp_enqueue_style( 'wp-pointer' ); wp_enqueue_script( 'wp-pointer' );
The most basic way of using the pointers will have 2 options the content and the position of the pointer. If you want the pointer to have a title you can add a h3 tag to the content object.
To use this in WordPress all you have to do is put the above all together, below is some example code of how to add a pointer to the admin area. In this example we are just going to add a pointer to the settings menu item, just add the following to your functions.php file.
Published at DZone with permission of Paul Underwood, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.