场景是这样的:我有一个menubar.js脚本,当页面加载时,它向服务器查询用户的权限,然后基于这些权限创建一个菜单栏。代码片段:
$(function () {
//initialize the header buttons according to user's permissions
InitializeCurrentUser();
});
function InitializeCurrentUser() {
//get current user
$.ajax(
{
url: "..
我正在为wordpress开发一个在页面中加载javascript的插件。但是我希望这个插件只在选定的页面上加载。不是所有的页面。有人能建议一下如何做到这一点吗?下面是代码。
add_action('wp_enqueue_scripts', 'soundninja_enqueue');
function soundninja_enqueue($hook)
{
wp_enqueue_script('soundninja', // id
'http://soundninja.github.io/SNtest/build
我正在尝试获取当前页面的url,并将其存储到自定义皮肤模板中的变量中。我试图这样做,以便我可以使用这个网址用于其他目的。我想做这样的事
function currentpageurl() //Some Custom function
{
$url= [something that can get current page's url in mediawiki and store it to this variable]
.....use the $url variable for other purposes....
......
.....
}
Med