I keep getting this error Call to a member function modify() on boolean
with this code
$date_value = the_sub_field( 'date_string' );
$date = DateTime::createFromFormat('d/m/Y', $date_value);
$date->modify('+1 day');
The last line gives me an error. Both of my formats (display and return inside of ACF) are the same 'd/m/Y'
Really frustrating stuff!
I keep getting this error Call to a member function modify() on boolean
with this code
$date_value = the_sub_field( 'date_string' );
$date = DateTime::createFromFormat('d/m/Y', $date_value);
$date->modify('+1 day');
The last line gives me an error. Both of my formats (display and return inside of ACF) are the same 'd/m/Y'
Really frustrating stuff!
Share Improve this question asked Oct 14, 2019 at 16:51 ivan marchenkoivan marchenko 1491 silver badge6 bronze badges1 Answer
Reset to default 0the_sub_field() echoes out the sub field. Use get_sub_field() instead.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745082181a4610195.html
评论列表(0条)