Home › Forums › Calendar Products › Community Events › Front-end event editing breaks my map shortcode
- This topic has 20 replies, 5 voices, and was last updated 10 years, 1 month ago by Barry.
-
AuthorPosts
-
January 4, 2014 at 6:44 am #86837elmalakParticipant
Hi,
I am using a Map plugin using a short-code to display a gpx file data on the map, and things work fine until I try to edit the Event using the Community events edit screen, where the code breaks, and here is an example of how that looks.
http://www.trailsleuth.com/event/test-2/I managed to fix this error for the regular Edit Event Screen by preventing the WP auto-formatting functions, but I don’t know how to do the same here using the front-end editor of your plugin so I can hope you can show me how to do this.
Here is the plugin I am using,
Google-Maps-GPX-Viewer
http://www.atlsoft.de/programmierung/google-maps-gpx-viewer/Best regards,
MamdouhJanuary 6, 2014 at 7:12 am #87344CaseyParticipantElmalak,
Take a look at the documentation for the ‘formContentEditor‘ function. This is called from ‘tribe_community_events_form_content‘ on the ‘edit-event.php’ template file.I believe the ‘formContentEditor’ function is what you’ll need to modify in order to disable the auto-formatting, so let me know if that does the trick.
Thanks!
January 8, 2014 at 8:21 am #88538elmalakParticipantI see what you mean.
It seems to me that this line is exactly what I need to disable but I don’t know how,
‘wpautop’ => true,Can you let me know how to disable this or where to do so as I tried adding the following to my functions.php file but it isn’t working.
remove_filter(‘the_content’, ‘wpautop’);
Regards,
January 9, 2014 at 9:34 am #89360CaseyParticipantElmalak,
You’ll have to override these functions by creating new ones in your theme’s functions.php file and then calling them from edit-event.php instead of ‘tribe_community_events_form_content.’Hopefully that gets you started in the right direction. Good luck!
-Casey-
January 10, 2014 at 5:41 am #90075elmalakParticipantHi Casey,
Thank you, but I am afraid that didn’t help me much as things are still vague for me.Do you mean I need to copy this whole code to my theme’s functions.php file, and just replace that part with ?
‘wpautop’ => false,
like so?2100 /**
2101 * Form event content.
2102 *
2103 * @param object $event The event to display the tile for.
2104 * @return void
2105 * @author Nick Ciske
2106 * @since 1.0
2107 */
2108 public function formContentEditor( $event = null ) {
2109 if ( $event == null ) {
2110 $event = get_post();
2111 }
2112 if ( $event ) {
2113 $post_content = $event->post_content;
2114 } elseif ( !empty($_POST[‘post_content’]) ) {
2115 $post_content = stripslashes($_POST[‘post_content’]);
2116 } else {
2117 $post_content = ”;
2118 }
2119
2120 // if the admin wants the rich editor, and they are using WP 3.3, show the WYSIWYG, otherwise default to just a text box
2121 if ( $this->useVisualEditor && function_exists( ‘wp_editor’ ) ) {
2122 $settings = array(
2123 ‘wpautop’ => false,
2124 ‘media_buttons’ => false,
2125 ‘editor_class’ => ‘frontend’,
2126 ‘textarea_rows’ => 5,
2127 );
2128
2129 wp_editor( $post_content, ‘tcepostcontent’, $settings );
2130 } else {
2131 ?><textarea name=”tcepostcontent”><?php
2132 echo esc_textarea($post_content);
2133 ?></textarea><?php
2134 }
2135 }January 10, 2014 at 11:57 am #90234CaseyParticipantelmalak,
Unfortunately since this is advanced functionality that the add-on was not designed for, we can’t really provide step-by-step support for a customization like this. I’m not very familiar with how wp_editor() works, but you can review the documentation here: http://codex.wordpress.org/Function_Reference/wp_editorGood luck and hope that helps you get started! Thanks!
-Casey-
January 10, 2014 at 11:59 am #90236CaseyParticipantElmalak,
I also forgot to mention that we have a list of external developers that we recommend for making complex customizations like these. If you’re interested, I’d be happy to send that your way. Just let me know!Cheers,
CaseyJanuary 10, 2014 at 12:39 pm #90249elmalakParticipantHi Casey,
Thank for your responses.I managed to fix this for the normal WordPress Edit screen but the same function that worked there isn’t working with the community events add-ons that’s why I thought I would ask you as you’re the developers behind this plugin.
I am not really asking for anything complicated, I believe it’s a simple thing that a developer would know about his plugin, am I wrong?
Regards,
January 10, 2014 at 1:08 pm #90257RobMemberHey there elmalak. Thanks for your post here…Casey and I were just reviewing this and I wanted to see if I could try and help get things sorted here. Unless I’m misunderstood, this sounds to us like it is a conflict specifically with whatever third party plugin you’re using to add the additional button the visual editor.
While Casey has tried to point you in the right direction here best we could, I’m not sure it’d be appropriate to get our developers involved to fix a conflict with this third-party plugin just yet. Would you mind linking us to the dot-org page for that plugin, so we can check it out and see if we’ve got any other threads related to similar conflicts?
That’s about as much as I can offer up at the moment. I’m sorry we can’t do more and I hope you understand where we’re coming from regarding how deep we can or cannot go. If we’re misunderstood as to the source of the problem here, please let us know.
January 10, 2014 at 1:17 pm #90259elmalakParticipantHi Rob,
Thank you for offering to help me out here.
Actually the button thing was the beginning of this and when all attempts to load the button in the visual editor of your Community events form failed, we thought we could just used shortcodes to display the map instead of using the button.
And as we did so things went on nicely, however, while trying to Edit an event using the front-end Edit screen I noticed that the shortcodes gets messed up when opened in this screen.I used to have this same problem when editing from the backend but I managed to get this sorted out by adding the line,
remove_filter(‘the_content’, ‘wptexturize’);
to my functions.php file.All I was asking for is a similar code that would do the same thing to the Visual editor that is loaded in the community events front-end edit screen so it would act in the same way and not break the shortcode of the map.
Hope this makes things clearer for you and I really look forward to your help here.
Here is the map plugin website, in case that would help.Regards,
January 13, 2014 at 1:43 pm #91421CaseyParticipantelmalak,
We’ll definitely try to go above and beyond for you on this one, but before we do, I noticed that the user account you’re using to post in the Community forum doesn’t currently have a Community License associated with it. Is there another user account that was used to purchase this add-on? If so, just post a reply with that account here so we can continue to provide you support for the Community add-on.So sorry for the formality as I’m sure this is unintentional, but we have to make sure we’re only providing support for those with active licenses.
Thanks so much for understanding!
-Casey-
January 14, 2014 at 2:32 am #92011elmalakParticipantHi Casey,
Here is the username we used to purchase the Community events license.
thinkwebieRegards,
elmalakJanuary 14, 2014 at 6:20 am #92083CaseyParticipantelmalak,
Thanks for confirming that! As I said before, we’ll definitely go above and beyond to help you with this request, just note that we don’t normally offer support for customizations. I’ve opened a ticket with one of our developers to look into a way to disable wptexturize() for the front-end WYSIWYG editor.I’ll post a reply here when I hear back from him, so please stay tuned and I’ll let you know when I have more information.
Thanks!
January 14, 2014 at 6:31 am #92096elmalakParticipantThanks Casey,
I greatly appreciate that and I look forward to hearing back from you with the solution for this issue.
Regards,January 17, 2014 at 8:37 am #94039CaseyParticipantElmalak,
Thanks for your patience! I just heard back from our developer on this, and he suggested removing it by filtering on do_shortcode. Try adding this to your theme’s functions.php file and let me know if that does the trick:
add_action( 'tribe_ce_before_event_submission_page', 'my_remove_shortcode_filter' );
function my_remove_shortcode_filter () {
remove_filter( 'the_content', 'do_shortcode', 11 );
}
Thanks!
-Casey-
-
AuthorPosts
- The topic ‘Front-end event editing breaks my map shortcode’ is closed to new replies.