1)
Could you please activate WP_DEBUG from wp-config.php file and send me possible errors for review.
2)
if #1 does not help.
Could you please share link of the page where you've added your CRED form.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).
I have set the next reply to private which means only you and I have access to it.
I checked your issue and strange thing is that when I try to test first time, it calls the "cred_save_data" hook successfully and after that it just redirects to another page and "cred_save_data" hook hook it not called. It's really tstrange.
I suggest:
Could you please try to resolve your issue by deactivating all third-party plugins as well as with the default theme to check for any possible conflicts with any of the plugins or themes?
Now, as far as I can see the issue is from this line of code: date_i18n( 'Y-m-d h:i:s', localtime());,
Could you plese try to check by replacing above code with some static value and check if that works or is this issue comes from your theme, or PHP version.
date_i18n() accept second parameter as unix timestamp but here localtime() returns value as array, you may try to check this as well.
AND
When I used first the code I wrote in the first item of this thread, I saw an error you can see in the screenshot.
(without your specific test code)
Yes - I shared that code in my previous reply that I've tried to add the said code to your default theme's functions.php file.
I suggest:
- remove 'cred_save_data_2141' hook from your current theme's function.php file.
- copy your CRED forms related "cred_save_data_xx" hooks code from 'Camper' theme's functions.php file and paste it to your default theme's (twentysixteen) functions.php file.
(make sure you have copy all 'cred_save_data' hooks which your CRED forms are using )
- I think the errors is due to 'date_i18n()' function that accept second parameter as unix timestamp but here localtime() returns value as array, you may try to check this instated of some default value.
For example:
$my_post = array(
'ID' => $post_id,
//'post_date' => date_i18n( 'Y-m-d h:i:s', localtime()), I've commented this line
'post_date' => 'HERE-TRY-WITH-SOME-DEFAULT-VALUE',
);
the post-date changed into 20-05-2016 12.20.48 (European)
"I think the errors is due to 'date_i18n()' function that accept second parameter as unix timestamp but here localtime() returns value as array, you may try to check this instated of some default value."
But: How do I change the date automatically if date_i18n() isn't always working good?
My client want to change the postdate into today plus 65 days, but also with local time (Amsterdam - Western Europa)
I installed the plugin WordPress phpinfo() for system information:
PHP Version 5.6.21
System Linux www70.totaalholding.nl 2.6.32-673.8.1.lve1.4.3.el6.x86_64 #1 SMP Wed Feb 10 08:57:30 EST 2016 x86_64
it is also unix, and the original (live) site (without updates) has this information:
PHP Version 5.6.20-0+deb8u1
System Linux hosting 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1 (2015-05-24) x86_64
Is there a difference in system - date / localtime?