Skip Navigation

[Résolu] Hide controls from wysiwyg editor in pages and custom post types

This support ticket is created Il y a 7 années et 1 mois. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

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)

Marqué : 

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par marcB-6 Il y a 7 années et 1 mois.

Assisté par: Luo Yang.

Auteur
Publications
#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;
}