@LionNomad1

Ошибка на сайте WordPress PHP Warning: call_user_func_array() expects parameter 1?

Доброго времени суток. Помогите решить возникшую проблему на сайте Wordpress. Используется Woocommerce и плагин Woo-product-table. С недавних пор не загружается админка, выдает 504 Gateway Time-out nginx-reuseport/1.21.1 (при отключении плагина Woo-product-table в админку получается зайти, а при включении не пускает).

Посмотрел по debug, выдаёт следующую ошибку:
PHP Warning:  call_user_func_array() expects parameter 1 to be a valid callback, function 'my_price_replace' not found or invalid function name in /home/m/mtstroy/metallstroy/public_html/wp-includes/class-wp-hook.php on line 308


В файле class-wp-hook.php 308 строка выделена жирным $value = call_user_func_array( $the_['function'], $args );:

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;
	}


В файле function.php есть следующая строка:
add_filter( 'woocommerce_get_price_html', 'my_price_replace', 1, 2 );


Но при её удалении, проблема не уходит. Как решить? Большое спасибо за вашу помощь.
  • Вопрос задан
  • 446 просмотров
Пригласить эксперта
Ответы на вопрос 1
Le_Traceur_Snork
@Le_Traceur_Snork
PHP-программист | Wordpress
Судя по всему, у Вас нет функции my_price_replace, по крайней мере, в общем неймспейсе
Ответ написан
Ваш ответ на вопрос

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

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