Your address will show here +12 34 56 78

Home Forums Custom Work Add visual editor to description field of user dashboard submit

This topic contains 1 reply, has 2 voices, and was last updated by  Wolfram 2 years, 5 months ago.

  • Author
  • #107460


    if you want to add the visual editor to the description field of the user dashboard submit page, than have a look at my solution:

    Change lines 16 to 19 from property_description.php (wpresidence/templates/submit_templates)

    <p class="full_form">
       <label for="description"><?php _e('*Description (mandatory)','wpestate');?></label>
       <textarea id="description"  class="form-control"  name="description" cols="50" rows="6"><?php print $submit_description; ?></textarea>


    <div class="full_form">
       <label for="description"><?php 
       _e('*Description (mandatory)','wpestate'); ?></label>
    $settings = array(
        'textarea_name' => 'description',
        'media_buttons' => true,
    	'wpautop' => true,
    	'editor_class' => 'form-control',
    	'teeny' => false,
        'tinymce' => array(
            'toolbar1' => 'formatselect,forecolor,bold,italic,underline,bullist,blockquote,justifyleft,justifycenter,justifyright,link,unlink,undo,pastetext,wp_adv,removeformat,charmap',
    		'toolbar2' => '',
    wp_editor( $submit_description, 'description', $settings );

    and configure it to your needs.

    Than change lines 321 and 727 from user_dashboard_add.php (theme-folder)
    $submit_description = wp_filter_nohtml_kses( $_POST['description']);
    $submit_description = wpautop( $_POST['description']);

    I recommend to put both files in your child themes folder (maintain the folder structure).

    I’m not sure, if the wpautop is the best solution, but I’m not a programmer and that worked for me.


  • #107461


    Forgot to mention that I added some code to the style.css to format the editor field the way the description field looked:

    iframe#description_ifr {
    	display: block;
    width: 100%;
    height: 400px !important;
    font-size: 13px;
    line-height: 1.42857;
    color: #768082;
    vertical-align: middle;
    background-color: #FFF;
    background-image: none;
    border: 1px solid #F0F0F0;
    border-radius: 4px;
    box-shadow: none;
    transition: border-color 0.15s ease-in-out 0s, box-shadow 0.15s ease-in-out 0s;
    margin-bottom: 13px;

The forum ‘Custom Work’ is closed to new topics and replies.