I would like to disable Fields and Access & Condition button
I found this thread https://toolset.com/forums/topic/how-to-disable-toolset-buttons-on-post-content-fields-for-non-admins/
But my question is
Instead of adding those codes in functions.php file
can I add those code in custom code tab of Toolbox Settings ?
so that custom codes are organised in one area
Nigel
Supporter
Languages:
English (English )
Spanish (Español )
Timezone:
Europe/London (GMT+00:00)
In this case it is possible, yes.
The code in the thread you linked to uses the init hook to run.
The problem is that the code snippets are not initialised until the init hook itself, with priority 20.
So you can add code snippets so long as the code doesn't need to run until at least the init hook with priority 21.
So the key line in the linked thread code would become:
add_action( 'init', 'remove_toolset_buttons', 21 );
Thanks it works
how to remove "conditional output " button in classic editor of CPTs
Use the following code to remove the "Conditional output" button:
add_filter( 'mce_buttons', 'remove_toggle_button', 999 );
function remove_toggle_button($buttons) {
foreach( $buttons as $i => $button ) {
if ( $button == "wpv_conditional_output" ) {
unset( $buttons[$i] );
}
}
return $buttons;
}
However this code will remove the button from the Visual tab bar. Once you switch to the Text tab, you will still see the button "Conditional output". To remove it from there too, use custom CSS code, using a 3rd party plugin such as Admin CSS:
#qt_content_wpv_conditional{
display: none;
}
My issue is resolved now. Thank you!