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 badges2 Answers
Reset to default 7Here 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
评论列表(0条)