Support

Account

Home Forums Front-end Issues acf_form() always creates two posts Reply To: acf_form() always creates two posts

  • This is how I fixed the problem:
    I used the init hook to load in acf_form_head() like so:

    function form_head() {
      if (!is_admin()) {
        acf_form_head();
      }
    }
    
    add_action('init', 'form_head');

    At first I used the init hook without the is_admin check, this caused that acf_form_head to load twice/post twice.

    The solution is to use the init hook with is_admin() to prevent it loading twice.