@jazzman7

Как исправить php ошибки?

Доброго времени суток.
Wordpress без устали пишет мне это в логах
[02-Jan-2021 10:12:57 UTC] PHP Warning: preg_match() expects parameter 2 to be string, array given in /home/websart/public_html/wp-includes/class-wp-block-parser.php on line 417
[02-Jan-2021 10:12:57 UTC] PHP Warning: strlen() expects parameter 1 to be string, array given in /home/websart/public_html/wp-includes/class-wp-block-parser.php on line 489

417 строка: $this->offset

function next_token() {
		$matches = null;

		/*
		 * aye the magic
		 * we're using a single RegExp to tokenize the block comment delimiters
		 * we're also using a trick here because the only difference between a
		 * block opener and a block closer is the leading `/` before `wp:` (and
		 * a closer has no attributes). we can trap them both and process the
		 * match back in PHP to see which one it was.
		 */
		$has_match = preg_match(
			'/<!--\s+(?P<closer>\/)?wp:(?P<namespace>[a-z][a-z0-9_-]*\/)?(?P<name>[a-z][a-z0-9_-]*)\s+(?P<attrs>{(?:(?:[^}]+|}+(?=})|(?!}\s+\/?-->).)*+)?}\s+)?(?P<void>\/)?-->/s',
			$this->document,
			$matches,
			PREG_OFFSET_CAPTURE,
			$this->offset
		);


489 строка $length = $length ? $length : strlen( $this->document ) - $this->offset;
function add_freeform( $length = null ) {
		$length = $length ? $length : strlen( $this->document ) - $this->offset;

		if ( 0 === $length ) {
			return;
		}

		$this->output[] = (array) self::freeform( substr( $this->document, $this->offset, $length ) );
	}


Что самое интересное, этот файл появился после последнего обновления WP. Теперь не могу понять, как это исправить, подскажите кто знает ?
  • Вопрос задан
  • 166 просмотров
Пригласить эксперта
Ответы на вопрос 1
@WordPressLab
1. Это не ошибки, а предупреждения.
2. Вы хотите внести кастомные правки в ядро WP - не надо так делать.

Видимо какой-то из Ваших плагинов, связанных редактором блоков, передает массив вместо строки.
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы