手机版

给WordPress的编辑后台添加提示框的代码实例分享

时间:2021-09-19 来源:互联网 编辑:宝哥软件园 浏览:

WordPress 3.5新添加了一个提示框功能,可以创建一个提示框,然后指向任何元素,比如下边的例子:

本文就来教你怎么创建一个这样的提示框。

首先需要添加提示框20151225145502025.png  (579337)

的脚本,这样才能使用提示框的射流研究…方法。

//挂载提示框脚本函数bing _ admin _ pointer _ enqueue _ scripts(){ WP _ enqueue _ style(' WP-pointer ');WP _ enqueue _ script(' WP-指针');} add _ action(' admin _ enqueue _ scripts ',' Bing _ admin _ pointer _ enqueue _ scripts ');然后使用指针()方法创建一个简单的提示框:

/** *WordPress后台添加提示框* http://www .结束皮肤。com/admin-help-box/*/function Bing _ add _ pointer _ scripts(){ $ content=' H3请设置主题/H3 ';$内容='p .请为新主题进行简单的配置!';脚本类型='text/javascript' //![CDATA[ jQuery(文档)。就绪(函数($){ $(' #菜单-外观')).指针({//可以指向任何元素content:php echo $内容;位置: { edge: 'left ',align: 'center' },close: function(){ //提示框打开之后做的事情} }).指针('打开');});//]]/脚本?PHP } add _ action(' admin _ print _ footer _ scripts ',' Bing _ add _ pointer _ scripts ');综合代码:

/** *WordPress后台添加提示框* http://www .结束皮肤。com/admin-help-box/*/function Bing _ add _ pointer _ scripts(){ $ content=' H3请设置主题/H3 ';$内容='p .请为新主题进行简单的配置!';脚本类型='text/javascript' //![CDATA[ jQuery(文档)。就绪(函数($){ $(' #菜单-外观')).指针({//可以指向任何元素content:php echo $内容;位置: { edge: 'left ',align: 'center' },close: function(){ //提示框打开之后做的事情} }).指针('打开');});//]]/脚本?PHP } add _ action(' admin _ print _ footer _ scripts ',' Bing _ add _ pointer _ scripts ');//挂载提示框脚本函数bing _ admin _ pointer _ enqueue _ scripts(){ WP _ enqueue _ style(' WP-pointer ');WP _ enqueue _ script(' WP-指针');} add _ action(' admin _ enqueue _ scripts ',' Bing _ admin _ pointer _ enqueue _ scripts ');

版权声明:给WordPress的编辑后台添加提示框的代码实例分享是由宝哥软件园云端程序自动收集整理而来。如果本文侵犯了你的权益,请联系本站底部QQ或者邮箱删除。