我尝试使用一些自定义功能创建用户角色.这到目前为止工作.但是如果我想用函数检查一个特定功能的用户权限,current_user_can()则返回false.但是在新创建的角色的capabilities数组中,特定功能设置为true.
所以给我的话多一点编码背景:
角色对象
WP_Role {
["name"]=> "organizer"
["capabilities"]=> {
["edit_posts"] => bool(false)
["delete_posts"] => bool(false)
["publish_posts"] => bool(false)
["upload_files"] => bool(true)
["edit_event"] => bool(true)
["read_event"] => bool(true)
["delete_event"] => bool(true)
["edit_events"] => bool(true)
["edit_others_events"] => bool(false)
["publish_events"] => bool(false)
["read_private_events"] => bool(true)
["read"] => bool(true)
["delete_events"] => bool(true)
["delete_private_events"] => bool(false)
["delete_published_events"] => bool(true)
["delete_others_events"] => bool(false)
["edit_private_events"] => bool(false)
["edit_published_events"] => bool(true)
["manage_event_terms"] => bool(true)
["edit_event_terms"] => bool(true)
["delete_event_terms"] => bool(true)
["assign_event_terms"] => bool(true)
}
Run Code Online (Sandbox Code Playgroud)
我的角色扮演功能
add_role( …Run Code Online (Sandbox Code Playgroud) 我想知道是否有可能使用Javascript在iOS和Android上触发"保存图像"触摸标注.标注是由长按触发的,但即使我尝试模拟它,它也不起作用.
我想实现这样的事情:
jQuery('img').openCallout();
Run Code Online (Sandbox Code Playgroud)
到目前为止我试过这个:
jQuery: jQuery('img').contextmenu();
jQuery Mobile: jQuery('img').taphold();
当我尝试使用import()函数导入动态组件时,我收到以下错误:
[Vue warn]: Failed to resolve async component: function () {
return __webpack_require__("./src/components/types lazy recursive ^\\.\\/field\\-.*$")("./field-" + _this.type);
}
Reason: Error: Loading chunk 0 failed.
Run Code Online (Sandbox Code Playgroud)
不幸的是我不知道是什么导致了这个错误.由于发行说明,我已经尝试在vue-loader配置中将esModule设置为false .
我使用vue-cli 2.9.2和webpack模板来设置这个项目,这是实际组件的代码:
<template>
<div>
<component :is="fieldType">
<children/>
</component>
</div>
</template>
<script>
export default {
name: 'DynamicComponent',
props: {
type: String,
},
computed: {
fieldType () {
return () => import(`./types/type-${this.type}`)
}
}
}
</script>
Run Code Online (Sandbox Code Playgroud)
[已解决]
上面的代码有效.问题是基于Loading chunk 0 failed边缘情况.使用webpack设置,output: {publicPath: '/'}它提供相对于根而不是其原点的块.当我在我的外部服务器中嵌入http:// localhost:8080/app.js并从那里调用导入函数时,链接的块URL是http://myserver.com/0.js而不是http:// …
我希望 nuxt.js 的路由完全动态,因为我无法预测用户及其对他想要的级别数量的偏好。
因此,一个用户将创建一个如下所示的页面:
http://localhost/parent/level-1/level-2/
其他一些人会这样做:
http://localhost/parent/level-1/level-2/level-3/level-4/level-5/level-6/level-7/
nuxt.js 有没有办法处理这种无限嵌套路由?
我尝试在不使用 API 的情况下从 Instagram 检索一些公开的个人资料数据。我已经使用file_get_contents并提取了_sharedData. 但是这种方法会极大地降低性能(加载 5 秒),因此对于生产来说是无意义的。
我在一个stackoverflow 问题中看到,他们调用http://instagram.com/web/search/topsearch/?query=user_id来访问至少关注者的数量。但没有进一步的细节。
是否有关于此网络搜索的任何文档或使用 Instagram 网络搜索访问公共资料数据的一些解决方案?我至少需要媒体、追随者和追随者的计数。
javascript ×2
vue.js ×2
android ×1
callout ×1
instagram ×1
ios ×1
nuxt.js ×1
php ×1
routes ×1
user-roles ×1
web ×1
web-search ×1
wordpress ×1