• При переносе сайта на другой хостинг выдает:
    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘astra_single_post_navigation_markup’ not found or invalid function name in /var/www/u1100098/data/www/dev.valdo-bar.ru/wp-includes/class-wp-hook.php on line 303

    Код из файла (строка выделена):

    `/**
    * Calls the callback functions that have been added to a filter hook.
    *
    * @since 4.7.0
    *
    * @param mixed $value The value to filter.
    * @param array $args Additional parameters to pass to the callback functions.
    * This array is expected to include $value at index 0.
    * @return mixed The filtered value after all hooked functions are applied to it.
    */
    public function apply_filters( $value, $args ) {
    if ( ! $this->callbacks ) {
    return $value;
    }

    $nesting_level = $this->nesting_level++;

    $this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
    $num_args = count( $args );

    do {
    $this->current_priority[ $nesting_level ] = current( $this->iterations[ $nesting_level ] );
    $priority = $this->current_priority[ $nesting_level ];

    foreach ( $this->callbacks[ $priority ] as $the_ ) {
    if ( ! $this->doing_action ) {
    $args[0] = $value;
    }

    // Avoid the array_slice() if possible.
    if ( 0 == $the_[‘accepted_args’] ) {
    $value = call_user_func( $the_[‘function’] );
    } elseif ( $the_[‘accepted_args’] >= $num_args ) {
    $value = call_user_func_array( $the_[‘function’], $args );
    } else {
    $value = call_user_func_array( $the_[‘function’], array_slice( $args, 0, (int) $the_[‘accepted_args’] ) );
    }
    }
    } while ( false !== next( $this->iterations[ $nesting_level ] ) );

    unset( $this->iterations[ $nesting_level ] );
    unset( $this->current_priority[ $nesting_level ] );

    $this->nesting_level—;

    return $value;
    }

    Страница, с которой нужна помощь: [войдите, чтобы увидеть ссылку]

Просмотр 3 ответов — с 1 по 3 (всего 3)
  • Плагины обновили, версия php была 7.4.9 — стала версия php 7.3.26

    Модератор Sergey Biryukov

    (@sergeybiryukov)

    Live and Learn

    Код из файла (строка выделена)

    Ошибка не здесь, где-то в теме или плагинах есть строка вида

    
    add_action( 'astra_entry_after', 'astra_single_post_navigation_markup' );
    

    без самой функции astra_single_post_navigation_markup().

    Возможно, файлы темы скопированы не полностью. Проверьте наличие и размер файла themes/astra/inc/blog/single-blog.php, функция определена в нём.

    Нашла. В файле single-blog.php стерт кусок кода, отечающий за ссылки на предыдущую, следующую запись, т.к. видимо, они были не нужны.
    Как теперь лучше поступить? Вернуть код обратно?
    Я думаю, удалили, потому-что другие способы не сработали…

Просмотр 3 ответов — с 1 по 3 (всего 3)
  • Тема «Ошибка в class-wp-hook.php на другом хостинге» закрыта для новых ответов.