Support

Account

Home Forums Bug Reports WYSIWYG editor + Jetpack Contact Form

Solved

WYSIWYG editor + Jetpack Contact Form

  • Hi there.

    I’m struggling to figure out if this is a ACF issue, or a Jetpack validation issue…

    If I use WordPress’s Jetpack Contact Form inside a WYSIWYG field it doesn’t seem to work properly.

    The form loads correctly (no console errors etc), but when you click submit it won’t do the next step. However if you paste the same contact form shortcode(s) into the main content, it then works…

    Any clues as to what might be causing this? I’d like to use ACF to control the use of added forms on a few projects, but at the moment this doesn’t seem possible.

    ACF version 4.2.2, WordPress 3.7.1

    Many thanks,

    Sam Wells

  • Hi @lingosam

    It may be that the acf WYSIWYG field does not pass the value through the the_content filter.

    This filter is used to look at the WP post_content and modify it.

    Perhaps this will help:

    
    $value = get_field('wysiwyg_field_name');
    echo apply_filters('the_content', $value);
    

    Hope that helps.

    Thanks
    E

  • I added this to my functions file, and replaced the placeholder with my wysiwyg field name.

    Just to confirm, I’ve tried this out and it works.
    Thanks Elliot!

  • Hey Elliot,
    strangely this is not working for me.
    I’m using the WYSIWYG editor within the Flexible Content field and trying to display a Jetpack Contact Form with no success.

    I tried 2 versions of your suggestion for testing and none of them worked.

    First attempt:

    if( have_rows('flexible_content') ):
        while ( have_rows('flexible_content') ) : the_row();
            if( get_row_layout() == 'full_column' ):
    	        $fullWidth = get_sub_field('full_width');
    	        echo apply_filters('the_content', $fullWidth);
            endif;
        endwhile;
    endif;

    Second attempt:

    <?php if( have_rows('flexible_content') ):
        while ( have_rows('flexible_content') ) : the_row();
            if( get_row_layout() == 'two_columns' ):
            	$half1 = get_sub_field('half_1');
            	$half2 = get_sub_field('half_2'); ?>
            	<div class="block group">
    			<div class="col1-2"><?php echo $half1 ? apply_filters('the_content', $half1) : '&nbsp;'; ?></div>
    			<div class="col1-2 last"><?php echo $half2 ? apply_filters('the_content', $half2) : '&nbsp;'; ?></div>
    		</div>
            <?php endif;
        endwhile;
    endif; ?>

    If you can take glance:
    http://texeurop.prompt-dev.com/contact/

    Versions running:
    WP 4.1
    ACF 5.1.8

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘WYSIWYG editor + Jetpack Contact Form’ is closed to new replies.