event_booking_form shortcode gives garbled output

WordPress Event Management, Calendars & Registration Forums Report A Bug event_booking_form shortcode gives garbled output

This topic contains 2 replies, has 2 voices, and was last updated by  Per Soderlind 8 years, 11 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #16842

    The shortcode [event_booking_form event_id="181"] returns the following garbled content:

    http://blogg.regjeringen.no/euikt15/pamelding-til-euikt15/

    Per Soderlind
    #16854

    Hi Per,

    I’ve not been able to replicate this. How are you using the shortcode? Just in page/post content?

    This could be a conflict with another plug-in (or some custom code). As an example, I recently saw something similar where a user had created an [email] shortcode, and had added the line:

    add_filter( 'the_content', 'do_shortcode' );
    

    This passed the HTML content of the event (containing the booking form) through do_shortcode and meant HTML containing [email] (e.g. <input name="eo_booking[email]"...>) was altered, and caused the booking form to always reject a booking because no email was provided.

    While I don’t think that exact same thing is happening here, the point is that anything acting on the the_content could potentially cause this. If you’re not aware of any custom code you’ve added yourself that might cause this, then I’d recommend deactivating other plug-ins to identify if there is a conflict. If there is, I’d be happy to take a look to see if they problem can be worked around.

    Stephen Harris
    #16867

    Thank you for pointing me in the right direction. I found the reason (i.e. my code). I’m modifying an oembed and have disabled wptexturize and wpautop. I add it back for the part of the content that’s not part of the oembed using the following code:

    function nettv_no_autop($content) {
    $new_content = '';
    $pattern_full = '{(<div class="webBroadcastBlock">.*?</div><!--/webBroadcastBlock-->)}is';
    $pattern_contents = '{(<div class="webBroadcastBlock">(.*?)</div><!--/webBroadcastBlock-->)}is';
    $pieces = preg_split($pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE);
    
    foreach ($pieces as $piece) {
        if (preg_match($pattern_contents, $piece, $matches)) {
            $new_content .= $matches[1];
        } else {
            $new_content .= wptexturize(wpautop($piece));
        }
    }
    return $new_content;}
    remove_filter('the_content', 'wpautop');
    remove_filter('the_content', 'wptexturize');add_filter('the_content', 'nettv_no_autop', 99);
    

    Back to the drawing board :/

    Per Soderlind
Viewing 3 posts - 1 through 3 (of 3 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.