Forums

TinyMCE on Profile page (33 posts)

  1. kylegetson
    Member
    Posted 4 months ago #

    I have tried this with no success on version 2.7. I wrote a function to display it... This seems to be the only way I could get it to work:

    function get_WYSIWYG($id='content',$name='content',$value=''){
    	$editor =<<<HTML
    				<script type="text/javascript" src="/wp-includes/js/tinymce/tiny_mce.js"></script>
    				<script type="text/javascript">
    					<!--
    					tinyMCE.init({
    					theme : "advanced",
    					skin:"wp_theme",
    					theme_advanced_buttons1:"bold,italic,strikethrough,underline,separator,bullist,numlist,outdent,indent,separator,justifyleft,justifycenter,justifyright,separator,link,unlink,separator,styleprops,separator,separator,spellchecker,search,separator,fullscreen,wp_adv",
    					theme_advanced_buttons2:"fontsizeselect,formatselect,pastetext,pasteword,removeformat,separator,charmap,print,separator,forecolor,emotions,separator,sup,sub,separator,undo,redo,attribs,wp_help",
    					theme_advanced_buttons3:"",
    					theme_advanced_buttons4:"",
    					language:"en",
    					spellchecker_languages:"+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv",
    					theme_advanced_toolbar_location:"top",
    					theme_advanced_toolbar_align:"left",
    					theme_advanced_statusbar_location:"bottom",
    					theme_advanced_resizing:"1",
    					theme_advanced_resize_horizontal:"",
    					dialog_type:"modal",
    					relative_urls:"",
    					remove_script_host:"",
    					convert_urls:"", apply_source_formatting:"", remove_linebreaks:"1", paste_convert_middot_lists:"1", paste_remove_spans:"1",
    					paste_remove_styles:"1",
    					gecko_spellcheck:"1",
    					entities:"38,amp,60,lt,62,gt",
    					accessibility_focus:"1", tab_focus:":prev,:next",
    					wpeditimage_disable_captions:"",
    					plugins:"safari,inlinepopups,autosave,spellchecker,paste,wordpress,fullscreen,-emotions,-print,-searchreplace,-xhtmlxtras,-advlink,",
    					mode : "exact",
    					elements : "{$id}",
    					width : "565",
    					height : "200"
    					});
    					-->
    				</script>
    				<textarea id="{$id}" name="{$name}">{$value}</textarea>
    HTML;
    return $editor;
    }

    Now any time I need the editor, I just echo get_WYSIWYG($id,$name,$value);

    hope that helps anyone that was having the same issue.

  2. WebTechGlobal
    Member
    Posted 2 months ago #

    I don't get why you guys have so much code but then my version doesnt work yet because content on submission is the original content put into the editor on loading.

    None of your methods work for me! You all talk like you just put that code in your page then use the function but it always creates a blank page.

    This is what displays the editor for me but as I said not perfect yet.

    <?php

    wp_tiny_mce(true);
    add_filter('teeny_mce_buttons', 'teeny_mce_buttons');
    wp_enqueue_script('page');
    wp_enqueue_script('editor');
    do_action('admin_print_scripts');

    wp_enqueue_script('thickbox');
    add_action( 'admin_head', 'wp_tiny_mce' );
    wp_enqueue_script('editor');
    add_thickbox();
    wp_enqueue_script('media-upload');
    wp_enqueue_script('word-count');

    the_editor($post_content, 'content');

    ?>

  3. dojopan
    Member
    Posted 1 day ago #

    @ R-A-Y

    I found that Brayne's second solution works perfectly.

    @ Brayne

    THANK YOU!

Reply

You must log in to post.

About this Topic