WordPress Multiple Content Blocks: Remove WYSIWYG Editor
So I was looking for a plugin that would allow me to have multiple content blocks with the WordPress admin. If I couldn’t find one, I was going to create one myself. Fortunately for my upcoming work schedule, I found one by Trend Werk. I want to give them a special thanks because their plugin is AWESOME and provides exactly what I needed. I will definitely be looking into their other plugins because this one is great. You can download it through their website http://plugins.trendwerk.nl/documentation/multiple-content-blocks/.
So onto the reason for this blog post. The only thing that I didn’t like about the plugin was that their was no settings where I could disable the WYSIWYG. So I went dumpster diving into the code and made a few edits to fix this. Go in the plugin files and find “multiple_content.php”. Go to lines 134-149. Here is the original code:
-
if(get_usermeta($current_user->ID,'rich_editing') == 'true') {
-
//leave this away when wysigwyg is disabled
-
echo '<a id="edButtonHTML" class="hide-if-no-js" onclick="switchEditors.go(\'multiplecontent_box-'.$fieldName.'\', \'html\');">HTML</a><a id="edButtonPreview" class="active hide-if-no-js" onclick="switchEditors.go(\'multiplecontent_box-'.$fieldName.'\', \'tinymce\');">Wysiwyg</a>';
-
}
-
-
echo '<input type="hidden" name="multiplecontent_box-'.$fieldName.'-nonce" id="multiplecontent_box-'.$fieldName.'-nonce" value="'.wp_create_nonce("multiplecontent_box-".$fieldName."-nonce").'" />'."\n"; //nonce
-
echo '<textarea id="multiplecontent_box-'.$fieldName.'" tabindex="2" name="multiplecontent_box-'.$fieldName.'" cols="158" class="theEditor" rows="15">';
-
$content = get_post_meta($post->ID, '_ot_multiplecontent_box-'.$fieldName , true);
-
echo apply_filters('the_editor_content', $content);
-
echo '</textarea>';
-
echo '<p> </p>';
-
}
-
-
if($editors == 0) {
-
_e('There are no content blocks in this template.','cms');
-
}
Line 134 change from “True” to “False” like this
-
if(get_usermeta($current_user->ID,'rich_editing') == 'false') {
Then on line 140 delete the class “theEditor” like this
-
echo '<textarea id="multiplecontent_box-'.$fieldName.'" tabindex="2" name="multiplecontent_box-'.$fieldName.'" cols="158" rows="3">';
The final product looks like this:


