Home › Forums › Front-end Issues › ACF Form Error Messages
Hi Guys,
Calling Front End acf_form
Creates The Following :-
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/sites/i/ispiel.me/public_html/wp-content/plugins/advanced-custom-fields/core/api.php on line 1100
Warning: Invalid argument supplied for foreach() in /var/sites/i/ispiel.me/public_html/wp-content/plugins/advanced-custom-fields/core/api.php on line 1104
The form is created however Picture and Date picker don’t Work.
Latest WP and Clean install no other plugins.
Any Ideas out there ??
Similar issue. WP 3.9. ACF 4.3.7. My “Create a new task” submit button displays, but no form, and this error message: “Warning: array_merge() [function.array-merge]: Argument #1 is not an array in …wp-content/plugins/advanced-custom-fields/core/api.php on line 1185”
<?php acf_form(array(
'post_id' => 'new_post',
'new_post' => array(
'post_type' => 'todo_task',
'post_status' => 'publish'
),
'submit_value' => 'Create a new task'
)); ?>
having the same problem here.. Has anyone figured out a solution yet?
Any feedback would be appreciated, thanks!
Error: “Warning: array_merge() [function.array-merge]: Argument #1 is not an array in …wp-content/plugins/advanced-custom-fields/core/api.php on line 1185″
same here. it does not work, if you use the example for creating new posts found here:
http://www.advancedcustomfields.com/resources/functions/acf_form/
it throws a “Warning: array_merge(): Argument #1 is not an array in *ROOT*\wp-content\plugins\advanced-custom-fields\core\api.php on line 1185
<?php acf_form_head(); ?>
<?php get_header(); ?>
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php /* The loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php acf_form(array(
'post_id' => 'new_post',
'new_post' => array(
'post_type' => 'event',
'post_status' => 'publish'
),
'submit_value' => 'Create a new event'
)); ?>
<?php endwhile; ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?
help would be much appreciated…
hi guys,
I’ve solved this issue, unfortunately by modifying *ROOT*\wp-content\plugins\advanced-custom-fields\core\api.php
all you need to do is add new line with:
'new_post' => array(),
right after this:
'updated_message' => __("Post updated", 'acf'),
I know it’s not a good thing to modify core files of the plugin, but the fact is it’s ACF’s bug
Cheers orco, I’ll give it a try and report back to confirm the results 🙂
I just had a reply from @Elliot Condon who reminded me that the documentation pages like http://www.advancedcustomfields.com/resources/functions/acf_form/ have a drop-down at the top…
The 'new_post'
array is only for V5, but V4.x uses 'post_status' => 'draft'
and some other goodies.
If any of you with the problem are on V4.x then this may be helpful – it’s different sample code in the documentation 😉
Thanks! After struggling a few hours with this I think it would be a good idea if the Docs display the stable version by default.. I did not notice the dropdown 🙂
I’m getting the error too, and unfortunately, modifying the core plugin is the only fix.
The topic ‘ACF Form Error Messages’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.