Skip Navigation

[Resuelto] Hide controls from wysiwyg editor in pages and custom post types

This support ticket is created hace 7 años, 1 mes. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Etiquetado: 

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por marcB-6 hace 7 años, 1 mes.

Asistido por: Luo Yang.

Autor
Mensajes
#580953
Schermafbeelding 2017-10-18 om 13.07.30.png
Screenshot_10.png
Screenshot_11.png
Screenshot_13.png

I am trying to hide Fields and Views,Conditional Output, Show Bootstrap Buttons from wysiwyg editor in pages and custom post types.

Is there any documentation that you are following : https://toolset.com/forums/topic/how-can-i-remove-wysiwyg-augmentations-from-editor-custom-field/

But, Fields and Views,Conditional Output, Show Bootstrap Buttons having same class in Content Template wysiwyg editor so when in put css it hides above controls from Content Template wysiwyg editor as well. I have tried using id of controls as well but they are having different id according to post types.I would like to do this for my all project so need general code.

I do not want to hide above controls from Content Template.Please check attached screenshot.

Thanks

#580963

Dear Marc,

You can add some codes to check if current page is not a editing content template page, if it is, disable that CSS file,
for example, modify the PHP codes as below:

function vm_wptypes_remove() {
//add below line to check if current page is not a editing content template page
	if(isset($_GET['page']) && $_GET['page'] == 'ct-editor'){
		return;
	}
    if ( current_user_can( 'your_role' ) ) {
        wp_enqueue_style( 'wptypes-special', get_stylesheet_directory_uri() . '/wptypes-special.css' );
    }
}
add_action( 'admin_init', 'vm_wptypes_remove' );
#581027

Thanks. I did it using css which will apply to pages and Custom Post types.

.post-php .wp-core-ui .js-wpv-fields-and-views-in-toolbar {
    display: none;
}
#mceu_14 {
    display: none;
}
#mceu_15 {
    display: none;
}
.post-php input[title="Views conditional output"] {
    display: none;
}
.post-php input[title="Show Bootstrap buttons"] {
    display: none;
}