2017-01-23 129 views
1

我在我的WordPress網站上,這些重複消息在我的儀表板上彈出。我正在使用WordPress 4.7.1。我沒有在我的網站上的FeedWordPress插件,因爲我看到他們也有這個錯誤的問題。警告:call_user_func_array()期望參數1是一個有效的回調,沒有數組或字符串

警告:call_user_func_array()預計參數1是一個有效的 回調,沒有在 /home/mydomain/public_html/wp-includes/class-wp-hook.php給定線298

數組或字符串

警告:call_user_func_array()預計參數1是一個有效的 回調,沒有在 /home/mydomain/public_html/wp-includes/class-wp-hook.php給定線陣列或串298

此線是298

$value = call_user_func_array($the_['function'], $args); 

這是包含線298

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 ] = $priority = current($this->iterations[ $nesting_level ]); 

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

      // Avoid the array_slice if possible. 
      if ($the_['accepted_args'] == 0) { 
       $value = call_user_func_array($the_['function'], array()); 
      } 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; 
} 

這是一個嚴重的警告功能?如果是這樣,我該如何解決這個問題?

+0

https://wordpress.org/support/topic/call_user_func_array-expects-parameter-1-to-be-valid-custom-function/和[跨站點重複數據刪除](HTTP:// wordpress的。 stackexchange.com/questions/108860/error-call-user-func-array-expects-parameter-1-to-be-a-valid-callback) – Machavity

+0

我敢打賭問題是'add_filter'和任何地方你告訴WP稱這個 – Machavity

+0

不幸的是,這個錯誤是誤導。問題可能發生在列出的線路上,但是在其他地方觸發 –

回答

0

只是爲了更新這個線程 - 我有同樣的錯誤升級到4.7.2。我停用了我的插件一個接一個,發現一個導致問題

+0

請發佈插件名稱以幫助其他用戶。 –

0

你說你停用了一些插件並修復了它。什麼插件是造成這個問題,因爲我得到相同的東西

0

我有同樣的問題。我禁用了Slider Revolution插件並修復了這個問題。

希望它有幫助!

0
I am not getting the exact solution, but I got a temporary solution for immediate basis, 
just hide it, I use the function on the top of the file after 
'<?php' start. It disables the warning. 

       define('WP_DEBUG_DISPLAY', false); //It's work for me 

       You may also try 

       ini_set('display_errors','Off'); 
       ini_set('error_reporting', E_ALL); 
       define('WP_DEBUG', false); 
相關問題