My code was working up until the 3.2 update, where I noticed that tinyMCE has been updated too.
Does anyone have any ideas why this may not work now? I don't get any console errors but I don't get any tinyMCE editors on the page either!
CLARIFICATION: every instance of the TinyMCE editor has disappeared!
FURTHER CLARIFICATION: this is only occurring on my custom post type pages where I have custom instances of the TinyMCE editor. I still have the default "theEditor" MCE on the default Posts area.
function meta_genus_species() {
global $post;
$genus = get_post_custom_values( 'genus', $post->ID );
$species = get_post_custom_values( 'species', $post->ID );
$etymology = get_post_custom_values( 'etymology', $post->ID );
$family = get_post_custom_values( 'family', $post->ID );
$common_names = get_post_custom_values( 'common_names', $post->ID );
if (!isset($id)) { $id = "etymology"; }
if (!isset($temp_min)) { $temp_min = plugins_url('images/temp_max.png' , __FILE__); }
if (!isset($temp_max)) { $temp_max = plugins_url('images/temp_min.png' , __FILE__); }
if (!isset($pH_min)) { $pH_min = plugins_url('images/pH_max.png' , __FILE__); }
if (!isset($pH_max)) { $pH_max = plugins_url('images/pH_max.png' , __FILE__); }
$tinyMCE = <<<EOT
<script type="text/javascript">
jQuery(document).ready(function($) {
$("#{$id}").addClass("mceEditor");
if ( typeof( tinyMCE ) == "object" &&
typeof( tinyMCE.execCommand ) == "function" ) {
tinyMCE.settings = {
theme : "advanced",
mode : "none",
language : "en",
height:"75",
width:"100%",
theme_advanced_layout_manager : "SimpleLayout",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,temp_min,temp_max,pH_min,pH_max",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
setup : function(ed) {
ed.addButton('temp_min', {
title : 'Temperature: Minimum',
image : '{$temp_min}',
onclick : function() {
ed.focus();
ed.selection.setContent('[temp_min]');
}
}),
ed.addShortcut("ctrl+1", "temp_min", "temp_min"),
ed.addButton('temp_max', {
title : 'Temperature: Maximum',
image : '{$temp_max}',
onclick : function() {
ed.focus();
ed.selection.setContent('[temp_max]');
}
}),
ed.addButton('pH_min', {
title : 'pH: Minimum',
image : '{$pH_min}',
onclick : function() {
ed.focus();
ed.selection.setContent('[pH_min]');
}
}),
ed.addButton('pH_max', {
title : 'pH: Maximum',
image : '{$pH_max}',
onclick : function() {
ed.focus();
ed.selection.setContent('[pH_max]');
}
});
}
};
tinyMCE.execCommand("mceAddControl", true, "{$id}");
}
});
</script>
EOT;
echo $tinyMCE;
?>
<div class="meta_control normal">
<p>Description of taxonomy.</p>
<div class="box">
<label>Genus</label>
<p>
<input name="genus" class="text" value="<?php if(isset($genus[0])) { echo esc_attr( $genus[0] ); } ?>" />
<span>Testing...</span>
</p>
</div>
<div class="box">
<label>Species</label>
<p>
<input name="species" class="text" value="<?php if(isset($species[0])) { echo esc_attr( $species[0] ); } ?>" />
<span>Testing...</span>
</p>
</div>
<p>
<label>Etymology</label>
<textarea cols="50" rows="5" name="etymology" id="etymology"><?php if(isset($etymology[0])) { echo esc_attr( $etymology[0] ); } ?></textarea>
<span>Description</span>
</p>
<p>
<label>Family</label>
<input name="family" class="text" value="<?php if(isset($family[0])) { echo esc_attr( $family[0] ); } ?>" />
<span>Description</span>
</p>
<p>
<label>Common Names</label>
<input name="common_names" class="text" value="<?php if(isset($common_names[0])) { echo esc_attr( $common_names[0] ); } ?>" />
<span>Description</span>
</p>
</div>
<?php
}
function meta_authored() {
global $post;
$species_author = get_post_custom_values( 'species_author', $post->ID );
$year_described = get_post_custom_values( 'year_described', $post->ID );
?>
<div class="meta_control side">
<label>Species Author</label>
<p>
<input name="species_author" class="text" value="<?php if(isset($species_author[0])) { echo esc_attr( $species_author[0] ); } ?>" />
</p>
<label>Year Described</label>
<p>
<input name="year_described" class="text" value="<?php if(isset($year_described[0])) { echo esc_attr( $year_described[0] ); } ?>" />
</p>
</div>
<?php
}
supports
parameter ofregister_post_type()
includeseditor
then everything works fine, but if it doesn't then TinyMCE doesn't even get registered to$wp_scripts
. I'll add a bounty to the question to see if anyone can find an answer. It seems like a lot of changes were made in 3.2, but I haven't been able to pinpoint which ones would cause this.