to be clear, I get this message when I try to upload an image to the following form:
<?php
/**
* The main template file.
*
* @package Backyard Cures
*/
?>
<?php acf_form_head(); ?>
<?php get_header(); ?>
<div id="submit-cure-all-content" class="all-content">
<div id="submit-cure-form-content-container" class="all-content-container">
<div id="primary">
<div id="content" role="main">
<?php /* The loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php acf_form(array(
'post_id' => 'new',
'field_groups' => array( 66 ),
'submit_value' => 'Publish Your Cure!',
'id' => 'byc'
)); ?>
<?php endwhile; ?>
</div><!-- #content -->
</div><!-- #primary -->
</div>
</div>
</body>
</html>
Here is the code from my functions.php file for good measure:
function my_pre_save_post( $post_id ) {
// check if this is to be a new post
if( $post_id != 'new' )
{
return $post_id;
}
if ($_POST['id'] == 'byc') {
// Create a new post
$post = array(
'post_status' => 'draft',
'post_title' => $_POST['fields']['field_53f3c10f19d51'],
'post_type' => 'byc_cure',
);
// insert the post
$post_id = wp_insert_post( $post );
// update $_POST['return']
$_POST['return'] = add_query_arg( array('post_id' => $post_id), $_POST['return'] );
// return the new ID
return $post_id;
}
}
add_filter('acf/pre_save_post' , 'my_pre_save_post' );
Hi, I am getting the same error, here is the console message:
Uncaught ReferenceError: wp is not defined input.min.js?ver=4.3.8:1
acf.fields.image.popup input.min.js?ver=4.3.8:1
(anonymous function) input.min.js?ver=4.3.8:1
n.event.dispatch jquery.js?ver=1.11.0:3
r.handle jquery.js?ver=1.11.0:3
It is pointing me to:
... wp.media({states: ...
in my input.min.js file
I have this problem as well. Anyone have a solution?
When I click on the Add Image on any of my front end forms I get the following error in the console:
Uncaught ReferenceError: wp is not defined input.min.js?ver=4.3.8:1
acf.fields.image.popup input.min.js?ver=4.3.8:1
(anonymous function) input.min.js?ver=4.3.8:1
n.event.dispatch jquery.js?ver=1.11.0:3
r.handle jquery.js?ver=1.11.0:3
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.