2016-12-13 6 views
-1

注意:/var/www/admin/data/www/test.com/wp-content/themes/の非オブジェクトのプロパティを取得しようとしています。ライン上のBD/INC/BLT-のfunctions.php 638PHP通知:非オブジェクト行のプロパティを取得しようとしています。638

 if(!function_exists('blt_get_comment')){ 
      function blt_get_comment($comment, $args, $depth){ 

(LINE 638)  $author_comment_id = get_user_by('email', get_comment_author_email())->ID; 
       $comment_score = get_comment_meta(get_comment_ID(), 'blt_score', true); 
       if(empty($comment_score)){ 
        $comment_score = 0; 
       } 
+2

ない場合

$user = get_user_by('email', get_comment_author_email()); $author_comment_id = (($user != FALSE) ? $user->ID : 0); //or a check like this if(!$user) { return false; } 

注意、 '、後で確認することは良い考えかもしれません - > ID'エラーが来るのポイントのthats:あなたはそうのように、チェックを行う必要がありますから、 'get_user_by'は期待されるものを返さない – JustOnUnderMillions

+0

どうすればこのエラーを修正できますか? – Nonstop

+1

私はWordPressに非常に精通していませんが、 'var_dump(get_comment_author_email();'の結果を表示します。 – spencdev

答えて

0

それは意味し、get_user_byは、ユーザーが見つかりませんでした意味、FALSEを返しています。 $author_comment_idが0

+0

Спасибо、решениепомогло!Tnx – Nonstop

関連する問題