Home › Forums › ACF PRO › Can't Save Post if I Add a URL to a Text/URL Field??? › Reply To: Can't Save Post if I Add a URL to a Text/URL Field???
Hmm… I enabled WP debug and I saw this appear repeatedly throughout the site:
Notice: is_main_query was called incorrectly. In pre_get_posts, use the WP_Query::is_main_query() method, not the is_main_query() function. See http://codex.wordpress.org/Function_Reference/is_main_query. Please see Debugging in WordPress for more information. (This message was added in version 3.7.) in /home/onestopmods/public_html/wp-includes/functions.php on line 3245
I deactivated the plugin, but I couldn’t access the site after that because of a get_field error (I assume this is normal if the plugin is deactivated) so I can’t really say if the plugin is the one causing this.
Also, if debug mode is on and if the plugin is enabled, I’m unable to even click “submit”.
Here’s the code for my “Add Post” page:
<?php
/*
Template Name: Add Post
*/
acf_form_head();
get_header();
$specat = $_GET['cat'];
if($specat == 2){$namecat = Minecraft;}
?>
<div id="main" class="full-width"><div class="wrap cf">
<div id="content" role="main">
<?php while (have_posts()) : the_post(); ?>
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<h1 class="page-title">Submitting a Mod for: <?php echo $namecat; ?></h1>
<div class="page-content rich-content">
<?php
if($specat == 2){$specicat = 1193;}
acf_form(array(
'post_title' => true,
'post_content' => true,
'post_id' => 'new_post',
'new_post' => array(
'post_title' => 'New Post',
'post_type' => 'post',
'post_status' => 'pending',
'post_category' => array("$specat") ,
),
'field_groups' => array( 1185, 1191, $specicat, 1197, 1200),
'submit_value' => 'Submit Your Mod',
'return' => 'http://onestopmods.com/view-mods/',
)); ?>
</div>
</div><!--end .hentry-->
<?php endwhile; ?>
</div><!--end #content-->
</div></div><!-- end #main -->
<?php get_footer(); ?>
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.