Wordpress Admin Tooltip hooks

admin2025-04-17  0

I want to know if there is a way to use Wordpress Adminitration Tooltips (de gray and blue ones) that are shown one you update your worpdress (3.x). Showing the new features.

Thanks!

I want to know if there is a way to use Wordpress Adminitration Tooltips (de gray and blue ones) that are shown one you update your worpdress (3.x). Showing the new features.

Thanks!

Share Improve this question asked Mar 19, 2012 at 5:02 jepserjepser 4532 gold badges9 silver badges21 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 7

Here is the simplest implementation I know of since there is no real API:

//add the needed scripts and styles
add_action('admin_enqueue_scripts', 'wpse_46028_enqueue_admin_scripts');
function wpse_46028_enqueue_admin_scripts() {
    wp_enqueue_style('wp-pointer');
    wp_enqueue_script('wp-pointer');
    //hook the pointer 
    add_action('admin_print_footer_scripts', 'wpse_46028_print_footer_scripts' );
}
function wpse_46028_print_footer_scripts() {
    $pointer_content = '<h3>WordPress Answers</h3>';
    $pointer_content .= '<p>This is your pointer content</p>';
?>
   <script type="text/javascript">
   //<![CDATA[
   jQuery(document).ready( function($) {
    //jQuery selector to point to 
    $('#menu-dashboard').pointer({
        content: '<?php echo $pointer_content; ?>',
        position: 'top',
        close: function() {
            // This function is fired when you click the close button
        }
      }).pointer('open');
   });
   //]]>
   </script>
<?php
}

There is always a way, as shown by some plugins utilizing these pointers, but they are currently meant as an internal core feature and thus have no real API for use.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1744886028a272540.html

最新回复(0)