<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>editor &#8211; Blackbams Blog</title>
	<atom:link href="https://blog.blackbam.at/tag/editor/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.blackbam.at</link>
	<description>development - digital arts - internet</description>
	<lastBuildDate>Sat, 01 Dec 2012 19:35:39 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.1</generator>
	<item>
		<title>WordPress Plugin: Better deactivate visual editor</title>
		<link>https://blog.blackbam.at/2012/12/01/wordpress-plugin-better-deactivate-visual-editor/</link>
					<comments>https://blog.blackbam.at/2012/12/01/wordpress-plugin-better-deactivate-visual-editor/#respond</comments>
		
		<dc:creator><![CDATA[Blackbam]]></dc:creator>
		<pubDate>Sat, 01 Dec 2012 19:34:50 +0000</pubDate>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP Scripts]]></category>
		<category><![CDATA[deactivate]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[visual]]></category>
		<category><![CDATA[wysiwyg]]></category>
		<guid isPermaLink="false">https://blog.blackbam.at/?p=2011</guid>

					<description><![CDATA[As it is happens quite often that the rich editor of WordPress is a barrier concerning posts including difficult HTML, I wrote a Plugin. I am planning to release an improved version to the WordPress Plugin repository soon, but I think this works quite well for now: &#160; // Deactivate Visual Editor if option is [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>As it is happens quite often that the rich editor of WordPress is a barrier concerning posts including difficult HTML, I wrote a Plugin. I am planning to release an improved version to the WordPress Plugin repository soon, but I think this works quite well for now:</p>
<p>&nbsp;</p>
<pre lang="php">
// Deactivate Visual Editor if option is set
add_action('pre_get_posts', 'deactivate_visual_editor');

function deactivate_visual_editor() {
  global $wp_rich_edit;
  $post_id = $_GET['post'];
  
  $value = get_post_meta($post_id, 'deactivate_visual_editor', true);
  if($value == 1)
    $wp_rich_edit = false;
}


// create a box for each post / page
function cis_init(){
	add_meta_box("cis_post_settings", __("Details",TEXTDOMAIN), "cis_post_settings", "page", "normal", "high");
	add_meta_box("cis_post_settings", __("Details",TEXTDOMAIN), "cis_post_settings", "post", "normal", "high");
}

function cis_post_settings() {
    global $post;
    $custom = get_post_custom($post->ID);
	
	// maybe we want to automatize this?
?>
	<div class="inside">
		<table class="form-table" class="customEditor">
			<tr>
				<th><label for="deactivate_visual_editor">Deactivate visual editor?</label></th>
				<td>
					<input type="checkbox" name="deactivate_visual_editor" value="1" <?php if($custom["deactivate_visual_editor"][0]==1) {?>checked="checked"<?php } ?> />
				</td>
			</tr>
		</table>
	</div>
<?php
}

function save_cis_post(){
	global $post;
	
	if ( defined('DOING_AUTOSAVE') &#038;&#038; DOING_AUTOSAVE ) {
		return $post_id;
	}
	if($post->post_type == "post" || $post->post_type == "page") {
		update_post_meta($post->ID, "deactivate_visual_editor", intval($_POST["deactivate_visual_editor"]));
		
	}
}
</pre>
<p><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fblog.blackbam.at%2F2012%2F12%2F01%2Fwordpress-plugin-better-deactivate-visual-editor%2F&#038;title=WordPress%20Plugin%3A%20Better%20deactivate%20visual%20editor" data-a2a-url="https://blog.blackbam.at/2012/12/01/wordpress-plugin-better-deactivate-visual-editor/" data-a2a-title="WordPress Plugin: Better deactivate visual editor"><img src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded>
					
					<wfw:commentRss>https://blog.blackbam.at/2012/12/01/wordpress-plugin-better-deactivate-visual-editor/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
