Home › Forums › ACF PRO › After Upgrade to V5 › Reply To: After Upgrade to V5
First I change:
$_POST['fields'][...
to $_POST['acf'][...
Second:
if( $post_id != 'new' )
->if( $post_id != 'new_post' )
Now I have only two problem.
First: When I create a new project, I will look for the start and end of a project. In the past I got a feedback when the end date was before the start date. Now nothing happen.
Under “Projekt einreichen” you will find what I mean (this is ACF V4, but I am testing on V5 for the future)
I control the div #acf-sdate
and #acf-adate
with a javascript:
jQuery(document).ready(function($) {
//Abschluss
$('#acf-adate > div input').change(
function () {
var datumStart = $('#acf-sdate > div > input').val();
var datumAbschluss = $('#acf-adate > div > input').val();
if (datumStart){
if (datumStart > datumAbschluss) {
$('#acf-adate > div > input').val('');
$('#acf-adate').addClass('error');
} else if ($('#acf-adate').hasClass('error')) {
$('#acf-adate').removeClass('error');
}
}
}
);
//Start
$('#acf-sdate > div input').change(
function () {
var datumStart = $('#acf-sdate > div > input').val();
var datumAbschluss = $('#acf-adate > div > input').val();
if (datumAbschluss){
if (datumStart > datumAbschluss) {
$('#acf-sdate > div > input').val('');
$('#acf-sdate').addClass('error');
} else if ($('#acf-sdate').hasClass('error')) {
$('#acf-sdate').removeClass('error');
}
}
}
);
}
);
Second: Everytime I push a project, I push two posts. One in projects-all and one in posts:
<?php acf_form(array(
'post_id'=> 'new_post',
'field_groups' => array ( 1098 ),
'return' => home_url('thank-you'),
'submit_value'=> 'Projekt einreichen'
)); ?>
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.