Предупреждение: preg_match () ожидает, что параметр 2 будет строкой, а массив задан как ошибка в теме LMS - PullRequest
0 голосов
/ 31 января 2020

Я недавно установил тему LMS на WordPress. Я получаю эту ошибку после включения отладки:

Предупреждение: preg_match () ожидает, что параметр 2 будет строкой, массив указан в wp-includes / class-wp-block-parser. php on линия 417.

Код:

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  // this is line 417
    );

1 Ответ

0 голосов
/ 11 февраля 2020

У меня возникла та же проблема. Мне пришлось понизить до WP core 5.1.1

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...