admin管理员组文章数量:1405134
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.
本文标签: Wordpress Admin Tooltip hooks
版权声明:本文标题:Wordpress Admin Tooltip hooks 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744886027a2630491.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论