Use visual editor for event descriptions as default

Home Forums Calendar Products Community Events Use visual editor for event descriptions as default

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1085075
    Valrie
    Participant

    Hi how you doing,

    I have selected to ‘Use visual editor for event descriptions’ within the Community Events Setting which is great. However I have noticed that because I use ‘text’ when adding events in the back end the descriptions editor on the front end also switches to text. Is there any way to make it default to ‘visual’ as I would like to remove the ‘text’ option.

    Thanks in advance
    Valrie 🙂

    #1085193
    Brook
    Participant

    Howdy Valrie!

    I would love to help you with this. It is totally possible to hide that. You will need to create a theme override for the community add/edit page, which will require a little bit of PHP/theming experience.

    If you’re not already familiar with our Themer’s Guide, then you might want to look it over first so you understand how to create the override. With that in mind, override this file: public_html/wp-content/plugins/the-events-calendar-community-events/src/views/community/edit-event.php On line ~50 of that file you will see if outputs the visual editor using this function: tribe_community_events_form_content(). You will want to replace this function with your own custom code that outputs your modified visual editor.

    I believe the following code is basically what you would want to replace that function with. I actuallyjust copied it from the above function, but I added quicktags=false arg. More info on that here.

    if ( ! empty( $_POST['post_content'] ) ) {
    $post_content = stripslashes( $_POST['post_content'] );
    } else {
    $post_content = '';
    }
    $settings = array(
    'wpautop' => true,
    'media_buttons' => false,
    'quicktags' => false,
    'editor_class' => 'frontend',
    'textarea_rows' => 5,
    );
    
    wp_editor( $post_content, 'tcepostcontent', $settings );

    It might take a little tweaking as I haven’t tested this, but that might even work on its own.

    Does that all make sense? Will that work for you? Please let me know.

    Cheers!

    – Brook

    #1088996
    Valrie
    Participant

    Hi Brook, thanks for the reply.

    A great piece code, the add event form looks awesome now.

    Thanks again
    Valrie 🙂

    #1088998
    Valrie
    Participant

    My bad, forgot to change option to resolved.

    #1089109
    Brook
    Participant

    Perfect! Really happy that fit your needs. Thanks for getting back.

    • Brook
Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Use visual editor for event descriptions as default’ is closed to new replies.