strpos (): аргумент № 1 ($ haystack) должен быть из строки типа, массив, приведенный < /p>
< /blockquote>
Код, от которого я получаю ошибку, является следующим: < /p>
Код: Выделить всё
// woocommerce field
if ( $field === '_gallery_images' ) {
// set the image prefix if there is one
$prefix = '';
if ( $tmp_field['prefix'] !== '' ) {
$prefix = $tmp_field['prefix'];
}
// if value is not an array, try to create one
// this may be due to comma separated urls or space separated
if ( ! is_array( $our_value ) ) {
// if we have comma separated URL's, create an array
// Error is coming from this next line
if ( strpos( $our_value, ',' ) !== false ) {
$array = explode( ',', $our_value );
if ( is_array( $array ) ) {
$our_value = $array;
}
}
< /code>
Он получает это значение от API и пытается взорвать URL -адреса SEP: < /p>
11104_105-b.jpg, 11104_105.jpg, 11104_105-c.jpg, 11104_105-d.jpg
Подробнее здесь: https://stackoverflow.com/questions/796 ... rray-given