• As of WordPress 3.x I understand there are now “pointers”. I have learned how to insert a point into the WordPress backend, but I can’t seem to find any documentation on how to tell it where to point!

    Can anyone help?

    add_action( 'admin_enqueue_scripts', 'my_admin_enqueue_scripts' );
    function my_admin_enqueue_scripts() {
        wp_enqueue_style( 'wp-pointer' );
        wp_enqueue_script( 'wp-pointer' );
        add_action( 'admin_print_footer_scripts', 'my_admin_print_footer_scripts' );
    }
    function my_admin_print_footer_scripts() {
        $pointer_content = '<h3>Title</h3>';
        $pointer_content .= '<p>Example content.</p>';
    ?>
       <script type="text/javascript">
       //<![CDATA[
       jQuery(document).ready( function($) {
        $('#menu-appearance').pointer({
            content: '<?php echo $pointer_content; ?>',
            position: 'bottom',
            close: function() {
                // Once the close button is hit
            }
          }).pointer('open');
       });
       //]]>
       </script>
    <?php
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Spencer Hill

    (@s3w47m88)

    Okay, after more digging I discovered this code:

    position: {
    	my: 'left top', // I don't know why "my" or "at" represent but I'm assuming you can replace these values with something like right and bottom, etc...
    	at: 'center bottom',
    	offset: 'x y' // Replace x and y with the relevant values.
    }

    I’m simply not finding any official, or unofficial for that matter, API documentation. If I do I’ll try to remind myself to update this for future seekers.

    Now I’m wondering how to close one and automatically open another immediately after.

    Have you made any progress on this front?

    Thread Starter Spencer Hill

    (@s3w47m88)

    Unfortunately I haven’t had the opportunity to revisit this yet. But thanks for posting because it reminded me I need to make this a priority!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to place "wp pointers", need help…’ is closed to new replies.