Wordpress Admin Tooltip hooks

I want to know if there is a way to use Wordpress Adminitration Tooltips (de gray and blue ones) that are shown one you

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744886027a4599124.html

相关推荐

  • Wordpress Admin Tooltip hooks

    I want to know if there is a way to use Wordpress Adminitration Tooltips (de gray and blue ones) that are shown one you

    1天前
    50

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信