Support

Account

Home Forums General Issues Getting ACF value in comment_form()

Solving

Getting ACF value in comment_form()

  • I am setting up a global comment form on our page, using the standard WordPress comment_form() function. The form is just showing on one landing page, then I have a ACF select field, with a couple of pages as options (page_ID : Title).

    I’m struggling with finding any information about how I can dynamically use this select option ID and add it to the comment_form.

    comment_form( $comments_args, page_id );

    I have read that one could do it with AJAX or perhaps a function to update the comment data on save (in effect a second function). But I can’t figure out how to get it to work.

    If anyone has done something similar, I would be happy to hear about it!

  • I was wondering about this too, but ACF just automatically adds the fields to the comment form when you create them in ACF and assign them to Form > Comments

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

You must be logged in to reply to this topic.