Displaying a message in the WordPress admin
Displaying a message in the admin WordPress standard means CMS, great code loya of those who write plugins. Try pasting the code in a file function.php and go first to the plugins section, and then to the settings section. When you navigate to your site, a message should be displayed. I haven’t figured out where to use this code yet, but I left it as a note, at the time when I start writing high-quality plugins on my own ).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
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>wp-admin.com.ua | уроки wordpress</h3>'; $pointer_content .= '<p>Читайте наши статьи и пишите сами.</p>'; ?> <script type="text/javascript"> //<![CDATA[ jQuery(document).ready( function($) { $('#menu-appearance').pointer({ content: '<?php echo $pointer_content; ?>', position: 'left', close: function() { // Once the close button is hit } }).pointer('open'); }); //]]> </script> <?php } |
Code snippet example:
Try and test codes, if something is wrong, or is there a better code snippet, write me in the comments, we will refine. Good luck with development!