تخطي التنقل

الوسوم: 

يحتوي هذا الموضوع 0 ردود ، لديه 1صوت.

آخر تحديث بواسطة ralfH-7 قبل 9 أشهر، أسبوعين.

يساعده: Long Nguyen.

الكاتب المشاركات
سبتمبر 13, 2024 في 9:44 ص #16174854

ralfH-7

Background of the issue:
We programmatically created two custom user roles on our site: Editor no taxonomy and Translator. The Editor no taxonomy role has the same permissions as an editor but cannot make any changes to taxonomies. The Translator role has the same permissions as a contributor but cannot publish content. Here is an example of what we added for the Editor no taxonomy role:

$role->add_cap('read');
$role->add_cap('read_private_pages');
$role->add_cap('read_private_posts');

// Add capabilities to edit posts and pages, including translations
$role->add_cap('edit_pages');
$role->add_cap('edit_others_pages');
$role->add_cap('edit_published_pages');
$role->add_cap('edit_posts');
$role->add_cap('edit_others_posts');
$role->add_cap('edit_published_posts');

// WPML specific capabilities for translation editing and viewing other languages
$wpml_caps = [
'wpml_manage_translation_management',
'wpml_manage_languages',
'wpml_manage_string_translation',
'wpml_manage_taxonomy_translation',
'wpml_manage_media_translation',
'wpml_edit_translation',
'wpml_manage_translation_analytics',
'wpml_manage_wp_menus_sync',
'wpml_manage_navigation',
'wpml_manage_troubleshooting',
'wpml_manage_translation_options',
'wpml_operate_woocommerce_multilingual',
'wpml_manage_theme_and_plugin_localization',
'wpml_view_language_switcher', // Ability to view language switcher
];

foreach ($wpml_caps as $cap) {
$role->add_cap($cap);
}

Symptoms:
When accessing WPML signed in as one of these users, the Translation Management interface is empty.

Questions:
Why is the Translation Management interface empty for custom user roles?
Are there additional capabilities required for custom roles to access the Translation Management interface in WPML?