下面的截图说明了一切。我想从视图中删除/隐藏此字段,以便用户无法编辑它。它来自用户角色编辑器插件,我想对函数进行更改。子主题中的php。
据我所知,创建选项的代码来自插件文件夹/包括/类/用户其他角色。php。
我试着把整个函数放到子主题函数中。php并注释掉“select\\u roles”行,但这不起作用。
public function load_js($hook_suffix) {
if (!in_array($hook_suffix, array(\'user-edit.php\', \'user-new.php\'))) {
return;
}
$select_primary_role = apply_filters(\'ure_users_select_primary_role\', true);
wp_enqueue_script(\'jquery-ui-dialog\', \'\', array(\'jquery-ui-core\', \'jquery-ui-button\', \'jquery\'));
wp_register_script(\'ure-jquery-multiple-select\', plugins_url(\'/js/jquery.multiple.select.js\', URE_PLUGIN_FULL_PATH));
wp_enqueue_script(\'ure-jquery-multiple-select\');
wp_register_script(\'ure-user-profile-other-roles\', plugins_url(\'/js/user-profile-other-roles.js\', URE_PLUGIN_FULL_PATH));
wp_enqueue_script(\'ure-user-profile-other-roles\');
wp_localize_script(\'ure-user-profile-other-roles\', \'ure_data_user_profile_other_roles\', array(
\'wp_nonce\' => wp_create_nonce(\'user-role-editor\'),
\'other_roles\' => esc_html__(\'Other Roles\', \'user-role-editor\'),
\'select_roles\' => esc_html__(\'Select additional roles for this user\', \'user-role-editor\'),
\'select_primary_role\' => ($select_primary_role || $this->lib->is_super_admin()) ? 1: 0
));
}