php - 我想为除管理员之外的所有用户隐藏自定义 yith pos 选项卡。我怎样才能做到这一点?
问题描述
我想为除管理员之外的所有用户隐藏自定义 yith pos 选项卡。我怎样才能做到这一点?
截屏 :
我试过了,但没有用
add_filter( 'yith_pos_panel_settings_tabs_array', 'filter_yith_pos_panel_settings_tabs_array', 200, 1 );
function filter_yith_pos_panel_settings_tabs_array( $tabs_array ) {
// Only for "shipping_manager" user role
if( current_user_can( 'YITH_POS_Manager' ) ) {
// Remove some specific tabs
unset( $tabs_array['customization'],
}
return $tabs_array;
}
解决方案
推荐阅读
- c# - Designer.cs 源代码控制困境
- javascript - 无法删除 Chrome devtool for mac 中的 dom 断点
- python - 如何读取不区分大小写的列名 pandas 字符串
- ruby - 以特定格式提取 URL 的一部分
- javascript - 使用在 jquery 的另一个函数中定义的变量
- java - 如何从共享首选项中获取数据到 RecylerView 适配器并传递到下一个片段
- c# - NHibernate 投影查询
- python-3.x - 如何处理pandas读取JSON过大整数值会一样
- c# - 如何识别word文档中的段落和表格
- javascript - MouseEvent 在 IE 中不起作用,还有其他方法吗?