I’m trying to add the following custom element using TinyMCE…
<g:plusone size="small" callback="plusone_vote"></g:plusone>
I’ve added g:plusone to extended_valid_elements ( with two attributes ) and custom elements but it still gets removed when I click update on the code view window. TinyMCE init now looks like this..
tinyMCESettings = {
mode: "textareas",
theme: "advanced",
editor_deselector: "nomce",
plugins: "paste,iespell,table,style",
extended_valid_elements: "g:plusone[size|callback],script[type|src|defer|charset]",
custom_elements: "g:plusone,~g:plusone",
valid_children: "+p[g:plusone]",
entity_encoding: "raw",
convert_urls: false,
content_css: "{/literal}{$tinyMCEcss}{literal}",
setup: function(ed) {
ed.onSaveContent.add( tinyMCE_GWO_Decode );
ed.onBeforeSetContent.add( tinyMCE_GWO_Encode );
ed.onGetContent.add( tinyMCE_GWO_Decode );
}
};
Anyone have any suggestions?
Have a look at the valid_children setting. You might need to add your tag as valid child there.
UPDATE: Modify your extended_valid_elements setting to
this works (at least with my tinymce editor)