Add custom pointers in admin area


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. add_action( 'admin_enqueue_scripts', 'my_admin_enqueue_scripts' );
  2. function my_admin_enqueue_scripts() {
  3. wp_enqueue_style( 'wp-pointer' );
  4. wp_enqueue_script( 'wp-pointer' );
  5. add_action( 'admin_print_footer_scripts', 'my_admin_print_footer_scripts' );
  6. }
  7. function my_admin_print_footer_scripts() {
  8. $pointer_content = '<h3>iShift | Notice</h3>';
  9. $pointer_content .= '<p>Added new functions to Edit Post section and few more options for users (authors and subscribers only).</p>';
  10. ?>
  11. <script type="text/javascript">
  12. //<![CDATA[
  13. jQuery(document).ready( function($) {
  14. $('#menu-appearance').pointer({
  15. content: '<?php echo $pointer_content; ?>',
  16. position: 'top',
  17. close: function() {
  18. // Once the close button is hit
  19. }
  20. }).pointer('open');
  21. });
  22. //]]>
  23. </script>
  24. <?php
  25. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.