-
I was finded away add TinyMCE editor to Front-end publish function.
I think it will help someone want to add rich editor to userpro front-end publish.
First you need install TinyMCE plugin into your wp,
Open file functions/frontend-publisher-funtions.php and find :
PHP123456789101112function userpro_post_editor($i, $class, $args) {if (!isset($args['require_content'])) {$args['require_content'] = 1;} // default for content: required?><div class="userpro-field userpro-field-editor" data-key="<?php echo $class; ?>"><div class="userpro-input"><?phpecho "<textarea data-custom-error='".__('Provide some content','userpro')."' data-required='".$args['require_content']."' class='normal' type='text' name='$class-$i' id='$class-$i' placeholder='".__('Enter content here...','userpro')."'></textarea>";?></div></div><div class="userpro-clear"></div><?php}and replace to :
PHP12345678910111213141516171819202122232425262728function userpro_post_editor($i, $class, $args) {$settings = array('wpautop' => true,'media_buttons' => false,'tinymce' => array('theme_advanced_buttons1' => 'bold,italic,underline,blockquote,|,undo,redo,|,fullscreen','theme_advanced_buttons2' => '','theme_advanced_buttons3' => '','theme_advanced_buttons4' => ''),'quicktags' => array('buttons' => 'b,i,ul,ol,li,link,close'));if (!isset($args['require_content'])) {$args['require_content'] = 1;} // default for content: required?><div class="userpro-field userpro-field-editor" data-key="<?php echo $class; ?>"><div class="userpro-input"><?phpecho wp_editor('aaaa',$class.'-'.$i,$settings);?></div></div><div class="userpro-clear"></div><?php}😀 back to front-end page and check it :d
Bi Heo Bmt ,
Can you share your file, or a txt file ?The code does not display correctly !
thanks
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.