Home › Forums › Front-end Issues › Creating wp archive using custom field filter and PHP7 › Reply To: Creating wp archive using custom field filter and PHP7
When you do something like this
$array = 'value';
You are adding a value to an array. This assumes that the array already exists. PHP would go ahead and create the array. PHP7.2 is a little more strict, at least I think that is what was happening. So what you need to do is
$array = array(); $array = 'value';
Or in the example I gave above, create the array with the first value at the same time
$array = array('value');
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!
🚨 The 2023 ACF Annual Survey closes tomorrow! This is your last chance to complete the survey and help guide the evolution of ACF. https://t.co/0cgr9ZFOJ5— Advanced Custom Fields (@wp_acf) May 18, 2023
© 2023 Advanced Custom Fields.