Hi Matt,
Thank you for waiting, while I performed some more tests.
The suggested code to remove the access button continues to works as expected on my test websites, but not on yours.
I noticed that your website is using a custom theme and plugins to show the post editor tabs/fields, on the player post type.
As per our support policy ( https://toolset.com/toolset-support-policy/ ), it won't be possible to troubleshoot the custom developed code, but I can suggest an alternative.
You can hide the toolset buttons ( "Access", "Toolset Forms" and "Fields and Views" ), using custom CSS code.
1. First, you can make sure that the user's role is included in the admin area's body class, using a code snippet:
// include a user's role in the body class in the admin area
add_filter( 'admin_body_class', 'include_role_admin_body_class' );
function include_role_admin_body_class( $classes ) {
global $current_user;
foreach( $current_user->roles as $role )
$classes .= ' role-' . $role;
return trim( $classes );
}
2. Next, you can target that user role class through custom CSS code, to hide these buttons, only when the user with the "parent" role is logged-in:
// include custom CSS code to hide the Toolset buttons in the admin area
add_action('admin_head', 'hide_toolset_buttons');
function hide_toolset_buttons() {
echo '<style>
body.role-parent .button.js-wpv-fields-and-views-in-toolbar,
body.role-parent .button.js-cred-in-toolbar,
body.role-parent .button.js-wpcf-access-editor-button {
display: none !important;
}
</style>';
}
Note: The above code snippets too, can be added in active theme's "functions.php" file or Toolset's own custom code area ( ref: https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/ ).
For more personalized assistance around custom code, you can also consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/
regards,
Waqar