Support

Account

Forum Replies Created

  • Hi @elliot thank you for your input.
    I did follow your recommendation as a temp solution.

    Do you see this being implemented in a future release?
    Having the embed code in both the post’s editor and the ACF WYSIWYG field isn’t ideal.

    Cheers and thanks again!

  • Hey @elliot I really thank you very much for following this up.

    Just to leave clear what the real issue is, its not about the shortcode not printing the form when inserted through an ACF field -because it does- but that the form fails to submit.

    I also created a support topic for the Jetpack plugin in the WordPress repository: https://wordpress.org/support/topic/jetpack-contact-form-shortcode-not-working-when-inserted-via-a-custom-field?replies=1
    …but still waiting for a reply.

    I do think that due to the relevance of both plugins -ACF and Jetpack- this issue shouldn’t be consider as a minor issue.

  • I updated the test site, followed your recommendation and I can confirm that the Jetpack Form shortcode does not work when inserted via an ACF field.

    The code used to display the ACF field is:

    <?php $wysiwyg = get_field('editor');
    if ( $wysiwyg ) {
    	the_field('editor');
    } else {
    	echo 'ACF field is empty';
    } ?>

    The shortcode used to display the Jetpack Form in both tests is:

    [contact-form to='[email protected]' subject='Shortcode Test 1'][contact-field label='Name' type='name' required='1'/][contact-field label='Comment' type='textarea' required='1'/][/contact-form]

  • Hey @elliot thank you for looking into this.

    Basically, the problem is that the form is not submitting.

    If the shortcode were entered through the native WordPress WYSIWYG editor after submitting it should display a message, create a data entry inside Jetpack’s Feedback menu tab and send an email. None of that happens when the shortcode is inserted through an ACF field.

    Please take a look a this tests and try to submit the forms:
    Test 1 http://galo.prompt-dev.com/
    Test 2 http://galo.prompt-dev.com/jetpack-form-shortcode-test-2/

    Any pointers are welcome.

  • Probably you’re right and it has nothing to do with the_content filter.
    I adopted that idea from similar posts of people having the same issue.

    Problem is -although the form is being displayed- it just doesn’t works. But if the shortcode was placed in the default WYSIWYG WordPress editor it would.

    In the example test page provided ( http://galo.prompt-dev.com ) the Jetpack form is being inserted via an ACF WYSIWYG field.

    What could it be then?

  • Hey @Elliot Condon any news on the issue?
    I’m about to publish a project that needs this particular functionality! :S

    Cheers mate and thanks in advance!

  • Hey @Elliot Condon, thanks again for looking into this.
    I’m using this code to print the value of the field in the test page:
    http://galo.prompt-dev.com

    <?php the_content();
    // ACF
    $wysiwyg = get_field('editor');	
    echo $wysiwyg; ?>
    <hr><br>
    <code>print_r($wysiwyg):</code>
    <br><br>
    <pre><?php print_r($wysiwyg); ?></pre>

    When printing the value the form is being displayed, it contains the shortcode’s result (?).

    Also both ACF(v5.1.9) and Jetpack(v3.3.2) plugins are running latest versions.

    If ever needed I can give you access to the test page.
    Cheers!

  • Thanks @Elliot Condon

    I put this little test page up http://galo.prompt-dev.com where:
    Debug is enabled: define('WP_DEBUG', true);
    Inside functions.php I’ve got:

    add_filter('acf/format_value/type=wysiwyg', 'format_value_wysiwyg', 10, 3);
    function format_value_wysiwyg( $value, $post_id, $field ) {
    	$value = apply_filters( 'the_content', $value );
    	return $value;
    }

    Also tried to apply_filters directly when printing the $value but not in combination with the previous function, like this:
    (like suggested here http://support.advancedcustomfields.com/forums/topic/wysiwyg-editor-jetpack-contact-form/ )

    $wysiwyg = get_field('editor');	
    echo apply_filters('the_content', $wysiwyg);

    But still haven’t got it working… I’m trying to add a working Jetpack Contact Form from a WYSIWYG Editor within a Flexible Content Field. The example page is a stand-alone test case using just a WYSIWYG Editor field.

    Find some print screens attached.

  • 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

  • Thanks for pointing me in the right direction.

    Implementation is really easy, this is what I ended up uisng:

    $date = date_i18n("l d F, Y", strtotime(get_field('date_picker')));
    echo $date;

    Cheers!

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