- 状态
- 已解决
- 报告针对
- WPML Multilingual & Multicurrency for WooCommerce 5.4.0
- 解决于
- WooCommerce Multilingual & Multicurrency 5.4.4
- 主题标签
- WCML
问题概述
WCML 5.4.0 更新了 UI,在 WooCommerce > WPML Multilingual & Multicurrency for WooCommerce & 多货币 处显示了一个新的“翻译分类法”按钮。
商店管理员可以看到该按钮,但如果单击它,则会显示“抱歉,您无权访问此页面”的消息,因为商店管理员没有访问 WPML > 分类翻译 页面的权限。
临时解决方法
商店管理员默认没有翻译分类法的权限。一个选项是通过向您的站点添加此代码,直接授予商店管理员该权限:
/**
* Expand shop_manager caps to be able to translate taxonomies
*/
add_filter( 'user_has_cap', 'wssupp_boost_caps', 10, 1 );
function wssupp_boost_caps( $allcaps ){
$newcaps = array();
if ( isset( $allcaps['shop_manager'] ) && $allcaps['shop_manager'] ) {
$newcaps = [
"wpml_manage_taxonomy_translation" => true
];
}
return array_merge( $allcaps, $newcaps );
}