Home › Forums › Calendar Products › Community Events › Use visual editor for event descriptions as default
- This topic has 4 replies, 2 voices, and was last updated 8 years, 2 months ago by Brook.
-
AuthorPosts
-
March 3, 2016 at 3:46 pm #1085075ValrieParticipant
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 🙂March 4, 2016 at 6:03 am #1085193BrookParticipantHowdy 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
March 15, 2016 at 4:14 am #1088996ValrieParticipantHi Brook, thanks for the reply.
A great piece code, the add event form looks awesome now.
Thanks again
Valrie 🙂March 15, 2016 at 4:19 am #1088998ValrieParticipantMy bad, forgot to change option to resolved.
March 15, 2016 at 9:00 am #1089109BrookParticipantPerfect! Really happy that fit your needs. Thanks for getting back.
- Brook
-
AuthorPosts
- The topic ‘Use visual editor for event descriptions as default’ is closed to new replies.