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 ).
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 lessons</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!





