Skip Navigation

[Resolved] How to disable Fields & Views, CRED and Access button in front-end editor

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to disable the Fields & Views, CRED Forms, and Access buttons in front-end editors?

Solution:
There are individual filters to disable each button, as demonstrated below. The init hook is suitable to use to add such code.

// remove the Fields and Views button
add_filter( 'toolset_editor_add_form_buttons', '__return_false' );
 
// remove the CRED button
add_filter( 'toolset_cred_button_before_print', '__return_false' );
 
// remove the Access button for certain roles
add_filter( 'toolset_editor_add_access_button', function(){
    $roles = array( 'author', 'subscriber' );
    return $roles;
} );

100% of people find this useful.

This support ticket is created 6 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by koheiY 6 years, 8 months ago.

Assisted by: Nigel.

Author
Posts
#629590
2.JPG
1.JPG

I want to hide "CRED FORMS" , "FIELDS AND VIEWS" and "ACCESS" buttons in front-end editor. (1.JPG )
I read https://toolset.com/forums/topic/views-and-access-buttons-appear-in-front-end-editor-when-media-button-enabled/ and add this custom code.

function remove_toolset_buttons(){
    
  if(!is_admin()){
    add_filter( 'toolset_editor_add_form_buttons', '__return_false' );
    add_filter( 'toolset_editor_add_access_button', '__return_false');
  }
}
add_action( 'init', 'remove_toolset_buttons' );

But only "ACCESS" button still remains. (2.JPG)
Could you help me?

#629601

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

You need to specify the roles you want to disable the Access button for.

The various filters and an example of how they are used are here:

		// remove the Fields and Views button
		add_filter( 'toolset_editor_add_form_buttons', '__return_false' );

		// remove the CRED button
		add_filter( 'toolset_cred_button_before_print', '__return_false' );

		// remove the Access button for certain roles
		add_filter( 'toolset_editor_add_access_button', function(){
			$roles = array( 'author', 'subscriber' );
			return $roles;
		} );
#629688

Perfect!
Thank you for your kind help!